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

SQL Anywhere 11.0.1 (日本語) » SQL Anywhere サーバ - プログラミング » SQL Anywhere データ・アクセス API » SQL Anywhere C API リファレンス » sacapi.h

 

sqlany_prepare 関数

指定された SQL 文字列を準備します。

構文
a_sqlany_stmt * sqlany_prepare( a_sqlany_connection * conn, const char * sql )
パラメータ
  • conn   sqlany_connect を使用して確立された接続の接続オブジェクト。

  • sql   準備される SQL 文。

戻り値

SQL Anywhere 文オブジェクトのハンドル。

備考

文オブジェクトに関連付けられた文は sqlany_execute によって実行されます。sqlany_free_stmt を使用して、文オブジェクトに関連付けられたリソースを解放できます。

参照
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
}