Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A database challenge
Message
De
27/02/2008 14:27:57
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
 
 
À
27/02/2008 01:42:54
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01295541
Message ID:
01297068
Vues:
23
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform