From: Christoph Haller <ch@rodos.fzk.de>
To: carmen_wai@yahoo.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Problem on PostgreSQL (error code, store procedures)
Date: Wed, 10 Jul 2002 12:47:30 METDST
Message-ID: <200207101047.MAA06942@rodos> (raw)
In-Reply-To: <20020706064512.37016.qmail@web13401.mail.yahoo.com>
>
> I would like to know if there are any global variables
> storing the error code or the number of rows affected
> after each execution of the SQL statement.
You did not mention which interface you are using.
In C there are functions available like
extern const char *PQcmdTuples(PGresult *res);
to learn about the rows affected or
extern int PQntuples(PGresult *res);
to learn about the number of rows found (SELECT) or
extern ExecStatusType PQresultStatus(PGresult *res);
to learn about the status of the SQL command.
Unfortunately, there are no error codes at all.
In PL/pgSQL (which I do not use) I've found
GET DIAGNOSTICS variable = ROW_COUNT ;
refer to plpgsql-statements.html
>
> Also, for Postgresql function, I have checked that I
> can only call the function by: select function(parms)
> or by EXECUTE PROCEDURE function(parms) in the trigger
> action. I wonder whether there is any other method for
> calling the function which is similar to the stored
> procedures in the MS SQL server?
I'm afraid NO.
Regards, Christoph
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: ch@rodos.fzk.de, carmen_wai@yahoo.com
Subject: Re: Problem on PostgreSQL (error code, store procedures)
In-Reply-To: <200207101047.MAA06942@rodos>
* 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