Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 02 Sep 2009 @ 16:17:17 GMT


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


Subj:   Re: Run Teradata BTEQ/SQL/StoredProc from DOS
 
From:   Curley, David

SPs cannot write to a log file a la Oracle's dbms_output (technically writing to a buffer space, not a file). I don't know if Teradata supports direct writes to a text file, but I'd tend to doubt it.

You can write to a log table, but since Teradata doesn't support autonomous transactions, there are some trade-offs:

1) Don't use transactions in your proc and log each step to a table. This way you can keep your log if there's an error, but everything will be committed up to that point.

2) Use transactions in your proc and log each step to a table. This way you'll have a log of successful runs, but you'll lose your log messages if there's an error and you roll back.

3) Each time you want to log a step, concatenate that message into a string. Since you can't execute multi-statement requests in dynamic SQL, you'll need to write another proc that can parse that string and insert each segment into the log table.


If you just want the text, you could do 3), but return the string from the proc and handle it from there.


Dave C



     
  <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