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?