Subject | Re: [ib-support] XCase and Interbase 6 |
---|---|
Author | Paul Reeves |
Post date | 2001-02-07T16:42:32Z |
Carlo,
It looks suspiciously as if the SET TERM is not being called.
Before each trigger statement there should be something like
SET TERM ^;
then end the trigger statement with
END^ (not END;)
and then call
SET TERM ;^
to reset the terminator.
Without the above ISQL believes you are trying to execute the following series
of statements:
CREATE TRIGGER T_BI_MyTable FOR MyTable BEFORE INSERT AS
DECLARE VARIABLE row_count INTEGER;
BEGIN
IF (new.IDSECONDTABLE is not null) THEN
BEGIN
SELECT COUNT(*)
FROM SECONDTABLE
WHERE SECONDTABLE .ID = NEW.IDSECONDTABLE
INTO :row_count ;
IF (row_count = 0) THEN
BEGIN
EXCEPTION xc_i_res ;
END
END
END;
Not surprisingly, an error is thrown.
I'm surprised that XCase doesn't deal with this automatically - it is a pretty
fundamental aspect of Client/Server SQL scripting. Perhaps you have missed a
setting somewhere?
Paul
--
Paul Reeves
http://www.ibphoenix.com
taking InterBase further
It looks suspiciously as if the SET TERM is not being called.
Before each trigger statement there should be something like
SET TERM ^;
then end the trigger statement with
END^ (not END;)
and then call
SET TERM ;^
to reset the terminator.
Without the above ISQL believes you are trying to execute the following series
of statements:
CREATE TRIGGER T_BI_MyTable FOR MyTable BEFORE INSERT AS
DECLARE VARIABLE row_count INTEGER;
BEGIN
IF (new.IDSECONDTABLE is not null) THEN
BEGIN
SELECT COUNT(*)
FROM SECONDTABLE
WHERE SECONDTABLE .ID = NEW.IDSECONDTABLE
INTO :row_count ;
IF (row_count = 0) THEN
BEGIN
EXCEPTION xc_i_res ;
END
END
END;
Not surprisingly, an error is thrown.
I'm surprised that XCase doesn't deal with this automatically - it is a pretty
fundamental aspect of Client/Server SQL scripting. Perhaps you have missed a
setting somewhere?
Paul
--
Paul Reeves
http://www.ibphoenix.com
taking InterBase further