From: Bath, David <dave.bath@unix.net>
To: pgsql-sql@postgresql.org
Subject: Equivalent of Oracle SQL%NOTFOUND in plpgsql
Date: Tue, 6 Sep 2005 12:14:06 +1000
Message-ID: <200509061214.06644.dave.bath@unix.net> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dave.bath@unix.net
Subject: Re: Equivalent of Oracle SQL%NOTFOUND in plpgsql
In-Reply-To: <200509061214.06644.dave.bath@unix.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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