Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 05 Mar 2012 @ 10:25:36 GMT


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


Subj:   Re: Debugging a procedure
 
From:   Dsilva, Simson

Anomy.Anom wrote:

  Is there any new method for debugging a procedure? Or we should always insert into a log table.  


Hi,

With TD 12 and above, GLOBAL TEMPORARY TRACE TABLE can be used to debug Stored Procedures, external SPs & UDFs.

     CREATE MULTISET GLOBAL TEMPORARY TRACE TABLE tracetst,
     NO FALLBACK, NO LOG (
     proc_id BYTE(2),
     sequence INTEGER,
     trace_str VARCHAR(100))
     ON COMMIT PRESERVE ROWS;

Note that global temporary trace tables are user-defined except for first two columns, which are always fixed.

And turn on tracing with following SQL (decide what your options mean):

     SET SESSION FUNCTION TRACE USING 'T' FOR TABLE tracetst;

Then call the procedure & once completed select * from the Trace table.


Thanks,



     
  <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: 23 Jun 2019