[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: WHERE SQL clause
I am having a problem with the odbc command on Stata 8.0. When I use
the exec("...") option in the odbc load command, everything works fine
provided that the SQL WHERE statement does not address VARCHAR values.
For instance, if I try the following SQL statement
SELECT * FROM MYTABLE, WHERE GENDER="F"
Stata gives me back the following message: table() or exec() is required
SELECT * FROM MYTABLE, WHERE AGE=20
works otherwise fine (age is a numeric variable). I suppose the problem
is in the quotes needed to address VARCHAR values, bou I do not know how
to work around it. An obvious solution would be to include an if clause
on the odbc load command, but I was to trying to access all my already
written SQL queries without having to rewrite them as Stata commands.
Thank you in advance,
Alberto Tosetto, M.D.
Divisione di Ematologia Department of Hematology
Ospedale S. Bortolo S. Bortolo Hospital
via Rodolfi via Rodolfi
36100 Vicenza 36100 Vicenza
* For searches and help try: