Obj_ptr = 0

Bart Pietercil bart.pietercil at gmail.com
Tue Oct 9 03:11:19 CDT 2007


Hi List,


This table

     aTable = CreateTable 
("tbl_rating_systems",EVTableKind.kTblPermanent)

     VarCharField = aTable.CreateVarCharField("rs_name", 
512,EVFlag.fIndexed)
     VarCharField = aTable.CreateVarCharField("rs_description",2044)

     PtrField = aTable.CreateObjectPtrField 
("objptr_organisation",Table("tbl_organisations"),   
EVOnDelete.kCascade, EVFlag.fIndexed,"rating_system_of_organisation")

     DateTimeField = aTable.CreateDateTimeField("modification_dt")
     DateTimeField = aTable.CreateDateTimeField("creation_dt")


     PtrField = aTable.CreateObjectPtrField("objptr_modified_by",Table 
("tbl_users"),EVOnDelete.kSetNull ,EVFlag.fIndexed 
+EVFlag.fNullable,"rating_system_modified_by_user")
     PtrField = aTable.CreateObjectPtrField("objptr_created_by",Table 
("tbl_users"),EVOnDelete.kSetNull ,EVFlag.fIndexed 
+EVFlag.fNullable,"rating_system_created_by_user")

     VarCharField = aTable.CreateVarCharField("uniquers_by_org", 
2044,EVFlag.fIndexed+EVFlag.fUnique,"concat 
(rs_name,objptr_organisation)")

     accepts this query:

insert into tbl_rating_systems(rs_name,rs_description) values  
('test','more test')

I would expect that this statement would raise an error on the  
objptr_organisation.
I defined it to not allow null values so I expect an error when I  
pass a null for this field;
instead the null value is automatically converted to 0 AND accepted  
in the table, the next time I would run this query of course would  
generate a not unique error on the uniquers_by_organisation field,
because now this field contains test0

Is this the expected behaviour

TIA

Bart Pietercil


More information about the Valentina mailing list