PSSRXSQL external function
PSSRXSQL external function
SQL statement | Example | Description |
---|---|---|
OPEN CURSOR | <rc> = pssrxsql("OPEN <cursorName> CURSOR FOR" <sqlStatement>) | Prepare the SQL SELECT statement and open the specified cursor. |
FETCH CURSOR | <rc> = pssrxsql("FETCH <cursorName>") <rc> = pssrxsql("FETCH <cursorName> INTO <v1, v2, . . . vn>") | Fetch the first or next row. Return SQLCODE = 100 when all rows have been fetched. The first form of the function puts the data into variables whose names are cursorName.columnName. It also puts values into variables like cursorName.n, where n is the column number of the query. The second form puts values into the specified variables. The maximum length of a variable name is 250 characters. Variable names can contain @, #, $, ¢, ., !, ?,or _. |
CLOSE CURSOR | <rc> = pssrxsql("CLOSE <cursorName>") | Close the specified cursor. |
EXECUTE | <rc> = pssrxsql(<sqlStatement>) | Prepare and run the SQL statement. If the statement is SELECT, return no more than one row. The function sets variables as it does for FETCH. If the SELECT statement has no INTO clause, the stem name is always SELECT. |
COMMIT | <rc> = pssrxsql("COMMIT") | Commit uncommitted work, and close all open cursors. |
ROLLBACK | <rc> = pssrxsql("ROLLBACK") | Back out relational database changes made since the last commit. |