|Subject||RE: [firebird-support] Re: Slq Server @@IDENTITY equivalent in FB|
> > Hi Everyone,better read that one again Adam, he needs a gen_id not CURRENT_USER
> > I'm still on the process of porting SQL Server DB to
> > Firebird.
> > Does anyone knows of a SQL Server @@IDENTITY
> > equivalent in Firebird.
> > Basically I have:
> > Active BEFORE INSERT trigger for AS_USERS at position
> > 0
> > AS BEGIN
> > IF (NEW.USER_ID IS NULL) THEN
> > NEW.USER_ID = GEN_ID(AS_USERS_SEQ, 1);
> > END
> > After I do my INSERT, I need to know the value of
> > USER_ID to return back to the caller program.
> other useful ones.
> > I'm using Fb 1.5(if that helps)
> You need 1.5 for the context variables.
> Although looking at your code, do you mean rather that you want to
> return a field value from an insert statement? I think that is a
> Firebird 2 feature. For FB 1.5, now you will need to use a stored
> procedure to achieve the same thing.