Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need a ISKeyword() function
Message
De
22/01/1999 13:39:45
 
 
À
22/01/1999 12:50:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00179052
Message ID:
00179114
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")
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform