Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > SELECT >

Syntax That Is Incompatible with the FOR READ ONLY Clause

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 .

INTO Table Clauses

Use the INTO Table clauses to specify a temporary or external table to receive the data that the SELECT statement retrieves.

Read syntax diagramSkip visual syntax diagramINTO 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 |------'
 

Notes:
  1. Extended Parallel Server only
  2. See Storage Options
  3. See LOCK MODE Options
  4. See Table Options
  5. See DATAFILES Clause

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 pushdate
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]