Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

Query
[LibTDS API]

Function to handle query. More...

Functions

int tds_submit_query (TDSSOCKET *tds, const char *query, TDSPARAMINFO *params)
 tds_submit_query() sends a language string to the database server for processing.

const char * tds_next_placeholders (const char *start)
 Get position of next placeholders.

int tds_count_placeholders (const char *query)
 Count the number of placeholders in query.

int tds_submit_prepare (TDSSOCKET *tds, const char *query, const char *id, TDSDYNAMIC **dyn_out)
 tds_submit_prepare() creates a temporary stored procedure in the server.

int tds_submit_execute (TDSSOCKET *tds, TDSDYNAMIC *dyn)
 tds_submit_execute() sends a previously prepared dynamic statement to the server.

int tds_get_dynid (TDSSOCKET *tds, char **id)
 Get an id for dynamic query based on TDS information.

int tds_submit_unprepare (TDSSOCKET *tds, TDSDYNAMIC *dyn)
 Send a unprepare request for a prepared query.

int tds_submit_rpc (TDSSOCKET *tds, const char *rpc_name, TDSPARAMINFO *params)
 tds_submit_rpc() call a RPC from server.

int tds_send_cancel (TDSSOCKET *tds)
 tds_send_cancel() sends an empty packet (8 byte header only) tds_process_cancel should be called directly after this.

int tds_quote_id (TDSSOCKET *tds, char *buffer, const char *id)
 Quote an id.

int tds_quote_string (TDSSOCKET *tds, char *buffer, const char *str, int len)
 Quote a string.


Detailed Description

Function to handle query.


Function Documentation

int tds_get_dynid TDSSOCKET *    tds,
char **    id
 

Get an id for dynamic query based on TDS information.

Returns:
TDS_FAIL or TDS_SUCCEED

const char* tds_next_placeholders const char *    start
 

Get position of next placeholders.

Parameters:
start  pointer to part of query to search
Returns:
next placaholders or NULL if not found

int tds_quote_id TDSSOCKET *    tds,
char *    buffer,
const char *    id
 

Quote an id.

Parameters:
buffer  buffer to store quoted id. If NULL do not write anything (useful to compute quote length)
id  id to quote
Returns:
written chars (not including needed terminator)

int tds_quote_string TDSSOCKET *    tds,
char *    buffer,
const char *    str,
int    len
 

Quote a string.

Parameters:
buffer  buffer to store quoted id. If NULL do not write anything (useful to compute quote length)
str  string to quote (not necessary null-terminated)
len  length of string (-1 for null terminated)
Returns:
written chars (not including needed terminator)

int tds_submit_execute TDSSOCKET *    tds,
TDSDYNAMIC *    dyn
 

tds_submit_execute() sends a previously prepared dynamic statement to the server.

Currently works with TDS 5.0 or TDS7+

Parameters:
dyn  dynamic proc to execute. Must build from same tds.

int tds_submit_prepare TDSSOCKET *    tds,
const char *    query,
const char *    id,
TDSDYNAMIC **    dyn_out
 

tds_submit_prepare() creates a temporary stored procedure in the server.

Currently works with TDS 5.0 and TDS7+

Parameters:
query  language query with given placeholders (?)
id  string to identify the dynamic query. Pass NULL for automatic generation.
dyn_out  will receive allocated TDSDYNAMIC*. Any older allocated dynamic won't be freed, Can be NULL.
Returns:
TDS_FAIL or TDS_SUCCEED

int tds_submit_query TDSSOCKET *    tds,
const char *    query,
TDSPARAMINFO *    params
 

tds_submit_query() sends a language string to the database server for processing.

TDS 4.2 is a plain text message with a packet type of 0x01, TDS 7.0 is a unicode string with packet type 0x01, and TDS 5.0 uses a TDS_LANGUAGE_TOKEN to encapsulate the query and a packet type of 0x0f.

Parameters:
query  language query to submit
Returns:
TDS_FAIL or TDS_SUCCEED

int tds_submit_rpc TDSSOCKET *    tds,
const char *    rpc_name,
TDSPARAMINFO *    params
 

tds_submit_rpc() call a RPC from server.

Output parameters will be stored in tds->param_info

Parameters:
rpc_name  name of RPC
params  parameters informations. NULL for no parameters

int tds_submit_unprepare TDSSOCKET *    tds,
TDSDYNAMIC *    dyn
 

Send a unprepare request for a prepared query.

Parameters:
tds  db connection
dyn  dynamic query
Returns:
TDS_SUCCEED or TDS_FAIL


Generated on Sat Apr 5 23:17:42 2003 for FreeTDS API by doxygen1.2.18