34.11. Library Functions
Thelibecpg
library primarily contains“hidden” functions that are used to implement the functionality expressed by the embedded SQL commands. But there are some functions that can usefully be called directly. Note that this makes your code unportable.
ECPGdebug(int
turns on debug logging if called with the first argument non-zero. Debug logging is done onon
, FILE *stream
)stream
. The log contains allSQL statements with all the input variables inserted, and the results from thePostgres Pro server. This can be very useful when searching for errors in yourSQL statements.ECPGtransactionStatus(const char *
returns the current transaction status of the given connection identified byconnection_name
)connection_name
. SeeSection 32.2 and libpq'sPQtransactionStatus
for details about the returned status codes.ECPGstatus(int
returns true if you are connected to a database and false if not.lineno
, const char*connection_name
)connection_name
can beNULL
if a single connection is being used.