July 2005
Intermediate to advanced
1032 pages
27h 10m
English
Query processing is simple in libpgeasy. To execute a SQL command, you call the doquery() function. The function prototype for doquery() is
PGresult * doquery( char * query );
Notice that doquery() does not expect a PGconn *—libpgeasy can deal with only a single database connection and it implicitly uses the one returned by connectdb(). doquery() returns a PGresult *. This is the same data structure you saw in the previous chapter—it represents the result set of the query.
After you have executed a command, you will need to process the result set. libpgeasy provides a number of functions for dealing with a result set—of course, you can use any of the libpq functions as well.
If you are reasonably sure that your query ...
Read now
Unlock full access