Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere C API reference » sacapi.h


sqlany_prepare function

Prepares the supplied SQL string

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

  • sql   The SQL statement to be prepared.


A handle to a SQL Anywhere statement object.


The statement associated with the statement object is executed by sqlany_execute. You can use sqlany_free_stmt to free the resources associated with the statement object.

See also
char * str;
a_sqlany_stmt * stmt;

str = "select * from employees where salary >= ?";
stmt = sqlany_prepare( conn, str );
if( stmt == NULL ) {
    // Failed to prepare statement, call sqlany_error() for more info