Subject | Re: create trigger using isql |
---|---|
Author | Adam |
Post date | 2005-04-28T23:54:43Z |
Hi Paul,
Set term basically stops the ; required within the trigger or stored
procedure from being interpreted as a command in isql. You are
essentially saying with the top line, treat !! as the end of command
rather than the ;
The last line, changes it back to ; as the end of command.
set term !!;
create trigger i_tripid for trip
active before insert
as
begin
if(new.tripid is null) then
new.tripid = gen_id(autonumber,1);
end
!! -- you forgot this
set term ;!!
So iSQL thought that the set term was part of the trigger, hence the
syntax complaint.
Adam
--- In firebird-support@yahoogroups.com, Paul Surette <paules@n...>
wrote:
Set term basically stops the ; required within the trigger or stored
procedure from being interpreted as a command in isql. You are
essentially saying with the top line, treat !! as the end of command
rather than the ;
The last line, changes it back to ; as the end of command.
set term !!;
create trigger i_tripid for trip
active before insert
as
begin
if(new.tripid is null) then
new.tripid = gen_id(autonumber,1);
end
!! -- you forgot this
set term ;!!
So iSQL thought that the set term was part of the trigger, hence the
syntax complaint.
Adam
--- In firebird-support@yahoogroups.com, Paul Surette <paules@n...>
wrote:
> I have been trying to create a trigger without any luck and washoping
> someone might have some idea what i am doing wrong.not ;.
>
> my table has the field tripid integer not null primary key.
> my generator is autonumber.
> when I try:
> set term !!;
> create trigger i_tripid for trip
> active before insert
> as
> begin
> if(new.tripid is null)
> then
> new.tripid = gen_id(autonumber,1);
> end
> set term ;!!
>
> I get the error response:
> SQL error code = -104
> Token unknown - line 9, char 1
> set
>
> my trigger is not created and my line terminator is in fact !!
>
> Thanks in advance
>
> ---
> Paul
>
>
> [Non-text portions of this message have been removed]