Board index » delphi » Dynamic SQL Error /SQL error code = -104/Unexpected end of command

Dynamic SQL Error /SQL error code = -104/Unexpected end of command

I'm using IB6 and try to create a trigger like this:

CREATE TRIGGER TR_SELL FOR LG_SHIPMENT_BUY_SELL
ACTIVE BEFORE INSERT POSITION 0
AS
DECLARE VARIABLE SHIPMENT VARCHAR(50);
BEGIN
SELECT SHIPMENT_ID FROM SHIPMENT WHERE TYPES = 'S' AND SHIPMENT_ID = NEW.SHIPMENT_SELL_ID into SHIPMENT;
IF( SHIPMENT IS NULL ) THEN
EXCEPTION NOT_SELL;
END

(LG_SHIPMENT_BUY_SEL,SHIPMENT ARE TABLES (already created)
NOT_SELL exception - created)

I'm getting the error mentioned in the subject. Any clue?
Thanks
Liliana

 

Re:Dynamic SQL Error /SQL error code = -104/Unexpected end of command


SET TERM ^;
CREATE ...
BEGIN
    ...
END^
SET TERM ;^

--
Sergio Samayoa
Lgica Software
http://www.geocities.com/logicasw/

"LILIANA SELEA" <LSE...@LOGGATE.COM> escribi en el mensaje
news:3bb0e6bd$1_2@dnews...

Quote

> I'm using IB6 and try to create a trigger like this:

> CREATE TRIGGER TR_SELL FOR LG_SHIPMENT_BUY_SELL
> ACTIVE BEFORE INSERT POSITION 0
> AS
> DECLARE VARIABLE SHIPMENT VARCHAR(50);
> BEGIN
> SELECT SHIPMENT_ID FROM SHIPMENT WHERE TYPES = 'S' AND SHIPMENT_ID =

NEW.SHIPMENT_SELL_ID into SHIPMENT;
Quote
> IF( SHIPMENT IS NULL ) THEN
> EXCEPTION NOT_SELL;
> END

> (LG_SHIPMENT_BUY_SEL,SHIPMENT ARE TABLES (already created)
> NOT_SELL exception - created)

> I'm getting the error mentioned in the subject. Any clue?
> Thanks
> Liliana

Re:Dynamic SQL Error /SQL error code = -104/Unexpected end of command


SERGIO, THANKS, IT WORKED.

LILIANA

Quote
"Sergio Samayoa" <serg...@terra.com.gt> wrote:
>SET TERM ^;
>CREATE ...
>BEGIN
>    ...
>END^
>SET TERM ;^

>--
>Sergio Samayoa
>Lgica Software
>http://www.geocities.com/logicasw/

>"LILIANA SELEA" <LSE...@LOGGATE.COM> escribi en el mensaje
>news:3bb0e6bd$1_2@dnews...

>> I'm using IB6 and try to create a trigger like this:

>> CREATE TRIGGER TR_SELL FOR LG_SHIPMENT_BUY_SELL
>> ACTIVE BEFORE INSERT POSITION 0
>> AS
>> DECLARE VARIABLE SHIPMENT VARCHAR(50);
>> BEGIN
>> SELECT SHIPMENT_ID FROM SHIPMENT WHERE TYPES = 'S' AND SHIPMENT_ID =
>NEW.SHIPMENT_SELL_ID into SHIPMENT;
>> IF( SHIPMENT IS NULL ) THEN
>> EXCEPTION NOT_SELL;
>> END

>> (LG_SHIPMENT_BUY_SEL,SHIPMENT ARE TABLES (already created)
>> NOT_SELL exception - created)

>> I'm getting the error mentioned in the subject. Any clue?
>> Thanks
>> Liliana

Other Threads