[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Using odbc load, table with MySQL

From   "Joseph Coveney" <>
To   "Statalist" <>
Subject   Re: st: Using odbc load, table with MySQL
Date   Thu, 17 Jul 2008 07:58:00 +0900

Thomas Jacobs wrote:

I am trying to use the odbc commands to connect to a non-local MySQL
database.  I have had success with odbc query, odbc describe and odbc
list but not odbc load

. odbc load, table("tradeday_libor") dsn("MarkitCDS")
[snip]                                              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 '"tradeday_libor"' at
line 1

if I execute the similar command I get a successful result:

. odbc load, exec("select * from tradeday_libor") dsn("MarkitCDS")

so my question is, what am I doing wrong in the load, table command?


My guess is that it has to do with the way Stata's -odbc load- is handling
quotes around the table name or somewhere else.

Try the command without the double quotes around the table name.  You
shouldn't need them, anyway.

If that doesn't work, try adding the -noquote- option.

If that doesn't work, try the -sqlshow- option and take a look at the SQL
statement that -odbc load- is generating; compare it to what you've got
in -odbc exec-.

Joseph Coveney

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index