Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need a ISKeyword() function
Message
 
 
À
22/01/1999 13:39:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00179052
Message ID:
00179120
Vues:
21
>>I need a function that tells me that a character expression is a keyword, that is, a reserved word in VFP.
>>
>>I allow some limited changes to table structure and indexes. I need to check if the users has entered a reserved word for either.
>>
>>These can cause problems with SQL statements etc.
>>
>>If I have to write one does anyone have a table of reserved or Keywords?
>
>In general the keywords that SQL chokes on are not VFP keywords, but SQL keywords. You can avoid 99% of problems by makin sure fields are not SQL keywords:
>
>FUNCTION isSQLKeyWord
>tcWord
>tcWord = UPPER(ALLTRIM(tcWord))
>
>RETURN INLIST(tcWord, "SELECT", "FROM", "WHERE", "HAVING", "GROUP", "ORDER", "INTO","IN","BY","TOP","NOT","TABLE","CURSOR","ARRAY")

You might be bettor off putting the keywords in a one-field table so you can add to it. NUMBER, SUM, COUNT, etc., are also bad for field names.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform