SELECT DIRECT statement (select_direct_statement:_positioned)
The SELECT DIRECT statement (
select_direct_statement:_positioned ) selects a row in a table. A position in a result table is used for the selection.Syntax
<select_direct_statement:_positioned> ::= SELECT DIRECT <select_column>,...
INTO <parameter_spec>,... FROM <table_name>
WHERE CURRENT OF <result_table_name> [<lock_option>]
Explanation
The table name in this SELECT DIRECT statement must be identical to that in the
FROM clause of the QUERY statement that generated the result table.The result table must have been specified with FOR UPDATE.
If the cursor is positioned on a row of the result table, then column values are selected from the corresponding row and are assigned to parameters. The corresponding row is the row of the table specified in the FROM condition of the query statement, from which the result table row was formed. The
FETCH statement rules apply for assigning the values to the parameters.If the cursor is not positioned on a row in the result table, an error message is issued and no values are assigned to the parameters specified in the parameter specifications.
INTO <parameter_spec>
is not necessary in interactive mode.The lock option determines which lock is set for the read row.
A LONG column can only be specified in a selected column in the uppermost sequence of selected columns in this SELECT DIRECT statement.
See also:
SELECT DIRECT statement (select_direct_statement:_searched)