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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: mysql to stata


From   Tyler Frazier <tyfrazier@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: mysql to stata
Date   Tue, 13 Jul 2010 14:50:00 -0400

this seems to be working

I notice the variable types changed twice (text length 0 changes to
char length 244 , float changes to double) int stays the same

trying it out in the model now

On Tue, Jul 13, 2010 at 1:53 PM, Tyler Frazier <tyfrazier@gmail.com> wrote:
> 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 <jcoveney@bigplanet.com> 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/


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