Failure: 3738 error while inserting String in a VARCHAR field. Need alternative way

Database

Failure: 3738 error while inserting String in a VARCHAR field. Need alternative way

Hello!

I get the following error while trying to insert a String (containing apostrophes, 33121 characters in total) into VARCHAR(35000) field:

INSERT Failed. 3738:  String is longer than 31000 characters. 

Is there an alternative way to insert data? Like different data type or special procedures? I use Teradata 13.10.07.21 version. I'm not sure if this question was already asked and resolved (I browsed through and did not find an alternative way to insert data).

Tags (1)
2 REPLIES
Enthusiast

Re: Failure: 3738 error while inserting String in a VARCHAR field. Need alternative way

3738   String is longer than 31000 characters.

Explanation:

Quoted strings cannot be longer than 31000 physical characters.

Generated By:

LEX modules.

For Whom:

End User.

Notes:

To insert longer strings, the user must have a USING clause and a DATA parcel that contain the characters.

Remedy:

Correct the statement to have a shorter string, and resubmit the request.

 

Can you try with clob,blob....?

Junior Supporter

Re: Failure: 3738 error while inserting String in a VARCHAR field. Need alternative way

It seems you are trying to insert an explicit string using quotes (''). The quoted strings cannot exceed 31000 chars. Your option is using an IMPORT file with the strings that you need to insert with a USING clause:

.IMPORT VARTEXT FILE blah.txt

.REPEAT *

USING (long_string VARCHAR(35000),

            more_data ...)

INSERT INTO YOUR_TABLE (the_string_column, ...) VALUES (:long_string, ...)      

HTH

Cheers.

Carlos.