Documentation
 
 
 

29.3. libpq EnterpriseDB API

In order to provide support for SPL, the EnterpriseDB libpq interface library has provided the following functions in the libpq Application Programming Interface (API):

29.3.1. Preparing a Callable Statement

PQprepareOut() is used for preparing a callable statement whereas for preparing a prepared statement, the method PQprepare() is used.

extern PGresult *PQprepareOut(PGconn *conn,
                              const char *stmtName,
			      const char *query, 
                              int nParams,
			      const Oid *paramTypes,
			      const  int *paramDirection);	

29.3.2. Executing a Callable Statement

The following method is used for executing a callable statement.

extern int PQsendQueryPreparedOut(PGconn *conn,
				  const char *stmtName,
				  int nParams,
			          const char *const * paramValues,
			          const int *paramLengths,
			          const int *paramFormats,
			          int resultFormat);
 

29.3.3. Fetching Cursors from a Result Set

This method is used for fetching cursors from PGresult(resultset).

 extern int PQCursorResult(PGconn *conn,PGresult *res);
 

29.3.4. Returning the Number of Cursors Fetched from a Result Set

This method is used for returning the number of cursors that were fetched from PGresult(resultset).

 extern int PQnCursor(const PGresult *res);
 

29.3.5. Retrieving the Out Parameter from the Result

PQgetOutResult() is used for retrieving PGresult which contains the values of IN/OUT/INOUT parameters. The values of these IN/OUT/IN OUT parameters can then be retrieved by passing PGresult to PQgetvalue() method.

 extern PGresult *PQgetOutResult(PGconn *conn);
 

29.3.6. Cursor Support Statements in EnterpriseDB

PQgetCursorResult() is used for fetching cursor record(PGresult) residing on a specific index where tupe_num is a row in a recordset and field_num is a column in the recordset table.

extern PGresult *PQgetCursorResult(const PGresult *res, int tup_num, int field_num);

 
 ©2004-2007 EnterpriseDB All Rights Reserved