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]

st: Another question on -odbc load-

From   Jen Zhen <>
Subject   st: Another question on -odbc load-
Date   Sat, 17 Nov 2012 18:28:25 +0100

Dear Statalisters,

I am trying to load data from SQL into Stata with a commands of the
following form:

local db "DRIVER={MySQL ODBC 5.1
local SQL_statement "SELECT DISTINCT var1, var2, var3, FROM table1
WHERE var1=5 AND year(date)=´2000´;"
odbc load, exec("`SQL_statement'") conn("`db'")

This worked perfectly well when I ran this on the Stata IC 11.2 on my
Windows 7 64-bit laptop.
However, when I run the same commands on a Stata IC 11 on a cluster, I
get the error
"dsn() required

This is strange because I believe all information on the
datasourcename dsn should already be included in the local "db" I
entered into the conn option
and because I did not get that very same error when running the
command on another computer.

Is this because in some versions of Stata or the system I need to
specify the options differently
(I could specify -dsn(mydatabase)- but Stata won't take the dsn and
conn options at the same time, so I would need to leave out the conn
option, but then I how do I tell it all the other information on the
driver, server, username and password?),
or is it that maybe some necessary module/adofile is not installed on
the cluster?

Thanks so much and a good weekend,

*   For searches and help try:

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