Teradata Load Errors

Teradata Studio
N/A

Teradata Load Errors

Hello,

I am attempting to load a tab delimited file into a table, and I am receiving the following errors:

Row number 6,812 had an error.

Cause = Unexpected number of parameters

Row number 26,237 had an error.

Cause = Unexpected number of parameters

Row number 31,402 had an error.

Cause = Unexpected number of parameters

I've looked at each of these rows in my raw data source, and the commonality amongst all of them is that they contain parentheses.

Example: (888)8998493

The column is formatted as varchar(20)

Any ideas on why I am receiving this error?

19 REPLIES
Teradata Employee

Re: Teradata Load Errors

A few questions:

1. What utility are you using to load the table?

2. Can you provide the script that you are using?

Thanks

-Fred

Teradata Employee

Re: Teradata Load Errors

Andrew, Studio's Teradata Load feature allows for tab delimited columns and parenthesis within the column data. The 'Unexpected number of parameters' error means that the row contains more columns than the table has. You want to make sure that there are not embedded tabs in any of the column data for the rows that failed. Also, what is your Character String delimiter? Make sure the rows that failed have the correct string delimiter.

N/A

Re: Teradata Load Errors

A few questions:

1. What utility are you using to load the table?

2. Can you provide the script that you are using?

Thanks

-Fred




I'm using the "Teradata Load Wizard" that's a part of Teradata Studio. There really isn't a script, I am merely creating an empty table, and then loading the flat file.

Andrew, Studio's Teradata Load feature allows for tab delimited columns and parenthesis within the column data. The 'Unexpected number of parameters' error means that the row contains more columns than the table has. You want to make sure that there are not embedded tabs in any of the column data for the rows that failed. Also, what is your Character String delimiter? Make sure the rows that failed have the correct string delimiter.




The number of columns exceeding the amount of columns in the table was my first guess as well. I went back and checked, and the number of columns was correct.

A few more details about this. If I do a massive find/replace on the file, and remove the ( and ) parentheses, and do nothing else... the load works without error. Additionally, if I save the file in xlsx format instead of tab delimited, the load completes without error (although quite a bit slower).

My string delimiter is set to None. I also tried purposely inserting " or ' for the columns in question, and Teradata throws an unexpected token exception.

Teradata Employee

Re: Teradata Load Errors

Andrew, What version of Studio are you running?

N/A

Re: Teradata Load Errors

Studio version is 14.10

Teradata Employee

Re: Teradata Load Errors

Andrew, We have tested with our 14.10 version and do not see a problem with what you described. Can you attach a sample of the rows that fail?

N/A

Re: Teradata Load Errors

Sure.

I have a create table statement that looks like this:

 create table tab_test (paren_field varchar(20), norm_field varchar(20));

Then I try to load the file using the following screem (Right click on table > Teradata Load)

I don't think that I can attach a file here, but it is a simple file with two lines:

paren_field    norm_field

(888)8943456UK    random_text

Where the first row is column labels, and the second begins the data rows.

Here is the error I receive:

Starting Teradata Load...

Teradata Load Error Occurred: Error Code =  0

SQL State = null

Message = Teradata Load Error: Batch is empty.

2 Rows Processed

0 Rows Loaded

Teradata Load Failed

Row number 2 had an error.

Cause = Unexpected number of parameters

Again, if I remove the () from the data row, the table loads without issue.

Thanks for your help

Teradata Employee

Re: Teradata Load Errors

Andrew, Thanks. We will take a look at this.

Teradata Employee

Re: Teradata Load Errors

Andrew, We found a bug regarding the handling of parenthesis that was fixed in Studio 15.00 version. Is it possible for you to upgrade to Studio 15.00 and try your Teradata Load. Upgrading Studio will not delete your workspace. Let me know if the problem still exists after upgrading.