Prepares a supplied SQL string.
public a_sqlany_stmt * sqlany_prepare( a_sqlany_connection * sqlany_conn, const char * sql_str )
sqlany_conn A connection object with a connection established using sqlany_connect().
sql_str The SQL statement to be prepared.
A handle to a SQL Anywhere statement object. The statement object can be used by sqlany_execute() to execute the statement.
Execution does not happen until sqlany_execute() is called. The returned statement object should be freed using sqlany_free_stmt().
The following statement demonstrates how to prepare a SELECT SQL string:
char * str; a_sqlany_stmt * stmt; str = "select * from employees where salary >= ?"; stmt = sqlany_prepare( sqlany_conn, str ); if( stmt == NULL ) { // Failed to prepare statement, call sqlany_error() for more info }