hanaclient_execute_direct Function
Executes the SQL statement specified by the string argument.
Parameters
- $conn
-
A connection object with a connection established by using hanaclient_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 to prepare and execute a statement in one step. Do not use this function to execute a SQL statement with parameters.
Example
stmt = api.hanaclient_execute_direct( conn, "SELECT * FROM "Products"" )
rc = api.hanaclient_fetch_next( stmt )
rc, employeeID = api.hanaclient_get_column( stmt, 0 )
rc, managerID = api.hanaclient_get_column( stmt, 1 )
rc, surname = api.hanaclient_get_column( stmt, 2 )
rc, givenName = api.hanaclient_get_column( stmt, 3 )
rc, departmentID = api.hanaclient_get_column( stmt, 4 )
print employeeID, ",", managerID, ",",
surname, ",", givenName, ",", departmentID, "\n"