October 8th, 2003, 12:01 PM
Join Date: Oct 2003
Time spent in forums: < 1 sec
Reputation Power: 0
Creating autoinc trigger in Firebird
I am a newcomer to Firebird and need a little help. I have been using IBOConsole with Firebird 1.5 and have successfully created a databse and tables. However, in one of the tables I wanted to set an autoincrement id field. Using IBOConsole, I set the following parameters in the New Trigger wizard:
I then used the following code:
IF ( ( NEW.MemberID IS NULL) OR NEW.MemberID <= 0) ) THEN
NEW.MemberID = GEN_ID(gen_MemberID,1);
MemberID is an integer column in my table and I had previously created the generator gen_MemberID.
When I click on the compile button, I get a message 'UNKNOWN COLUMN: NEW.MEMBERID'.
Do any of you more experienced Firebird users have any idea why?