Subject | Re: [firebird-support] How to return generated value in TRIGGER ? |
---|---|
Author | Ionut Ichim |
Post date | 2007-06-20T16:17:26Z |
I'm resending this message because yahoo didn't send
it,or delayed it.
Thanks.
"Returning" is what I was looking for.
Thans also to Martijn Tonies and Mercea Paul.
ibrahim bulut wrote:
Got a little couch potato?
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
it,or delayed it.
Thanks.
"Returning" is what I was looking for.
Thans also to Martijn Tonies and Mercea Paul.
ibrahim bulut wrote:
>psql
> You can do it with firebird 2
>
> Returning clause implemented for insert statements
>
> See the release notes
>
> Insert into table (field1,field2)
>
> Returning field1, field2 into :field1, :field2 //
>Behalf Of Martijn Tonies
> or
>
> Insert into table (field1,field2)
>
> Returning field1, field2 // dsql
>
> _____
>
> From: firebird-support@yahoogroups.com
> <mailto:firebird-support%40yahoogroups.com>
> [mailto:firebird-support@yahoogroups.com
> <mailto:firebird-support%40yahoogroups.com>] On
> Sent: Monday, June 18, 2007 11:59 AMgenerated value in TRIGGER ?
> To: firebird-support@yahoogroups.com
> <mailto:firebird-support%40yahoogroups.com>
> Subject: Re: [firebird-support] How to return
>insert data,for ID I
> Hi,
>
> > I have a trigger on a table :
> >
> > CREATE TRIGGER TRIG_GS_PR_BI FOR GS_PR
> > ACTIVE BEFORE INSERT POSITION 0
> > AS
> > BEGIN
> > IF ((NEW.ID IS NULL) OR (NEW.ID =0)) THEN
> > NEW.ID =NEXT VALUE FOR GEN_GS_PR_ID;
> > END
> >
> > In my application I use a stored procedure to
> send 0get the value written
> as the trigger to use generator.My problem is how to
> in ID, I need it in my app after I call INSERT.Isthere a simple way or a
> have to query table for max(ID).the trigger won't
> > Thanks !
> >
>
> If you don't supply "0" or "null" for the ID column,
> do it's new value.the Stored Procedure
>
> So, why not get a new value from the generator in
> and return that to the client?MySQL, NexusDB,
>
> Martijn Tonies
> Database Workbench - tool for InterBase, Firebird,
> Oracle &<http://www.upscene.com>> com
> MS SQL Server
> Upscene Productions
> http://www.upscene. <http://www.upscene.com
> My thoughts:upscene.com/martijn/
> http://blog. <http://blog.upscene.com/martijn/
> <http://blog.upscene.com/martijn/>>
> Database development questions? Check the forum!<http://www.databasedevelopmentforum.com
> http://www.database
> <http://www.databasedevelopmentforum.com>>__________
> developmentforum.com
>
> __________ NOD32 2336 (20070618) Information
>removed]
> This message was checked by NOD32 antivirus system.
> http://www.eset.com <http://www.eset.com>
>
> [Non-text portions of this message have been
>____________________________________________________________________________________
>
Got a little couch potato?
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz