check the execution status of stored procedure

From: Yan Cheng Cheok <yccheok(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: check the execution status of stored procedure
Date: 2010-01-08 06:20:49
Message-ID: 773983.94511.qm@web65703.mail.ac4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Currently, I try to call a stored procedure with void returned type.

PGresult *res = PQexec(this->getConnection(), "SELECT * FROM create_tables()");
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
PQclear(res);
return false;
}

Since the returned type of stored procedure is void, I will always fall in to the block

if (PQresultStatus(res) != PGRES_COMMAND_OK) {}

Is there any better way, I can check whether the stored procedure had been executed without problem?

Thanks and Regards
Yan Cheng CHEOK

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yan Cheng Cheok 2010-01-08 07:50:50 Return Single Row Result After Inserting (Stored Procedure)
Previous Message Scott Marlowe 2010-01-08 05:29:59 Re: Index question on postgres