Archives of the TeradataForum
Message Posted: Tue, 21 Mar 2006 @ 17:58:39 GMT
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.
|