Issue with importing CLOB data using BTEQ

Tools
WAQ
Enthusiast

Issue with importing CLOB data using BTEQ

Hi, I have a simple BTEQ script (given below) to load CLOB data in an empty table.

.LOGON ;

DELETE FROM TTE ALL;

.IMPORT INDICDATA FILE = C:\TEST\Data_Clob;
USING (LOBTYPE CLOB(1000000000))
INSERT INTO TTE ('1', :LOBTYPE);

.LOGOFF;

When I execute the script, I get the below error:

 *** Error: The following occurred during an Access Module read:

 Unexpected data format.

 *** Warning: Out of data.

 *** Warning: EOF on INPUT stream.

Tags (1)
2 REPLIES
Teradata Employee

Re: Issue with importing CLOB data using BTEQ

With INDICDATA, the file is expected to be in "FastLoad format" with binary length fields and NULL indicator bits at the start. And since you have not said otherwise, BTEQ will expect the CLOB data (up to 32K) to be in-line as a VARCHAR column.

Consider using something like

.IMPORT VARTEXT DEFERCOLS=1 FILE=C:\TEST\Lob_List;

USING (LOBTYPE CLOB(1000000000) AS DEFERRED BY NAME)

INSERT INTO TTE('1',:LOBTYPE);

Where Lob_List is a text file containing the filename for LOB data.

WAQ
Enthusiast

Re: Issue with importing CLOB data using BTEQ

Thanks a lot Fred. The code you provided is working as expected.

Thanks and Regards.