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 for Ruby » SQL Anywhere Ruby API

 

sqlany_bind_param

将用户提供的缓冲区作为参数绑定到预准备语句。

语法
sqlany_bind_param ( $stmt, $index, $param )
参数
  • $stmt   成功执行 sqlany_prepare 所返回的语句对象。

  • $index   参数的索引。该数字必须在 0 到 sqlany_num_params() - 1 之间。

  • $param   检索自 sqlany_describe_bind_param 的填充的绑定对象。

返回值

返回标量值,成功时为 1,不成功时为 0。

另请参见
示例
stmt = api.sqlany_prepare(conn, "UPDATE Contacts
     SET Contacts.ID = Contacts.ID + 1000
     WHERE Contacts.ID >= ?" )
rc, param = api.sqlany_describe_bind_param( stmt, 0 )
print "Param name = ", param.get_name(), "\n"
print "Param dir = ", param.get_direction(), "\n"
param.set_value(50)
rc = api.sqlany_bind_param( stmt, 0, param )