sqlany_execute_direct

Executes the SQL statement specified by the string argument.

Syntax
sqlany_execute_direct ( $conn, $sql )
Parameters
  • $conn   A connection object with a connection established using sqlany_connect.

  • $sql   A SQL string. The SQL string should not have parameters such as ?.

Returns

Returns a statement object or nil on failure.

Remarks

Use this function if you want to prepare and execute a statement in one step. Do not use this function to execute a SQL statement with parameters.

See also
Example
stmt = api.sqlany_execute_direct( conn, "SELECT * FROM Employees" )
rc = api.sqlany_fetch_next( stmt )
rc, employeeID = api.sqlany_get_column( stmt, 0 )
rc, managerID  = api.sqlany_get_column( stmt, 1 )
rc, surname = api.sqlany_get_column( stmt, 2 )
rc, givenName = api.sqlany_get_column( stmt, 3 )
rc, departmentID = api.sqlany_get_column( stmt, 4 )
print employeeID, ",", managerID, ",",
     surname, ",", givenName, ",", departmentID, "\n"