Executes the SQL statement specified by the string argument.
a_sqlany_stmt * sqlany_execute_direct( a_sqlany_connection * conn, const char * sql )conn A connection object with a connection established using sqlany_connect.
sql A SQL string. The SQL string should not have parameters such as ?.
Use this function if you want to prepare and execute a statement, or instead of sqlany_prepare followed by sqlany_execute. Do not use this function to execute a SQL statement with parameters.
A statement handle when the function executes successfully, NULL when the function executes unsuccessfully.
stmt = sqlany_execute_direct( conn, "select * from employees" ) ) {
if( stmt ) {
while( sqlany_fetch_next( stmt ) ) {
int i;
for( i = 0; i < sqlany_num_cols( stmt ); i++ ) {
// Get i'th column data
}
}
sqlany_free_stmt( stmt );
}
|
| Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |