Re: Stored Functions - Mailing list pgsql-jdbc

From Anders Hermansen
Subject Re: Stored Functions
Date
Msg-id 20030829085119.GC32413@online.no
Whole thread Raw
In response to Stored Functions  ("Yolanda Phillips" <yphillips@dlkconsulting.co.za>)
List pgsql-jdbc
* Yolanda Phillips (yphillips@dlkconsulting.co.za) wrote:
> I'm wanting to do an insert, then if it was successfull the function should
> return the id. This id is using a sequence.nextval(). How do I return the
> new id?

After the insert statement, run a new statement:
SELECT curval('sequencename')

This statement will return the id.


Hope this helps,
Anders

--
Anders Hermansen
YoYo Mobile as

pgsql-jdbc by date:

Previous
From: "Yolanda Phillips"
Date:
Subject: Stored Functions
Next
From: Dave Cramer
Date:
Subject: Re: Stored Functions