Subject | Re: [firebird-support] ISQL & trigger |
---|---|
Author | Martijn Tonies |
Post date | 2004-10-04T07:04:30Z |
Hello,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> I need a ID (type COUNTER) field in my table, and I discovered that"counter"? Nope, that's not a SQL standard.
> with firebird I have to create a generator to achieve the result
> (But why ? isn't counter a SQL92 standard ?? )
> Just to try and see what happens, I tried with Mitec IBQuery theGEN_ID(my_generator, 1) ;
> exaple given in
> http://firebird.sourceforge.net/manual/migration-mssql-data-types.html
>
> Considering the command was given interactively, i prepended the
> SET TERM !! ; as advised in
> http://www.destructor.de/firebird/storedproc.htm
>
> But after having created the exaple table and the example generator,
> when I try to execute the trigger command here's what happens:
> SET TERM !! ;
> CREATE TRIGGER my_before_trigger FOR my_table
> BEFORE INSERT
> AS
> BEGIN IF (NEW.my_number IS NULL) THEN NEW.my_number =
> GEN_ID(my_generator, 1)
>END !!With regards,
> set term ; !!
>
> What I get is :
> Statement #2:
> Dynamic SQL Error
> SQL error code = -104
> Token unknown - line 5, char 80
> END
>
> Why ? what is wrong ?
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com