BTEQ log generatin with in the BTEQ script using .run file

Database
Enthusiast

BTEQ log generatin with in the BTEQ script using .run file

Hi Guys,

 

Need some quick help on the below scinario.

 

I have a requirement where i have to route the log to a file with in the BTEQ scripts .

 

.run file = will logon to bteq 

 

creating a volatile table with data ;

 

.run file = insert.txt >> will be using the volatile table create above this step and would like to log the output to a file (will be running on unix system)

.run file =  insert.txt >> will be using the volatile table create above this step and would like to log the output to a file (will be running on unix system)

 

.logoff;

 

Regards

 

4 REPLIES
Enthusiast

Re: BTEQ log generatin with in the BTEQ script using .run file

got the solution 

 

..MESSAGEOUT FILE = file path 

Teradata Employee

Re: BTEQ log generatin with in the BTEQ script using .run file

Hi. In case it matters for your efforts... In BTEQ's 16.20.00.04 version a RESET option has been added to the MESSAGEOUT command. This option causes BTEQ to restore the standard output back to the original stdout/SYSPRINT stream, which could be a terminal screen, a redirected file, a pipe, or some other device. It appears you are talking about a batch mode use case. But for completeness here, error handling was also improved so that if a MESSAGEOUT command fails during interactive mode, BTEQ will preserve the previous MESSAGEOUT state without terminating.

 

Enthusiast

Volatile table has failed while running in a BTEQ script but successful while running in Teradata.

Hi All,

I am trying to create a volatile table in bteq script which runs via a .bat file so evry query query ran fine except one volatile table.

It gave me below error message in log file:

Failure :6760 Invalid timestamp

But the same script is running fine when i m running in teradata SQL assistant.

 

Can anyone please advise if they have faced the same issue and help me in retifying this one.

Thanks in advance.

 

Regards,

Bhavini

Teradata Employee

Re: Volatile table has failed while running in a BTEQ script but successful while running in Teradat

Hi Bhavini,

 

You're probably facing an implicit conversion, which depends on the parameters of the environment where you run them.

Especially for date and timestamp, it's very sensitive : your database have a format, you ODBC driver have a format, your client have a format, your profile have a format, and I'm not even sure to be comprehensive.

 

You have to cast your problematic column using cast or to_timestamp function with format to handle this problem and make it environment proof.