Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use a dynamic Stored Procedure ?

Status
Not open for further replies.

Siggy19

Technical User
Jan 6, 2003
141
US
I have multiple parameters that I want to use and each can be set to 'ALL' or a specific value.

Rather than using multiple IF statements in the Stored Procedure to select the correct SQL statement, I am creating a single SQL Statement dynamically and then executing it using the EXECUTE command. (The fields returned by the SQL statement are always the same)

This works fine when I try running it as a Stored Procedure, but Crystal 8.5 will not let me Verify the Database using this query saying that there are no fields in the file.

I tried populating a temporary table using the execute command and that didn't even compile.

Any ideas ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top