pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedgetting oid of an INSERT automatically
3+ messages / 2 participants
[nested] [flat]
* getting oid of an INSERT automatically
@ 2002-08-07 18:39 John Brothers <johnbr@undefined.com>
2002-08-08 13:28 ` Re: getting oid of an INSERT automatically Oliver Elphick <olly@lfix.co.uk>
0 siblings, 1 reply; 3+ messages in thread
From: John Brothers @ 2002-08-07 18:39 UTC (permalink / raw)
To: pgsql-sql
Hello all,
In pgplsql, is there any way to get the oid that is returned from an INSERT statement, without
doing a 'follow-up' SELECT for the oid?
failing that, is this possible in jdbc, odbc or DBI?
Thanks,
jb
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: getting oid of an INSERT automatically
2002-08-07 18:39 getting oid of an INSERT automatically John Brothers <johnbr@undefined.com>
@ 2002-08-08 13:28 ` Oliver Elphick <olly@lfix.co.uk>
2002-08-08 19:18 ` Re: getting oid of an INSERT automatically John Brothers <johnbr@undefined.com>
0 siblings, 1 reply; 3+ messages in thread
From: Oliver Elphick @ 2002-08-08 13:28 UTC (permalink / raw)
To: John Brothers <johnbr@undefined.com>; +Cc: pgsql-sql
On Wed, 2002-08-07 at 19:39, John Brothers wrote:
> Hello all,
>
> In pgplsql, is there any way to get the oid that is returned from an INSERT statement, without
> doing a 'follow-up' SELECT for the oid?
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: getting oid of an INSERT automatically
2002-08-07 18:39 getting oid of an INSERT automatically John Brothers <johnbr@undefined.com>
2002-08-08 13:28 ` Re: getting oid of an INSERT automatically Oliver Elphick <olly@lfix.co.uk>
@ 2002-08-08 19:18 ` John Brothers <johnbr@undefined.com>
0 siblings, 0 replies; 3+ messages in thread
From: John Brothers @ 2002-08-08 19:18 UTC (permalink / raw)
To: Oliver Elphick <olly@lfix.co.uk>; +Cc: pgsql-sql
Gee, you'd kinda think I could have read half-a-page down from where I had
been looking. I'm
an idiot.
Thanks,
John
----- Original Message -----
From: "Oliver Elphick" <olly@lfix.co.uk>
To: "John Brothers" <johnbr@undefined.com>
Cc: <pgsql-sql@postgresql.org>
Sent: Thursday, August 08, 2002 9:28 AM
Subject: Re: [SQL] getting oid of an INSERT automatically
> On Wed, 2002-08-07 at 19:39, John Brothers wrote:
> > Hello all,
> >
> > In pgplsql, is there any way to get the oid that is returned from an
INSERT statement, without
> > doing a 'follow-up' SELECT for the oid?
>
> From the Programmers' Guide (PL/pgSQL section):
>
> 23.5.5. Obtaining result status
>
> GET DIAGNOSTICS variable = item [ , ... ] ;
>
> This command allows retrieval of system status indicators. Each item
> is a keyword identifying a state value to be assigned to the
> specified variable (which should be of the right data type to
> receive it). The currently available status items are ROW_COUNT, the
> number of rows processed by the last SQL query sent down to the SQL
> engine; and RESULT_OID, the Oid of the last row inserted by the most
> recent SQL query. Note that RESULT_OID is only useful after an
> INSERT query.
>
> --
> Oliver Elphick Oliver.Elphick@lfix.co.uk
> Isle of Wight, UK
> http://www.lfix.co.uk/oliver
> GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
> ========================================
> "Ye lust, and have not; ye kill, and desire to have,
> and cannot obtain; ye fight and war, yet ye have not,
> because ye ask not." James 4:2
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2002-08-08 19:18 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-08-07 18:39 getting oid of an INSERT automatically John Brothers <johnbr@undefined.com>
2002-08-08 13:28 ` Oliver Elphick <olly@lfix.co.uk>
2002-08-08 19:18 ` John Brothers <johnbr@undefined.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox