If you attempt to include both the FOR READ ONLY clause and the FOR UPDATE clause in the same SELECT statement, the SELECT statement fails. For information on declaring a read-only cursor for a SELECT statement that does not include a FOR READ ONLY clause, see DECLARE .
Use the INTO Table clauses to specify a temporary or external table to receive the data that the SELECT statement retrieves.
INTO Table Clauses: |--INTO---------------------------------------------------------> >--+-TEMP--table--+-------------+------------------------------------------------------------+--| | '-WITH NO LOG-' | | (1) | +--------+-RAW---------+--table--+------------------------------------------------------+-+ | +-STATIC------+ | (2) (3) | | | +-STANDARD----+ '-| Storage Options |-------| Lock Mode Options |------' | | '-OPERATIONAL-' | | (1) | '------+-SCRATCH--table----------------------------+--------------------------------------' '-EXTERNAL--table--USING--| USING Options |-' USING Options: |--(--+---------------------------+-----------------------------> | (4) | '-| Table Options |-------,-' (5) >--| DATAFILES Clause |-------+------------------------+--)-----| | (4) | '-| Table Options |------'
Element | Description | Restrictions | Syntax |
---|---|---|---|
table | Table to receive the results of the query | Must be unique among names of tables, views, and synonyms that you own in the current database | Database Object Name |
You must have the Connect privilege on a database to create a temporary or external table in that database. The name of a temporary table need not be unique among the names of temporary tables of other users.
Column names in the temporary or external table must be specified in the Projection clause, where you must supply a display label for all expressions that are not simple column expressions. The display label becomes the column name in the temporary or external table. If you do not declare a display label for a column expression, the table uses the column name from the select list of the Projection clause.
The following INTO TEMP example creates the pushdate table with two columns, customer_num and slowdate:
SELECT customer_num, call_dtime + 5 UNITS DAY slowdate FROM cust_calls INTO TEMP pushdateEnterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]