pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedEquivalent of Oracle SQL%NOTFOUND in plpgsql
2+ messages / 2 participants
[nested] [flat]
* Equivalent of Oracle SQL%NOTFOUND in plpgsql
@ 2005-09-06 02:14 Bath, David <dave.bath@unix.net>
2005-09-06 02:21 ` Re: Equivalent of Oracle SQL%NOTFOUND in plpgsql Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Bath, David @ 2005-09-06 02:14 UTC (permalink / raw)
To: pgsql-sql
Folks,
Background:
I'm an old Oracle PL/SQL guy.
In PL/SQL I can write some like the following:
fetch cursorblah into blurble;
if cursorname%NOTFOUND .....
or use the more general SQL%NOTFOUND symbol that
is not specific to a cursor. There are similar
"easy" variables to get at the SQLSTATE code
and associated error message.
Question:
How do I read the sqlstate for either/or the
most recent SQL command or a nominated cursor
from within plpgsql? I can find relevant info
for C/spi stuff, but can't see it for plpgsql.
Am I blind, not looking in the right spot,
is it undocumented, or unimplemented?
Thanks in advance
--
David T. Bath
dave.bath@unix.net
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Equivalent of Oracle SQL%NOTFOUND in plpgsql
2005-09-06 02:14 Equivalent of Oracle SQL%NOTFOUND in plpgsql Bath, David <dave.bath@unix.net>
@ 2005-09-06 02:21 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2005-09-06 02:21 UTC (permalink / raw)
To: dave.bath@unix.net; +Cc: pgsql-sql
"Bath, David" <dave.bath@unix.net> writes:
> In PL/SQL I can write some like the following:
> fetch cursorblah into blurble;
> if cursorname%NOTFOUND .....
See the FOUND variable:
http://www.postgresql.org/docs/8.0/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-09-06 02:21 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-06 02:14 Equivalent of Oracle SQL%NOTFOUND in plpgsql Bath, David <dave.bath@unix.net>
2005-09-06 02:21 ` Tom Lane <tgl@sss.pgh.pa.us>
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