BTEQ

Tools
Enthusiast

BTEQ

sel date1 - date2 month(4) from table1 (sample query)
When i execute a similar query in queryman it works fine
but when i write a bteq and execute it using jcl it throws an ansi eror (operation cant be performed on a time interval value)
how to solve it
6 REPLIES
Enthusiast

Re: BTEQ

Try changing your BTEQ session to ANSI before logon.
.SET SESSION TRANSACTION ANSI

This error comes when table is created and loaded in ANSI mode and try to select data using BTET mode.
Enthusiast

Re: BTEQ

Thanks Somesh........ this worked........
Enthusiast

Re: BTEQ

In BTEQ, is default mode ANSI or BTET??
for single statement request which one is best??? (regarding performance aspect)
is thr any error tables like in FLoad and MLoad??

Thanks and Regards
Anil Reddy
Enthusiast

Re: BTEQ

> In BTEQ, is default mode ANSI or BTET??
--BTET is the default for BTEQ.

> for single statement request which one is best??? (regarding performance aspect)
-- I am not sure if there is any performance gain for an 'exactly same' single statement. Using BTET mode, you will be able to use Teradata specific DMLs which otherwise may require string manipulation which is bad for performance.

> is thr any error tables like in FLoad and MLoad??

-- No. BTEQ doesnot support any error table. BTEQ supports limited conditional logic for system status values.User may change the severity level associated with one or more internal error code, then use it in conditional logic. A final return code other than 0 is either a warning or an error.
Enthusiast

Re: BTEQ

Thank u somesh....
I've one more doubt...
Using BTEQ can we load data without using FLoad and MLoad??
Can we generate flat file from source databases(oracle,TD,DB2....)??

Thanks and Regards
Anil Reddy
Junior Contributor

Re: BTEQ

Hi Anil,

BTEQ might be used for import/export (but not for a large number of rows) on a Teradata system.
So you can't logon to Oracle et al to export to a flat file.

You might use the OLE-DB Access Module to read data directly from another DBMS to load it into Teradata.

http://www.info.teradata.com/DataWarehouse/eTeradata-BrowseBy-Results.cfm?pl=&PID=&title=%25&release=&kword=CBTEQ&sbrn=7&nm=Basic+Teradata+Query+(BTEQ)

Dieter