Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A database challenge
Message
From
27/02/2008 14:27:57
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
27/02/2008 01:42:54
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01295541
Message ID:
01297068
Views:
25
Walter,

Kevin's example *IS* using parameters, which is the reason for bending it into the way he did.

Yeah, I guess I've misconstrued the effect of the Coalesce... I had assumed that with this:
WHERE LastName LIKE  '%'  +  COALESCE(@LastName,LastName)+  '%'  AND
            FirstName LIKE '%' + COALESCE(@FirstName,FirstName) + '%' AND
            Address LIKE '%' + COALESCE(@Address,Address) + '%' AND
            City LIKE '%' + COALESCE(@City,City) + '%' AND
            State LIKE '%' + COALESCE(@State,State) + '%' AND
            Zip LIKE '%' + COALESCE(@Zip,Zip) + '%' ),
If I entered 1% or 0=0 or Zip LIKE % in the Zip textbox on the displayed form, I could alter the intended behavior of the SQL. IOW I thought the coalesces were run just once, concatenating parameters' values into the SQL rather than being run on every row. I guess I need to slow down and check more carefully!
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform