Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
执行由字符串参数指定的 SQL 语句。
sqlany_execute_direct ( $conn, $sql )
$conn 已使用 sqlany_connect 建立连接的连接对象。
$sql SQL 字符串。SQL 字符串不应包含诸如 ? 之类的参数。
返回语句对象或 nil(失败时)。
使用此函数只需一步便可准备和执行语句。不要使用此函数执行带参数的 SQL 语句。
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"