Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 21 Mar 2006 @ 17:58:39 GMT


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


Subj:   Re: Passing SQLSTATE in Stored Procedures back to BTEQ?
 
From:   Geoffrey Rommel

  I want the SP to return the SQLSTATE of the COLLECT STATISTICS step.... What I want to happen is that the state of this event (if NZ) will also cause the INVOKING of the SP itself to return the same NZ value.  


I think you mean that you want the stored procedure to "return" the SQLSTATE, as if it were a return code or Teradata error code. This would allow you to do the following:

     call my_sp(...);
     .if errorcode <> 0 then .quit 8;

If that is what you mean, it can't be done. Procedures can't return return codes. Also, SQLSTATE is not numeric; it is a string of 5 characters and may even contain letters. Errorcode, of course, is an integer.

Your best bet is probably an OUT parameter, but unfortunately that can't be tested in the .IF statement.



     
  <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