cp_dbms

Section: cp_dbms (3)
Updated: MARCH 2006
Index Return to Main Contents
 

NAME

cp_db_connection_select - perform a SELECT query on a database connection

 

SYNOPSIS

#include <cprops/db.h>

cp_result_set *
      cp_db_connection_select(cp_db_connection *connection, char *query);  

DESCRIPTION

cp_db_connection_select performs the query query on the connection described by connection and returns a cp_result_set with the results. Result rows are retrieved with cp_result_set_next(3) and should be released by calling cp_result_set_release_row(3). The rows may contain results in text or in binary format, depending on the underlying implementation's behavior. Call cp_result_set_is_binary(3) to check what format the results are in. In text format, column values are represented by cp_string(3) objects. In binary format, results are represented as follows:

        CP_FIELD_TYPE_BOOLEAN     --   short
        CP_FIELD_TYPE_CHAR        --   cp_string
        CP_FIELD_TYPE_SHORT       --   short
        CP_FIELD_TYPE_INT         --   int
        CP_FIELD_TYPE_LONG        --   long
        CP_FIELD_TYPE_LONG_LONG   --   long long
        CP_FIELD_TYPE_FLOAT       --   float
        CP_FIELD_TYPE_DOUBLE      --   double
        CP_FIELD_TYPE_VARCHAR     --   cp_string
        CP_FIELD_TYPE_BLOB        --   cp_string
        CP_FIELD_TYPE_DATE        --   cp_timestampz
        CP_FIELD_TYPE_TIME        --   cp_timestampz
        CP_FIELD_TYPE_TIMESTAMP   --   cp_timestampz

Results should be released with cp_result_set_destroy(3).

for more on result set usage, see cp_result_set(3).  

RETURN VALUE

cp_db_connection_select returns a result set representing the query results on success or NULL on failure.  

SEE ALSO

cp_result_set(3), cp_timestampz(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 22:48:28 GMT, April 10, 2006
SourceForge.net Logo