sqlany_execute_direct function

Executes the SQL statement specified by the string argument.

Syntax
a_sqlany_stmt * sqlany_execute_direct( a_sqlany_connection * conn, const char * sql )
Parameters
  • conn   A connection object with a connection established using sqlany_connect.

  • sql   A SQL string. The SQL string should not have parameters such as ?.

Remarks

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.

Returns

A statement handle when the function executes successfully, NULL when the function executes unsuccessfully.

See also
Example
 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  );
   }