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 Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere for Ruby » SQL Anywhere Ruby API

 

sqlany_bind_param

Binds a user-supplied buffer as a parameter to the prepared statement.

Syntax
sqlany_bind_param ( $stmt, $index, $param )
Parameters
  • $stmt   A statement object returned by the successful execution of sqlany_prepare.

  • $index   The index of the parameter. The number must be between 0 and sqlany_num_params() - 1.

  • $param   A filled bind object retrieved from sqlany_describe_bind_param.

Returns

Returns a scalar value that is 1 when successful or 0 when unsuccessful.

See also
Example
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 )