Hi,
I'm using SQLEXEC to get a list of all tables in a MySQL database:
* setup ODBCC connection here
LOCAL lcCursor, lcTable
lcCursor = "TABLES_CURSOR"
lcTable = "abcdef"
TEXT TO m.cSQL NOSHOW
SELECT table_name FROM information_schema.tables WHERE table_schema = ( lcTable )
ENDTEXT
SQLEXEC(gnConnHandle, m.cSQL, m.lcCursor)
This will give an error: Unknown column 'lcTable' in 'where clause'
If I replace ( lcTable ) with "abcdef" the query runs fine. I tried some variations, like ("&lcTable"), &lcTable, "&lcTable", lcTable and (&lcTable), but without any luck.
What is the right syntax to get this query working with a variable for the table_scheme?
Regards, Gerrit
Today is only yesterday's tommorrow - Uriah Heep