Syntax for loading XML data file (CLOB) using BTEQ

Tools
Enthusiast

Syntax for loading XML data file (CLOB) using BTEQ

I'd like to use BTEQ v12 to load an XML data file (filesize > 1MB) into a CLOB column. Is this possible? I haven't been able to find the proper syntax. I have done this using the (unsupported?) LOBTEQ utility.
3 REPLIES
Enthusiast

Re: Syntax for loading XML data file (CLOB) using BTEQ

FYI - I received an answer to this from a Teradata development contact. Here's the syntax that worked for me using BTEQ v12 (on a Unix MPRAS server):

.import vartext '|' LOBCOLS=1 file=load.txt
using (b clob as deferred, a varchar(32)) ins into ttmp.hold_xml_input values (:a, :b);

And, the (pipe delimited) load.txt file contains the XML data filename, like this, ...

data.xml|1

Re: Syntax for loading XML data file (CLOB) using BTEQ

Hi,

Will this work with BTeq V7.1. We are using Teradata V2R6 version. Can you tell me the BTeq command to store a CLOB field?

Re: Syntax for loading XML data file (CLOB) using BTEQ

To add:

I got the below error when I tried using LOBCOLS

BTEQ -- Enter your DBC/SQL request or BTEQ command:
.import vartext '|' LOBCOLS=2 file=C:\manjeeth\1.txt
.import vartext '|' LOBCOLS=2 file=C:\manjeeth\1.txt
*** Syntax Error: Expected FILE or DDNAME keyword, not "LOBCOLS".
*** Warning: Extra text found after command.
The text '=2 file=C:\manjeeth\1.txt' not processed (ignored).
BTEQ -- Enter your DBC/SQL request or BTEQ command: