All Forums Database
TdMan 91 posts Joined 01/07
19 Jul 2010
<Error> value for a field

All,

The source data contains single or double blanks, which inturn are loaded into teradata using fastload script. In teradata the filed is a not null field. Once the fastload process completes this column is populated with '' .

Is this value an internal settings of SQL assistant? If not could someone tell me what could be the reason?

dnoeth 4628 posts Joined 11/04
19 Jul 2010

"source data contains single or double blank"

What format is the source data? Binary or readable text?

What's the datatype in DEFINE? Char or Varchar?

"this column is populated with '' "

Which column/datatype? Varchar?

input:varchar & target:varchar shouldn't trim blanks, but input:char & target:varchar will.

Dieter

Dieter

TdMan 91 posts Joined 01/07
19 Jul 2010

Dieter,

In DEFINE the field is specified as CHAR and in the target table it has VARCHAR.

As you have mentioned that the blanks would be trim, is there a work around for this issue without changing the target datatype?

CarlosAL 512 posts Joined 04/08
19 Jul 2010

"In DEFINE the field is specified as CHAR and in the target table it has VARCHAR."

"is there a work around for this issue without changing the target datatype?"

RTFM:

When the DEFINE command data type attribute is CHAR(n) and the:

• CREATE TABLE datadesc attribute is CHAR(n), Teradata FastLoad stores the data in fixed-length format, entire field.

• CREATE TABLE datadesc attribute is CHAR(m), Teradata FastLoad stores the data in fixed-length format, padded if m > n, truncated if m < n.

• CREATE TABLE datadesc attribute is VARCHAR(m), Teradata FastLoad stores the data in variable-length format with blanks trimmed.

When the DEFINE command datatype attribute is VARCHAR(n) and the:

• CREATE TABLE datadesc attribute is VARCHAR(m), Teradata FastLoad stores the data in variable-length format, no padding, blanks not trimmed.

• CREATE TABLE datadesc attribute is CHAR(m), Teradata FastLoad stores the data in padded or truncated format, as required.

The first part describes your case, the second how to fix it without changing the table data type...

HTH.

Cheers.

Carlos.

You must sign in to leave a comment.