
October 8th, 2003, 11:01 AM
|
|
Junior Member
|
|
Join Date: Oct 2003
Location: NC
Posts: 4
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:
Before Insert
Position 0
Active
I then used the following code:
BEGIN
IF ( ( NEW.MemberID IS NULL) OR NEW.MemberID <= 0) ) THEN
NEW.MemberID = GEN_ID(gen_MemberID,1);
END
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?
|