On Fri, Apr 11, 2008 at 07:23:04PM +0200, Nacef LABIDI wrote:
> Hi all,
>
> I was wondering if postgres can return the last ID inserted for a table
> which the primary key is autoincremented. I need to retrieve this ID in my
> code to continue processing on that inserted row.
Use select currval()
am Fri, dem 11.04.2008, um 19:23:04 +0200 mailte Nacef LABIDI folgendes:
> Hi all,
>
> I was wondering if postgres can return the last ID inserted for a table which
> the primary key is autoincremented. I need to retrieve this ID in my code to
> continue processing on that inserted row.
Either
Nice idea but how can I use this in a frontend that I am developing using
Delphi and ADO objects ?
On Fri, Apr 11, 2008 at 7:41 PM, Scott Marlowe <[EMAIL PROTECTED]>
wrote:
> On Fri, Apr 11, 2008 at 11:23 AM, Nacef LABIDI <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I was wondering if postgres
On Fri, Apr 11, 2008 at 11:23 AM, Nacef LABIDI <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I was wondering if postgres can return the last ID inserted for a table
> which the primary key is autoincremented. I need to retrieve this ID in my
> code to continue processing on that inserted row.
smarlowe=
Hi all,
I was wondering if postgres can return the last ID inserted for a table
which the primary key is autoincremented. I need to retrieve this ID in my
code to continue processing on that inserted row.
Thanks to all
Pavel & Craig, I'm replying to both of you to save some time :)
All I was really trying to demonstrate was the need to be able to
distinguish a completely null record from one that isn't. I can see
by both of your responses that by incorporating that in a dummy
example I inadvertently adde
Hello
maybe
CREATE OR REPLACE FUNCTION returns_empty_set_maybe()
RETURNS SETOF foo AS $$
res integer;
aux foo;
BEGIN
SELECT INTO res extract('month' from now()::integer % 2;
IF res <> 0 THEN
aux = (5,5);
RETURN NEXT aux;
END IF;
Erik Jones wrote:
Now, let's say I want to call this from another function and test the
result to see if I have a null record (null, null),. I've got the
following working but it feels like there should be something much
simpler but I just can't seem to hit on it. Is this it?
I'm assuming tha