Scope of Statement Identifiers
A program can consist of one or more source-code files. By default, the scope of reference of a statement identifier is global to the program. A statement identifier created in one file can be referenced from another file.
In a multiple-file program, if you want to limit the scope of reference of a statement identifier to the file in which it is executed, you can preprocess all the files with the -local command-line option.
INTO Clause
- A prepared singleton SELECT statement that returns only one row of column values for the columns in the select list
- A prepared EXECUTE FUNCTION (or EXECUTE PROCEDURE) statement for an SPL function that returns only one set of values
INTO Clause
INTO { output_var [ { []: | INDICATOR } indicator_var ] | SQL DESCRIPTOR { descriptor_var | 'descriptor' } | DESCRIPTORsqlda_pointer }
Element | Description | Restrictions | Syntax |
---|---|---|---|
descriptor | Quoted string that identifies a system-descriptor area | Must already be allocated. Use single ( ' ) quotation marks | Quoted String |
descriptor_var | Host variable that identifies a system-descriptor area | System-descriptor area must already be allocated | Language specific |
indicator_var | Host variable that receives a return code if corresponding parameter_var is NULL value, or if truncation occurs | Cannot be DATETIME or INTERVAL data type | Language specific |
output_var | Host variable whose contents replace a question-mark ( ? ) placeholder in a prepared statement | Must be a character data type | Language specific |
sqlda_pointer | Pointer to an sqlda structure that defines data type and memory location of values to replace a question-mark ( ? ) placeholder in a prepared object | Cannot begin with a dollar sign ( $ ) or a colon ( : ) symbol. An sqlda structure is required with dynamic SQL | DESCRIBE INPUT statement |
This closely resembles the syntax of the USING Clause.
The INTO clause provides a concise and efficient alternative to more complicated and lengthy syntax. In addition, by placing values into variables that can be displayed, the INTO clause simplifies and enhances your ability to retrieve and display data values. For example, if you use the INTO clause, you do not need to use a cursor to retrieve values from a table.
You can store the returned values in output variables, in output SQL descriptors, or in output sqlda pointers.