Triggers crash VStudio
Bart Pietercil
bart.pietercil at gmail.com
Fri Jun 1 10:21:43 CDT 2007
Hi List, Ruslan
anybody sees what could be wrong this trigger:
CREATE OR REPLACE TRIGGER trig_ratingsystems_BI BEFORE INSERT ON
rating_systems FOR EACH ROW BEGIN NEW.created_datetime = NOW
();NEW.updated_datetime = Now();END;
It does not throw an exception on creating the trigger but crashes
VStudio when I do an insert like this:
insert into rating_systems(rs_name,rs_description)values('test','aha')
VStudio does NOT crash when disabling the before insert trigger (so
the insert statement is valid)
Schema of rating_systems is:
//rating_systems
aTable = CreateTable("rating_systems",EVTableKind.kTblPermanent)
VarCharField = aTable.CreateVarCharField("rs_name",
512,EVFlag.fUnique)
VarCharField = aTable.CreateVarCharField("rs_description",2044)
DateTimeField = aTable.CreateDateTimeField("created_datetime")
DateTimeField = aTable.CreateDateTimeField("updated_datetime")
aQuery = _
"CREATE OR REPLACE TRIGGER trig_ratingsystems_BI BEFORE INSERT
ON rating_systems FOR EACH ROW " + _
"BEGIN " + _
"NEW.created_datetime = NOW();" + _
"NEW.updated_datetime = Now();" + _
"END;"
call SqlExecute(aQuery)
aQuery = _
"CREATE OR REPLACE TRIGGER trig_ratingsystems_BU BEFORE UPDATE
ON rating_systems FOR EACH ROW " + _
"BEGIN "+ _
"NEW.updated_datetime = Now();" + _
"END;"
call SqlExecute(aQuery)
TIA
Bart Pietercil
More information about the Valentina
mailing list