cp_dbms

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

NAME

cp_db_connection_escape_string, cp_db_connection_escape_binary, cp_db_connection_unescape_binary - string conversions for SQL queries

 

SYNOPSIS

#include <cprops/db.h>

char *cp_db_connection_escape_string(cp_db_connection *connection,
                                      char *src,
                                      int len);
char *cp_db_connection_escape_binary(cp_db_connection *connection,
                                      char *src,
                                      int src_len,
                                      int *res_len);
cp_string *
      cp_db_connection_unescape_binary(cp_db_connection *connection,
                                       char *src);  

DESCRIPTION

cp_db_connection_escape_string prepares a string for inclusion in an SQL query. This may entail escaping quote marks etc.
cp_db_connection_escape_binary prepares a binary string for inclusion in an SQL query, for instance when performing an insert into a binary large object type column.
cp_db_connection_unescape_binary converts a text string representing binary data returned by a query to actual binary data.

Driver implementations are not strictly required to implement these functions, but may be expected to implement at least cp_db_connection_escape_binary.  

RETURN VALUE

On success, cp_db_connection_escape_string and cp_db_connection_escape_binary return a null terminated string representing the escaped data. cp_db_connection_unescape_binary returns a cp_string(3) representing the binary data.

NULL is returned if the driver for the database in use does not implement these methods.


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE

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