Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CFindForm with SQL
Message
From
24/10/2004 21:53:49
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
CFindForm with SQL
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
00954162
Message ID:
00954162
Views:
64
Hi All,

I'm using CursorAdapters that accesses SQL data using SQL Stored Procedures. I want to create a cFindForm so I created a stored procedure that accepts a parameter for each field I want to search on. How do I compare blank values? For instance if I only want to enter a First and Last name what values do I pass to the other parameters so that the stored procedure will return every record with the first and last name values I indicated.

The stored procedure code is:
CREATE PROCEDURE Master_FindProc
       ( @First NVARCHAR(25),
         @Last NVARCHAR(25),
         @Address NVARCHAR(40),
         @City NVARCHAR(25),
         @State NVARCHAR(2),
         @Zip NVARCHAR(5),
         @Country NVARCHAR(20),
         @Number NVARCHAR(10),
         @Street NVARCHAR(25),
         @Unit NVARCHAR(10))
AS
BEGIN
   SELECT KMaster,
          Prefix,
          First,
          Middle,
          Last,
          GenerationSuffix,
          TitleSuffix,
          MiscAddr,
          Address,
          City,
          State,
          Zip,
          Zip4,
          FornLine,
          Country,
          Number,
          Dir,
          Street,
          Desig,
          Unit
   FROM Master
   WHERE
         Upper(First)=Upper(@First) AND
         Upper(Last)=Upper(@Last) AND
         Upper(Address)=Upper(@Address) AND
         Upper(City)=Upper(@City) AND
         Upper(State)=Upper(@State) AND
         Upper(Zip)=Upper(@Zip) AND
         Upper(Country)=Upper(@Country) AND
         Upper(Number)=Upper(@Number) AND
         Upper(Street)=Upper(@Street) AND
         Upper(Unit)=Upper(@Unit)    
      RETURN(0)
END
go
Aloha,

James
Next
Reply
Map
View

Click here to load this message in the networking platform