Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id 73C0C475894 for ; Wed, 10 Jul 2002 06:47:32 -0400 (EDT) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Wed Jul 10 12:47:31 2002 +0200 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id MAA04317; Wed, 10 Jul 2002 12:47:31 +0200 (METDST) From: Christoph Haller Message-Id: <200207101047.MAA06942@rodos> Subject: Re: Problem on PostgreSQL (error code, store procedures) To: carmen_wai@yahoo.com (Carmen Wai) Date: Wed, 10 Jul 2002 12:47:30 METDST Cc: pgsql-sql@postgresql.org In-Reply-To: <20020706064512.37016.qmail@web13401.mail.yahoo.com>; from "Carmen Wai" at Jul 8, 102 4:56 pm X-Mailer: Elm [revision: 212.4] X-Archive-Number: 200207/131 X-Sequence-Number: 8510 > > 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