PH QTP Null question

Smith Vaughn SmithVa@WSDOT.WA.GOV
Thu, 6 Aug 1998 14:31:45 -0700


I haven't used QTP for about a year, so forgive me if the following is
generally known; I can't remember ever hearing about it.

I called Cognos support to ask about QTP and nulls.  The manual
says that null is supported, and I have used them before.  My problem
is that a QTP "output add" put 17-Nov-1858 in a table rather than null.
I know that this is the VMS zero value for a date based on the modern 
astronomical calendar.  I wanted to know why QTP put the value 
in the RDB (v6) date timestamp item when I expected a null.

When I called support, I couldn't duplicate or explain the problem
adequately.  Before I call them back, I wanted to put the issue forth
here.  During the course of investigating, I discovered what QTP is
doing.  QTP is storing 0 in my item if there is a not null constraint on
the database column rather than quitting with a constraint violation
error.  I still don't know why, but here is what a test script shows:

$sql
create table test_table (x timestamp(2));
commit;
$!
$ qtp

Q T P   (7.10.F1)
Copyright 1996 COGNOS INC. (ALPHA)
Licensed PH-AXP-DEVELOPMENT

> access system_wide in posdb
> output test_table in posdb add
> item x final null
> go

Records read:
 SYSTEM_WIDE                               1

Transactions processed:                    1

Records processed:     Added    Updated  Unchanged    Deleted
 TEST_TABLE               1          0          0          0

Finished.
$!
$sql 
select * from test_table;
 X                        
 NULL                     
1 row selected
delete from test_table;
1 row deleted
alter table test_table
  alter column x constraint x_nn not null deferrable;
commit;
$!
$qtp
> access system_wide in posdb
> output test_table in posdb add
> item x final null
> go

Records read:
 SYSTEM_WIDE                               1

Transactions processed:                    1

Records processed:     Added    Updated  Unchanged    Deleted
 TEST_TABLE                1          0          0          0
$!
$sql
select * from test_table;
 X                        
 1858-11-17 00:00:00.00   


Thanks for reading this far
Vaughn Smith
DBA, Washington State Ferries
Seattle, WA
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.