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]

st: changeing the database with odbc without using dialog box


From   "Dimitriy V. Masterov" <[email protected]>
To   Statalist <[email protected]>
Subject   st: changeing the database with odbc without using dialog box
Date   Thu, 29 Jul 2010 12:10:56 -0400

Is there a way to tell Stata which odbc database to use without going
through the dialog prompt? I am loading some data with:

odbc load, dsn("MIHQDB50") table(tabWeeklyStoreItemPricingAll) clear

This produces the error:

The ODBC driver reported the following diagnostics
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
'tabWeeklyStoreItemPricingAll'.
SQLSTATE=42S02
r(682);

This is because the default is to use the database DataWarehouse. When
I use the dialog box to change to database to Orders, where the table
I want is located, everything works, but requires manual effort:

odbc load, dsn("MIHQDB50") table(tabWeeklyStoreItemPricingAll) dialog(prompt);

Is there a way to let Stata know which database I want to use?

DVM
*
*   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