Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL 101 (again)
Message
De
24/07/2002 10:45:46
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00681356
Message ID:
00682047
Vues:
41
Your Welcome

>Thank you. That was exactly it!
>
>>Ashley
>>
>>I am not sure about Access but in a SQL database use have to use ' around strings.
>>
?SQLexec(nFileHandle,"select * from EMPLOYEE where EMPID in ('ABCO','CALPE','BEBO')",'EMPINFO')
>>
>>>Hi Al,
>>>
>>>Tried this with no luck (returns -1 if I add the WHERE .. IN clause, 1 - success if I remove it)
>>>
?SQLexec(nFileHandle,'select * from EMPLOYEE where EMPID in ("ABCO","CALPE","BEBO")','EMPINFO')
>>>>>Thanks for the response, Al.
>>>>>Could you give me an example of the 'IN' syntax?
>>>>
>>>>From VFP7 help for SELECT - SQL, Example 7:
Example 7 displays FilterCondition in the form of FieldName [NOT] IN Value_Set
>>>>
>>>>When the filter condition includes IN, the field must contain one of the values before its record is included in the query results.
>>>>
>>>>customer.postalcode NOT IN ("98052","98072","98034")
This example uses character values. If your case uses numeric values, remove the quotes. You would typically build the entire SELECT command as a string variable and pass that as one of the parameters to your SQLEXEC() function call.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform