50 - 100 of 139 tags for bteq


Hello all,
Thanks in advance for reading this.  
I am trying to pull data from Teradata and load it into MySQL without hitting the disk.  
I am currently doing it with a perl script and connecting BTEQ to LOAD DATA INFILE with a named pipe in linux.  


Could some help me out what is .quit 66 usage in the below statement.



Hi All,


I am trying to get the bteq script to dynamically select the column name [actually an expression using one ore more column names] to query using the value stored in another column.


I cannot use CASE statements as the user may want to come up later with different expressions.




Hello everyone,
I’m having an issue with a BTEQ script. The objective of the script is to:

Hi All,
the following is the issue that i am facing



 Teradata BTEQ for WIN32.

 Copyright 1984-2013, Teradata Corporation. ALL RIGHTS RESERVED.

 Enter your logon or BTEQ command:




UserId: dbc



I am trying to export the table to a data file, clear the table and use ".import data file" to import the data back in.  I always got the following error if the table has a "not null" column. 


*** Failure 2673 The source parcel length does not match data that was defi



I have requirement where i need to send mutliple files based on the data. Our enivroment is Unix and teradata.
EG: below is table with sample table.
C_Name   ID
xxxxx        1
yyyy          1
aaaaa       2
bbbbb       2
ccccc         1

Hi Experts,
Are there any differences b/w the multiple sessions that are invoked through BTEQ and loader utilities.  If so, what are they.

Hi all!
      I want to make a loop like this:
      while (i <= j){
       do something;
       i ++;
     but when i run the script it make mistake,anyone can help me ?tanks

Hi everyone,
We are calling stored procedure from bteq, sometimes it exits with bteq exit code 8 but it doesn't give any error messages.
Here is the bteq log:

.logon TD_2700/TPTLoader,


 *** Logon successfully completed.

 *** Teradata Database Release is

I am trying to load a very wide file into a Teradata table using BTEQ and unfortunately the records do not have a unique identifier other than record number which is implied by their location in the file (ie.

hello guys,
I have 80 to 90 tables and each has one file to get loaded.(file1 for T1, file2  T2 etc respectively)
Can i create one single script(fload,bteq or mload) for loading all these tables.
My input parameters will be filename and the target table-->  run script <file1> <targettable1>

Hi All
I have a problem with BTEQ/shell, I have a series of unix cmd's and bteq logins; It seems after entering the BTEQ its not coming back to shell.
Ma script is like
unix cmd1
unix cmd2
bteq <<[Test]

Do you need to reduce the amount of informational messages that BTEQ produces? Then try out the enhanced version of the BTEQ 14.10 command "SET ECHOREQ".

This article explains how to use ECHOREQ command's ERRORONLY option to instruct BTEQ to only echo back SQL requests that fail.

I need to store the value in the DataParcel column(which is of VARBYTE datatype) in the first error table of FASTLOAD into a permanent teradata table but with a proper format(The ddl of this table will be exactly the same as the target table, except that all datatypes are varchar)
I know this as a potential solution/*From teradata manual*/:

I am experiencing a sporadic problem with BTEQ skipping all the commands from STDIN.
The script is a shell script that does a bunch of set up and then calls BTEQ, piping in the commands that are in the same file.
Here's my script (at least part of it):

hi , Currently by using BTEQ and Teradata SQL assitant I am able to insert records into a table.
But I want to update records in a table. I have more than 2000 records in a table and i have 200 records in a file
both contain a same Primary key column and if there is no match found i want to insert a new row in a table.

Install Teradata Client on Unix Sun Solaris SPARC and general x86 machines

I installed Bteq on my system then i tried to logon by following comment
.logon <machinename>/<username>
I'm getting the below message

*** Logon successfully completed.

*** Teradata Database Release is 14.10i.00.394

*** Teradata Database Version is 14.10i.00.394

When I run a macro in the Teradata SQL Assistant in Export Result mode, I get a file content  that looks like this:
The point here is that each line must have the same length, and the “_” represent spaces.
But if I run the same macro from BTEQ:

I am trying to export data from oracle to Teradata.I use the following script to load data to flat file
CONNECT usr_id/pwd

Is it possible to call a bat file with input parameter using .run file command in bteq.
Eg. .run file 'test,bat' (param1);
Please suggest!!!!

I have a bteq script which creates procedures inside a database. The dbname say DB1 i will be specified in the bteq command.
The new change we have got now is that the statements inside the procedures would access tables of another DB say DB2.
Can we have a dynamic bteq script where we can specify DB2 too as a parameter??

I've installed TTU 14.00 on CentOS 6.3 x86_64.
bteq fails on login to a server, with this error:

.logon dev/user



 *** CLI error: MTDP: EM_GSSINITFAIL(235): call to gss_init failed.

 *** Return code from CLI is: 235

 *** Error: Logon failed!


In BTEQ, is there any equivalent to Oracle's SQLPLUS "EDIT" command?
Oftently, it's hard to manipulate a multi-line query using the traditional BTEQ interface. Is there any workaround available?

Hi All,
When i generate a report by using bteq, it is consuming some columns.
When i give the below statement it works properly.
.set width 500;
My question is here, how can i set default width for all of my bteqs?

Hi All, Can we use new line ("\n") as a delimiter in bteq import ? Please let me know any workaround for the same if  someone can.
HElp will be very much appreciated :).
Thanks ,



Dear All,


We are facing issues around BETQ.exe version 13.0.0(not very sure as the exe doesnt show in the properties) on Windows 2008 64-bit server.


Below is the error message I got when I try to invoke the BTEQ.exe from console


Dear All,
We are facing issues around BETQ.exe version 13.0.0(not very sure as the exe doesnt show in the properties) on Windows 2008 64-bit server.
Below is the error message I got when I try to invoke the BTEQ.exe from console

Hi All,
I am in need of a template of a Bteq where in we can use User defined variables (like we use in Stored Procedure).
I need to create it in Unix platform.
Any help is appreciated.

Input file:









I'm using the following code to create a report.





I'm getting the output as follows:

COLUMN1      COLUMN2      COUNT(*)


I am trying to export SQL output to excel file using .export DIF. I am getting SQL output but coulumn header is getting supressed. REPORT option outputs column header but output in excel is in a single row so not desirable. 

Anyone has idea on how to output column header using .export DIF?


I am trying ot export data to a flat file using a BTEQ.

I am getting an errneous situation in setting the target file format. First I am listing the code:-


I'm trying to run a bteq script from a Data Integrator Job. Basically, I generate a bteq file "on the fly" and run it. This is the bteq script generated:

Hi all,

I've a requirement where I'm using BTEQ to move a copy of data from Table A to Table B.  I'm using a simple


Note: Table A and Table B are with same structure. 

Teradata has completed a major compiler conversion effort that should be completely transparent to customers, yet they are the main beneficiaries.  This article:

  • Provides some historical background and context,
  • Discusses the reasons we switched compilers,
  • Identifies certain behavioral changes that were unavoidable,
  • And, finally, answers a few technical questions related to the overall process.

The venerable IBM mainframe was the original client platform developed for the Teradata RDBMS via channel-attached connections way back in the 1980s. Although we now support a wide range of client platforms using network-attached connections, a significant segment of our customer base continues to use mainframe clients.

I'm trying to import a flat file that is in a fixed width format on a Windows machine using BTEQ but cannot find any examples that work. Here's a sample script:

.IMPORT FILE='C:\test_file.txt';

Hi everyone! I am currently studying Teradata and currently working on this problem of mine. You see, i have this set of data on a flat file that needs to be loaded in a table based on a condition.

This is what my flat file looks like:

SOR|03/17/2012|2 -- This is a header

Hi,  I'm new to Teradata and need to do the following:

I'm on a Unix system, using verision 13.0. 

We're inserting data into the "Stage" table from a delimited text file (bell is the delimeter \007)

1.  export the dataparcel field from the _ET table to a file  (delimited text if possible)


i have a script where i want to set unix variable inside bteq script and then use this variable

further in the bteq script too.



bteq << EOF >>${LOG_FILE} 2>&1

SELECT BT_FLAG from db1.table1;

<set unix variable VAR_FLAG with BT_FLAG from above>

I want to Update and Insert when a condition in the case was true. However, it seems that Teradata doesn't accept it. My question is, is there a way for that to happen?



CASE WHEN SEL Table1.Column return TRUE





When using BTEQ or SQL Assitant to upload data into tables, I'm only getting about 2 records per second speed. Unfortunately, I don't have access to Fastload. I know its not the network as my down speed is blazing and Oracle is uploading normally.

What are the performance issues related with Macros as compared to BTEQ( for table to table loads ). we have all logic built into BTEQ however now certain users want to have them same built in macros so that they can be easily modified from SQL Assistant only .

I know following things where macro will fall short