Bookmark and Share

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   "Joseph Coveney" <[email protected]>
To   <[email protected]>
Subject   Re: st: mysql to stata
Date   Wed, 14 Jul 2010 02:27:57 +0900

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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index