Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Duplicate macro in the where clause
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Duplicate macro in the where clause
Miscellaneous
Thread ID:
00883567
Message ID:
00883567
Views:
41
How would I duplicate making a portion of the where clause of a procedure change depending upon what value was passed to th procedure? In vfp I could use the macro substitution and do the following:

If empty(x)
whereclause = ' .t.'
else
whereclause = ' x = y'
endif

select * from tablea where b=c and &whereclause

How would I duplicate this in my stored procedure with out making the select statement twice?

Thanks in advance
Kelly
Next
Reply
Map
View

Click here to load this message in the networking platform