Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: mysql to stata
From
Tyler Frazier <[email protected]>
To
[email protected]
Subject
Re: st: mysql to stata
Date
Tue, 13 Jul 2010 13:53:21 -0400
adding sqlshow results inthis
. odbc load, dsn("accra") table("annual_employment_control_totals") sqlshow
SELECT * FROM "annual_employment_control_totals"
The ODBC driver reported the following diagnostics
[MySQL][ODBC 3.51 Driver][mysqld-5.1.48-community]You have an error in your
SQL syntax; check the manual that corresponds to your MySQL server version for
the right syntax to use near '"annual_employment_control_totals"' at line 1
SQLSTATE=42000
but executing the second command seems to work
. odbc load, dsn("accra") exec("SELECT * FROM annual_employment_control_totals
> ;")
the data is there, but wondering what is going on and if I should be
concerned about it
On Tue, Jul 13, 2010 at 1:27 PM, Joseph Coveney <[email protected]> wrote:
> Tyler Frazier wrote:
>
> I then run the following command
>
> . odbc load, dsn("accra") table("annual_employment_control_totals")
>
> but get this error
>
> The ODBC driver reported the following diagnostics
> [MySQL][ODBC 3.51 Driver][mysqld-5.1.48-community]You have an error in your
> SQL syntax; check the manual that corresponds to your MySQL server version for
> the right syntax to use near '"annual_employment_control_totals"' at line 1
> SQLSTATE=42000
> r(682);
>
> I double checked the username and pwd -- looks right
>
> any ideas?
>
> --------------------------------------------------------------------------------
>
> A couple:
>
> 1. Try appending -sqlshow- to your -odbc load- command in order to see just what
>
> Stata is passing to MySQL in its call. You can inspect the SQL statement
> directly that way to see whether Stata went amiss in MySQL's peculiar syntax
> requirements. You might need to omit double quotes around the table name, or
>
> something.
>
> 2. Try -odbc load, exec("SELECT * FROM annual_employment_control_totals;") ///
> dsn(accra)- to see whether MySQL finds it copacetic.
>
> Joseph Coveney
>
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/