INPUT statement [Interactive SQL]
552
Certain file formats contain information about column names and types.
Using this information, the INPUT statement will create the database table if
it does not already exist. This is a very easy way to load data into the
database. The formats that have enough information to create the table are:
DBASEII, DBASEIII, FOXPRO, and LOTUS.
Input from a command file is terminated by a line containing END. Input
from a file is terminated at the end of the file.
Allowable input formats are:
♦
ASCII Input lines are assumed to be ASCII characters, one row per
line, with values separated by commas. Alphabetic strings may be
enclosed in apostrophes (single quotes) or quotation marks (double
quotes). Strings containing commas must be enclosed in either single or
double quotes. If the string itself contains single or double quotes,
double the quote character to use it within the string. Optionally, you can
use the DELIMITED BY clause to specify a different delimiter string
than the default, which is a comma.
Three other special sequences are also recognized. The two characters \n
represent a newline character, \\ represents a single (\), and the sequence
\xDD represents the character with hexadecimal code DD.
♦
DBASE The file is in dBASE II or dBASE III format. Interactive SQL
will attempt to determine which format, based on information in the file.
If the table doesn’t exist, it will be created.
♦
DBASEII The file is in dBASE II format. If the table doesn’t exist, it
will be created.
♦
DBASEIII The file is in dBASE III format. If the table doesn’t exist, it
will be created.
♦
EXCEL Input file is in the format of Microsoft Excel 2.1. If the table
doesn’t exist, it will be created.
♦
FIXED Input lines are in fixed format. The width of the columns can be
specified using the COLUMN WIDTHS clause. If they are not specified,
column widths in the file must be the same as the maximum number of
characters required by any value of the corresponding database column’s
type.
The FIXED format cannot be used with binary columns that contain
embedded newline and End of File character sequences.
♦
FOXPRO The file is in FoxPro format (the FoxPro memo field is
different than the dBASE memo field). If the table doesn’t exist, it will
be created.