psOLoader

Description

     This program loads your text data file into a table at an ODBC data source.
As it loads, this program checks each field in each record of your file to see
whether it is compatibile with its corresponding column data type.
It checks *before* it copies the data to the ODBC data source.  If there is a
problem with any field, this program tells you the record number where
the problem occurred, and then immediately ends with a *non-zero*
exit code.   If this program does not detect any problems either by
its own algorithms or by messages returned from the ODBC data source,
then this program ends with a 0 (successful) exit code.   A single error
will cause psOLoader to exit with a non-zero code.
      For data type errors, psOLoader always tells you the
offending line number.  If you are getting duplicate row errors, psOLoader
can only give you the offending range of records.  The range of
records matches the size of the batch (-b).  If you make your batch
size 1, then you will know the exact number of the duplicate record.

 

Syntax

psOLoader -Sdsn -Vserver -Uusername -Ppassword
-Dcatalog -Wowner -Ntable -Binput_text_file -Hheader_records -bbatch_size
-Zcolumn_delimiter_string -Yrow_terminator_string
-Lleading_character_to_remove -Ttrailing_character_to_remove
-cmax_char_len -mmax_record_len -xmax_image_or_text_len
-Flog -Mmax_log_size -Ee-mail_address -Ooptions

 

Arguments

-S

ODBC Data Source

-V

ODBC Server Name

-U

ODBC User Name

-P

ODBC User's Password

-A

ODBC Other Attributes

-D

ODBC Catalog (Database)

-W

Table belongs to this 'schema'

-N

Table having pattern 'name'

-C

Column to convert from binary to text

-B

Name of the input load file [standard input]

-H

Number of header records to ignore [0]

-b

Number of rows in a single transaction [1]

-Z

Column delimiter string [|]

-Y

Row terminator string [operating system default record terminator]

-L

Leading character to remove

-T

Trailing character to remove

-c

Minimum char/varchar column size

-m

Maximum record size [104096]

-x

Maximum blob size [100000]

-t

Convert boolean true values to this value

-f

Convert boolean false values to this value

-F

Log file [standard output]

-M

Maximum Log Size [1000000]

-E

E-mail address to report errors

-O

Options

 

Options

m

Use Data Direct ODBC drivers

l

Convert incoming table name to lower case

u

Convert incoming table name to upper case

n

If table does NOT exist, ignore the problem and then exit successfully

t

Truncate table before loading

f

Use conversion functions {fn convert(?, SQL_BIGINT)} etc. when binding

p

Bind parameters but do NOT use prepared statements

a

Use ad-hoc SQL.  Do not bind parameters

x

REMOVE any 0x prefix from the column hex string values

o

Convert column hex strings to text w/octal strings    (binary column is the target)

s

Convert column hex strings to text                    (binary column is the target)

c

Convert -C column hex strings to text w/octal strings (char column in target)

d

Convert -C column hex strings to text                 (char column is target)

h

Convert ADE 128-255 bytes in strings to octal strings (char column is target)

q

Enclose binary column values in single quotes

w

Remove leading and trailing white spaces from fields

b

Convert empty boolean fields to false

A

Bind all character columns as ascii

U

Bind all character columns as unicode

1

Sort column names (case sensitive)

2

Sort column names (case insensitive)

 

Environment Variables Behind the Scenes

ODBC_DSN

When -S is not specified.

ODBC_SERVER

When -V is not specified.

ODBC_USER

When -U is not specified.

ODBC_PASS

When -P is not specified.

ODBC_ATTR

When -A is not specified.

PS_SYSMSG_FILE

Name of the tool's messages file.

PS_SYSPARAM_FILE

Name of the system parameter file

 

Notes

     This program is incredibly powerful, but you have to know what you are doing
before running it.   You have to be aware of your target's ODBC driver limitations
in order to choose the right options.   Be assured:  this program does supply the
all the options your need to load a text file of delimited data into an ODBC
table.
     You choose between two routes.  Without specifying any -O options, i.e., the default behavior,
this program attempts to upload your text file using the ODBC driver's text-to-database-data-type
conversion functions.    BY DEFAULT, I 'bind' your data and I 'prepare' SQL insert statements.
This is the best route you can go.  It is the most efficient.
     However, your ODBC driver may not support prepared statements.   Therefore, you must
use the -Op option which turns off prepared statements.
     Sometimes your ODBC driver will not support data type conversions.  Even
though text-to-database-type conversions are required by the ODBC standard,
some companies will not bother implementing them.  For example, Data Direct's
DBase Foxpro driver does not support the conversion functions.   For those
ODBC drivers that lack this functionality, I provide you with the -Oa option.
-Oa tells me to build full-text ad-hoc SQL statements on the fly.
     This ad-hoc SQL statements are very inefficient, and now you need to be aware
of your ODBC driver's requirements regarding binary column data.  Regardless of driver,
all binary-column data must be in hexidecimal.   But whether that data must be
prefixed with an '0x' or whether the data must be enclosed in quotes, depends
entirely on the driver.   ODBC drivers are not consistent.   For example, the Data Direct
Sybase ODBC driver requires an 0x with no quotes.   But the Data Direct DBase driver
requires that the 0x be absent and the data enclosed in quotes.

 

Go to DBPowerSuite 7.9 List of Programs.


Updated: Thu Jun 18 21:12:26 2009