Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: mysql to stata

From   "Joseph Coveney" <>
To   <>
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

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


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:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index