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]

st: changeing the database with odbc without using dialog box


From   "Dimitriy V. Masterov" <dvmaster@gmail.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index