Subject | Re: Returning the Primary Key value of a new row added by a stored procedure? |
---|---|
Author | ygboro |
Post date | 2007-08-11T16:39:18Z |
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@...> wrote:
a little more ?
Boro
<m.tonies@...> wrote:
>generator
> Adjust your trigger to only assign a value if the ID columns is empty,
> eg:
>
> IF (NEW.ID IS NULL OR NEW.ID = 0)
> THEN ...
>
> And modify your procedure so that it grabs a new value from the
> first and uses that in the insert. You can safely return that newvalue to
> yourprocedure
> client.
>
> This way, you still have your trigger for SQL that doesn't use the
> AND you have a way to return the new value from your procedure.This is what I am seeking for. Please, Martijn, could you describe it
>
>
> In Firebird 2.0, you could also check the RETURNING VALUES clause
> from an INSERT INTO and get the new value in your procedure and
> return it. Have a look at the Release Notes or new SQL extensions.
>
a little more ?
Boro