Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need a ISKeyword() function
Message
From
22/01/1999 13:48:32
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00179052
Message ID:
00179121
Views:
26
>>>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.

A much better approach indeed.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform