Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 13 Nov 2005 @ 12:52:25 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: XML - Export From BTEQ
 
From:   Anomy Anom

<-- Anonymously Posted: Friday, November 11, 2005 5:29 AM -->

Yes, it is possible to export to an XML file from BTEQ by using the OLE DB access module with an OLE DB provider that supports XML output. You can Find OLE DB providers for a variety of purposes listed at www.sqlsummit.com/oledbVen.htm and look for those supporting XML.

Here's an outline of the steps (simple example):

- Obtain and install a provider supporting XML.

- You also need to install BTEQ and the Teradata OLE DB Access Module (both are available on the Teradata Tools and Utilities Load/Unload CD).

- Start the OleLoad program in order to create the job.

- Fill in the "Select a source" blank in OleLoad with NCR Teradata ("Teradata").

- Fill in the "Select a destination" blank in OleLoad with the name of your provider that supports XML.

- On the "Data Link Properties" dialog box, provide information specific to your provider. (For Connect for ADO XML, you can use "XML for ADO" in the "Data Source" blank and in the "Enter the initial catalog to use" blank, enter the full pathname of the folder where you want to write the XML file (i.e. "C:\temp\myfoldername")).

- Click on the "Test Connection" button to validate the information you entered into the "Data Link Properties" dialog box.

- In the "Select the desired tables and column(s)" group, select the table to be exported, and select the columns.

- Click on the "Settings" button.

- On the "Advanced Settings" dialog box, in the "Table name" blank, enter the base filename of the output file (i.e. "myoutfile"). Don't include the ".xml" extension as it will be added automatically. This file should not already exist as it will be created during the execution of the BTEQ job.

- On the main dialog, click on "Launch" and then "BTEQ".

- Make any desired changes to the simple automatically-generated BTEQ script. You should ensure that the SELECT statement references the correct table (you may need to add the database name).

- When the job runs, the XML output file will be created automatically.

- You can copy the automatically generated script for use outside of OleLoad (for example from a batch file) so long as you ensure that "C:\Program Files\Common Files\NCR\AXSMOD" is included in your system's PATH environment variable value (This can be done via Start / Control Panel / System / Advanced / Environment Variables / System variables.


This procedure has worked for me (on Windows-only), but as always, YMMV.


Best wishes!



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023