INPUT statement [Interactive SQL]
550
INPUT statement [Interactive SQL]
Use this statement to import data into a database table from an external file
or from the keyboard.
INPUT INTO [
owner
.]
table-name
… [ FROM
filename
| PROMPT ]
… [ FORMAT
input-format
]
… [ ESCAPE CHARACTER
character
]
… [ BY ORDER | BY NAME ]
… [ DELIMITED BY
string
]
… [ COLUMN WIDTHS (
integer
, …) ]
… [ NOSTRIP ]
… [ (
column-name
, … ) ]
input-format
:
ASCII | DBASE | DBASEII | DBASEIII
| EXCEL | FIXED | FOXPRO | LOTUS
Must have INSERT permission on the table or view.
None.
"OUTPUT statement" on page 573
"INSERT statement" on page 554
"UPDATE statement" on page 637
"DELETE statement" on page 496
"SET OPTION statement" on page 612
"LOAD TABLE statement" on page 560
The INPUT statement allows efficient mass insertion into a database table.
Lines of input are read either from the user via an input window (if
PROMPT is specified) or from a file (if FROM filename is specified). If
neither is specified, the input will be read from the command file that
contains the input statement—this can even be directly from the
Interactive SQL editor. In this case, input is ended with a line containing
only the string END.
These lines are inserted into the named table. If a column list is specified, the
data is inserted into the specified columns of the named table.
Normally, the INPUT statement stops when it attempts to insert a row that
causes an error. Errors can be treated in different ways by setting the
ON_ERROR and CONVERSION_ERROR options (see SET OPTION).
Interactive SQL will print a warning in the statistics window if any string
values are truncated on INPUT. Missing values for NOT NULL columns are
set to zero for numeric types and to the empty string for non-numeric types. f
INPUT attempts to insert a NULL row if the input file contains an empty
row.
Function
Syntax
Permissions
Side effects
See also
Description