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.
Use the INTO clause to save the returned values of these SQL statements:
The INTO clause of the EXECUTE statement has the following syntax:
INTO Clause: .-,--------------------------------------------. V | |--INTO--+---output_var--+------------------------------+-+-+---| | | (1) | | | '-+--------:--+--indicator_var-' | | '-INDICATOR-' | +-SQL DESCRIPTOR--+-descriptor_var-+---------------+ | '-'descriptor'---' | '-DESCRIPTOR--sqlda_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 |
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 have 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.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]