Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Stored Procedure: Validating Volatile Table Output Names - forum topic by cochetti

$
0
0

I have a stored procedure with a call like this:

REPLACE PROCEDURE databasename.ProcedureName (  
 IN  tblInput1   VARCHAR(300) NOT CS, 
 IN  tblInput2   VARCHAR(300) NOT CS, 
 IN  tblOUTPUT   VARCHAR(300) NOT CS, 
 OUT message   	 VARCHAR(500)
) 

The goal is to output a volatile table with the name in the string input, tblOUTPUT.  However, I want to set an error handler that fails the procedure if tblOUTPUT already exists in the user's database. There are a number of interim tables and CPU overhead that I would rather not incur if the procedure will fail at the end. 
As tblOUTPUT could be a volatile table, I don't know a way to query for its existence from within the stored procedure. Is there a way to do this?

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>