Inserting selected rows from the database
194
LOCATION ’detroit.asiq11db’
{ SELECT l_shipdate, l_orderkey
FROM lineitem }
•
The destination and source columns may have different names.
•
The order in which you specify the columns is important, because data
from the first source column named is inserted into the first target column
named, and so on.
•
You can use the predicates of the
SELECT
statement within the
INSERT
command to insert data from only certain rows in the table.
Example
This example inserts the same columns as the previous example, but only for
the rows where the value of
l_orderkey
is 1.
INSERT INTO lineitem
(l_shipdate, l_orderkey)
LOCATION ’detroit.asiqdb’
{ SELECT l_shipdate, l_orderkey
FROM lineitem
WHERE l_orderkey = 1 }
Note
If you use
START ROW ID
and you select fewer columns than exist in
the destination table, the columns in remaining rows of the destination table
will be NULLs, if NULLs are legal values. See “Partial-width insertions” for
more information.
Importing data from
pre-Version 12
Adaptive Server IQ
To import data from an Adaptive Server IQ database version earlier than 12.0,
you must use of the following methods:
•
The
LOAD TABLE
command with the
UNLOAD FORMAT
option.
•
The
INSERT...LOCATION
syntax
You cannot use other forms of the
INSERT
command.
For more information on loading from an older version, see the Adaptive
Server IQ Installation and Configuration Guide.
Summary of Contents for Adaptive Server IQ 12.4.2
Page 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Page 16: ...xvi ...
Page 20: ...Related documents xx ...
Page 40: ...Compatibility with earlier versions 20 ...
Page 118: ...Troubleshooting startup shutdown and connections 98 ...
Page 248: ...Importing data by replication 228 ...
Page 306: ...Integrity rules in the system tables 286 ...
Page 334: ...Cursors in transactions 314 ...
Page 396: ...Users and permissions in the system tables 376 ...
Page 438: ...Determining your data backup and recovery strategy 418 ...
Page 484: ...Network performance 464 ...
Page 500: ...System utilities to monitor CPU use 480 ...
Page 514: ...Characteristics of Open Client and jConnect connections 494 ...
Page 536: ...Index 516 ...