Incode Systems Home Page Incode Systems, Inc.


SQLDATA



(Windows command line program: Win95 or higher)

Usage: IN TableName [InFileName[.txt]] [LogFileName[.log]]
Inserts rows from InFileName (a tab-delimited text file) INTO TableName.
If -u switch is used, columns are backslash unescaped.
Character columns which are an empty string are imported as NULL.
Character columns which are 1 or more spaces imported as an empty string;
however, if -t- option is used, they are imported as is.

Usage: OUT [TableName | *] [OutFileName[.txt]] [LogFileName[.log]]
Writes rows from TableName to OutFileName as tab delimited text.
VarChar, and LongVarChar columns are escaped for ASCII 8-13 (and with:
Character columns which are an empty string are output as a single space.
NULL Character columns are output as an empty string (or whatever is specified
with the -nt option).

Usage: UP TableName [InFileName[.txt]] [LogFileName[.log]]
Updates rows in TableName from InFileName (a tab-delimited text file).
InFileName must contain the primary key column(s).
If -u switch is used, columns are backslash unescaped.
Character columns containing an empty string are imported as NULL.
Character columns which are 1 or more spaces imported as an empty string.

Usage: INUP TableName [InFileName[.txt]] [LogFileName[.log]]
INUP inserts the row and performs the update if the insert fails.

Usage: SCRIPT ScriptName [InFileName[.txt]] [LogFileName[.log]]
Executes the SQL script in the ScriptName file for each row of InFileName.
A literal SQL statement may be specified by prefixing with "SQL:". Example:
"SQL:SELECT * FROM Table"

If SQL contains named parameters (ex: :Parm1), they are matched using
the header row of InFileName. If a parameter has a type prefix the prefix
is removed and matched case insensitive. The prefixes are:
bo, dt, ts, fl, in, si, st, tm, wd

If standard parameter markers (?) are used, InFileName columns
must be in same sequence as the SQL parameters.
Missing parameters, or empty strings are assigned as NULL.
If the script produces a result set, use the -o option to specify
the output file name.

If InFileName or OutFileName is not given, standard input or output is used.
If LogFileName is not given, the standard output is used.

Options: (case sensitive, may be preceeded with a - or /)
-a Abort on error.
-ao Append output file
-al Append log file
-ap I|O|N Append Parameter file. Use with SCRIPT mode and -o option.
(Output file includes parameter column appended with output.
I-Inner join, O-Outer, N-None (default))
This option causes the output to be the row from InFileName with
the result set appended to each row as additional columns.
-cp Convert date and time type parameters (default)
(valid date and time formats are determined by Control Panel settings)
-cs Driver Connect String (if -cs is used -d -U and -P are ignored)
-d ODBC Data Source Name
-db Database Name (override Database in DSN or Connect String, use * to prompt)
-df:m/d/yyyy Date format.
-ds: overrides the control panel setting for the DataSeparator.
(must be a single character following the colon)
"-dtf:m/d/yyyy h:nn:ss" Date time format.
-fd Format decimal numbers (default)
-h Header row (default)
-U login
-P password
-ltf:h:nn:ss overrides the control panel setting for the long time format
used as the default time format for input and output.
-nt NULL_Token
NULL_Token is by default an empty string and is written in OUT mode
when column is NULL (Note: this is NOT used in IN mode).
-o OutputFile
SCRIPT mode only. If statement returns a result set, and OutputFile
is given, the result set is written to OutputFile
-r FileName - Reject file containing failed data rows (all modes except OUT)
-s FileName - Script file (write SQL script)
When this option is given, OutFileName is name of a tab-delimited text file
containing the columns to be exported as SQL. Only the first line is read.
Example: SQLData -s FileName.sql OUT TableName Header.txt
-sdf:m/d/yyyy overrides the control panel setting for the short date format
used as the default date format for input and output.
-t Right trim blanks from data (default)
"-tf:h:nn:ss am/pm" Time format.
-ts: overrides the control panel setting for the TimeSeparator.
(must be a single character following the colon)
-u Unescape import data
-v Verbose mode, write SQL_SUCCESS_WITH_INFO messages to log
-? help (this screen)
-help (this screen)

A minus sign after the option turns it off (example: -h- for No Header row).
Any parameter or option value containing spaces should be surrounded by double
quotes. Option settings may be saved in text files in the form:
Option=OptionValue
Example: d=Data Source Name

Each option is on a separate line in the file (do not use double quotes).
The option file SQLData.ini is loaded from the program directory first, then
the current directory. Another initialization file may specified to load last
by including a parameter on the command line like this: (the "indicates it is a parameter file, the file is named MyFile.ini)
The parameter(s) in each file override the previous file(s).
Login and password are optional if DBMS supports trusted connections.

Date and Time formatting strings:
Use blank format for no formatting, use _ for default formatting
DateTime default format leaves off time if time is zero.
/ is replaced with the DateSeparator from Control Panel.
: is replaced with the TimeSeparator from Control Panel.
Anything surrounded by single quotes is used as is, ex: m'/'d'/'yyyy
d for day (1), dd for (01), ddd for ShortDay, dddd for LongDay.
Examples: mm/dd/yy for 01/01/09, m/d/yy for 1/1/09, mm-ddd-yy for 01-Thu-09.
ddddd for ShortDateFormat, dddddd for LongDateFormat from Control Panel.
m for month 1, mm for 01, mmm for ShortMonth, mmmm for LongMonth.
Note: Day and Month names are in the language configured in the Control Panel.
yy for 2 digit year, yyyy for 4 digit year.
a/p displays a or p for time with matching capitalization.
am/pm displays am or pm for time with matching capitalization.
ampm uses time am/pm strings from Control Panel.

Version 2.4.5 http://www.incodesystems.com
mailto:infoTo see complete usage, type: SQLData /? | MORE