SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)
Reorganizing SQL/MX Tables and Maintaining Data
HP NonStop SQL/MX Installation and Management Guide—523723-004
10-31
Using import to Append Data to Tables or Partitions
3,tandem,408-285-5000,408-285-2227
4,diyatech,510-111-2222,510-222-3333
Suppose that you want to import data into the COMPANY table from the fixed-width
and delimited COINPUT input file by using a format file. The format file created is
called FORMFILE, which consists of [DATE FORMAT], [COLUMN FORMAT],
[DELIMITED FORMAT] and [FIXED WIDTH FORMAT] sections:
[DATE FORMAT]
DateOrder=MDY
DateDelimiter=/
TimeDelimiter=:
FourDigitYear=Y
DecimalSymbol=.
[COLUMN FORMAT]
col=id,N
col=company,N
col=phone,N
col=fax,N
[DELIMITED FORMAT]
FieldDelimiter=,
RowDelimiter=\n
Qualifier="
[FIXED WIDTH FORMAT]
col=id,1,11
col=company,12,175
col=phone,187,12
col=fax,199,12
RecordLength=66
Perform the import command to load the COINPUT input file into COMPANY. This
import command imports data into the COMPANY table from the delimited input file
named COINPUT using the format file FORMFILE:
import cat.sch.company -I COINPUT -U FORMFILE -W FIXED
The format file (FORMFILE) can also be used as a delimited input data file. The [FIXED
WIDTH FORMAT] section is required only for fixed width input data files, and is
therefore included in this example.
Using import to Append Data to Tables or Partitions
Use the import command to append data to the end of a table or partition of an
SQL/MX table.
The import command preserves the existing data in the target table.
When you use the import command in an DSS environment, you can keep a data
warehouse up to date by performing periodic (for example, daily, weekly, or monthly)
updates to the database.