Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 25 Feb 2011 @ 14:03:58 GMT


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


Subj:   BTEQ and Stored Procedures
 
From:   David Clough

I've asked this question in a different, more generic, way before, but I've got a more specific example to base my question on again .... if I can indulge your patience, based on second time of asking, that is.

I've got a BTEQ Script, and I want to incorporate this Call to a Stored Procedure (which copies the FastLoad Error Table from one Database to another) :

     .Label ERR1_CPY
     +---------+---------+---------+---------+---------+---------+---------+-
     +---------+---------+---------+---------+---------+---------+---------+-
     +---------+---------+---------+---------+---------+---------+---------+-
     +---------+---------+---------+---------+---------+---------+---------+-
     CALL DEVG123AHE.MOVE_ERR_TABLE_P('G123AHE', 'G123AHE', 'SCRHXT01 _ERR1', 'IBU',
     ResultCode, ResultMsg, SqlMsg);

      *** Procedure has been executed.
      *** Total elapsed time was 1 second.

     ResultCode ResultMsg
     ---------- ----------------------------------------------------------------
              8 Error at 2a  : SQL Exception, SQL State = T3706, SQL Code =   37

As you can see from the output of running the Bteq Script, the SP returns 8 in the OUT field 'ResultCode' (because I've 'manufactured' an error by putting a space in the Table Name on the IN parameter.

Thing is, can I in any way get to this OUT Parm, or get the SP to fail in any way that I can interpret the exception ?

I've tried looking at ErrorCode and ErrorLevel but Bteq (I think) sees it as 0 (i.e. SP completed successfully).

Do I HAVE to write the values to a Temporary Table and then read from that in BTEQ ?

Lastly, can I somehow display the ErrorCode or ErrorLevel in some Remark within the Bteq Output ? This would be so useful.

Thanks for any insight you have in this area.


Regards

David Clough
Database Developer
Database Design Group



     
  <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