Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
准备所提供的 SQL 字符串。
public a_sqlany_stmt * sqlany_prepare( a_sqlany_connection * sqlany_conn, const char * sql_str )
sqlany_conn 已使用 sqlany_connect() 建立连接的连接对象。
sql_str 要准备的 SQL 语句。
SQL Anywhere 语句对象的句柄。sqlany_execute() 可以使用此语句对象来执行语句。
调用 qlany_execute() 后执行才会发生。应使用 sqlany_free_stmt() 释放返回的语句对象。
以下语句显示如何准备 SELECT SQL 字符串:
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 }