Single Quote Character Must be Escaped When Using the -q Option - Aster Client

Teradata Aster® Client Guide

Product
Aster Client
Release Number
7.00
Published
May 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
hki1475000360386.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
B700-2005
lifecycle
previous
Product Category
Software

If you encounter an error like:

"ERROR:  extra data after last expected column"

you may have encountered a problem with command line parsing. If you used a single quote delimiter in your CSV input file, and the input data includes a comma within one of the text strings to be loaded, you will see this error.

To correct this, you will need to escape the single quote character when specifying it using the -q option on the command line as -q"\'".

Here is an example:

Assume the file test.txt, which we are attempting to load into table table1 includes the following input data row:

1, 25, "Some text with a, comma in it."

The following will not load, returning the "Error: extra data after last expected column" error:

ncluster_loader -l 10.50.129.103 -U db_superuser -w db_superuser -d beehive -c  -q"'"  table1 test.txt

The following will load:

ncluster_loader -l 10.50.129.103 -U db_superuser -w db_superuser -d beehive -c  -q"\'"  table1 test.txt