I have Sps with all fields listed with default null/invalid values and then use ORs to limit the selection so I can pass by name any parameters I want (but watch that character limit in vfp strings).

e.g.
CREATE PROCEDURE usp_tblUserTrading_Get
@UserTradingID int = 0
,@UserID int = 0
,@TradingSheetID int = 0
AS
BEGIN
Select
*
from
tblUserTrading
where
((tblUserTrading.UserTradingID= @UserTradingID) or (@UserTradingID = 0))
and ((tblUserTrading.UserID= @UserID) or (@UserID = 0))
and ((tblUserTrading.TradingSheetID= @TradingSheetID) or (@TradingSheetID = 0))
order by
UserTradingID asc
END

This is for MS SQL so I dont know about MySQL.

--
Michael Hawksworth
Visual Fox Solutions

[EMAIL PROTECTED]
www.foxpro.co.uk





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to