More Useful Options

Top  Previous  Next

The following list includes some more options that you can use in control files to augment and prefect your data import or export.  The full list of keywords and switches is at the end of this document.

Keyword

Argument[s]

Purpose

discards=NAME

NAME is the relative or fully-specified path to a file

Discards from input processing can be sent to a file.  On POSIX, the default is /dev/null.

errors=N

Stop loading after N errors

Causes the import or export operation to stop after N errors have occurred.  Default is 1 (stop on the first error).


Note also that the keyword short_ok makes a "short" input record into a warning condition rather than throwing an error.

excel

 

No arguments

Informs dbFile that the file is in Excel format.  For input files dbFile will ignore the first line.  For output files, it will generate column names as the first line of the file.

file=NAME

NAME is the relative or fully-specified path to  the input or output file

The named output file is created by dbFile.  If a file of that name exists already, dbFile will overwrite it.

fractComma

No arguments

Fractional numbers use a comma as the decimal point. The default decimal separator is a period.

hyphenateDate

No arguments

Output dates will use hyphens as separators, instead of the default slashes.

lineend=x

x = M, P or U

Indicates the line-break type (M for Mac, P for Windows/DOS, U for Unix).  The default is the standard line-break type applicable to the operating system.

logfile=NAME

NAME is a relative or fully-specified path to a file

File for logging both stdout and stderr.  On Windows, if logging is wanted, this is the only way to get it.

lrecl=N

N is the length of a fixed-length input record, where there are no line breaks separating records

Used only for fixed size records only and only those with with no line endings (like some IBM output formats).  There is a caveat:  there can be no short records, except the last, and applying the wrong value to N will create data in your database that is wrecked beyond repair.

pad=C

C is a single character to be used as padding

For fixed output, use the character specified by C to fill in any parts of the output record not described by either SQL output or filler fields. Escaping is valid and may be required if your pad character is one that has semantic significance in your command shell.

quote=X    

X must be either a single or double quote character

For use only if the delimiter option is used.  Specifies the style of quote used for quoting strings.  Strings only need to be quoted if the delimiter character potentially may occur in the string.  If the quote option is specified, all output strings will be quoted ALWAYS.


Numbers do not need to be quoted and will never appear in output with quotes.

rows=N

N is a number

Stop the import or export after after N rows have been processed.  Default: no limit on the number of rows to process.

short_ok

No arguments

The default is to treat short input records as errors and not to load them (skip them and optionally log them).  The effect of short_ok is to specify that short records are to be loaded, with missing fields treated as null.

skip=N

N is a number

Skips N records in the input file or the SQL query output before commencing the import or export process.

startcount=N

N is a number

Uses N as the base for generating the filler count that is specified by defining the filler field ENUM.  The output value  is generated as (record count so far + startcount).  The default value for N is 0.

trans=N

N is a number

Commit the transaction after every N rows of input.  Default: 5000.

verbose

No arguments

Execute the process in verbose mode.  The default is to report only errors.


See full List of Options and Switches