Work with query results inside a stored procedure
-
Hello! I need to write a stored procedure that will make a query, and then return a value depending on the query result. My question is how can I store the query results inside the stored procedure for me to be able to examine them and then return an appropriate result? Thanks in advance!
Have a nice day!
-
Hello! I need to write a stored procedure that will make a query, and then return a value depending on the query result. My question is how can I store the query results inside the stored procedure for me to be able to examine them and then return an appropriate result? Thanks in advance!
Have a nice day!
You want to store your query and then query that in a stored procedure? Can you not just do a bigger better query? You can use cursors to do iterative stuff if need be but its best avoided.
Regards, Rob Philpott.
-
Hello! I need to write a stored procedure that will make a query, and then return a value depending on the query result. My question is how can I store the query results inside the stored procedure for me to be able to examine them and then return an appropriate result? Thanks in advance!
Have a nice day!
Declare a temp table and save the result set inside that table. Make sure to drop it before you exit the stored procedure.
-
Declare a temp table and save the result set inside that table. Make sure to drop it before you exit the stored procedure.
Can you give me a simple example? I would be very thankful...
Have a nice day!
-
Can you give me a simple example? I would be very thankful...
Have a nice day!
Found an example by googling. Thanks!
Have a nice day!