I am trying to write a stored procedure which will perform the following.
1. Dynamically create a Column List to be used in a SELECT statement
2. Minus Query
I have included the template of it below. I need to know will the stored procedure mentioned below be able to create the Column List on its own? Additionally, I need to check the result of minus query. If there is no record returned for my minus query, it should come out of the stored procedure with OUT value as 1. If there are rows returned in my minus query, I need to put the result set into something like a log (UNIX) which I can use it for reference. Basically, I need to know the equivalent of SQL%Found (Oracle) to be used in Teradata.