Re: Stored Functions

From: Anders Hermansen <anders(at)yoyo(dot)no>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Stored Functions
Date: 2003-08-29 08:51:19
Message-ID: 20030829085119.GC32413@online.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

* Yolanda Phillips (yphillips(at)dlkconsulting(dot)co(dot)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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2003-08-29 08:51:48 Re: Stored Functions
Previous Message Yolanda Phillips 2003-08-29 08:29:45 Stored Functions