Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use sql % syntax
Message
 
 
À
13/10/2009 12:37:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01429124
Message ID:
01429222
Vues:
53
>>Hi
>>I want to search the last record having some text
>>
>>mytext="ABC"
>>?SQLEXEC(lnHandle,"select ac from account where ac like '%'+mytext+'%' order by ac desc limit 1","tmp")
>>this return value -1
>>but
>>?SQLEXEC(lnHandle,"select ac from account where ac like '%ABC%' order by ac desc limit 1","tmp")
>>return value 1
>>
>>so how to combine "%" together with variable mytext ?
>
>You want to put the % inside the variable and pass as a parameter
>mytext = "%ABC%"
>?SQLEXEC(lnHandle,"select ac from account where ac like ?mytext order by ac desc limit 1","tmp")
Yes, I think this is the solution we came to in another thread, thanks.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform