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]

Fwd: st: database store


From   Andrew Dyck <[email protected]>
To   [email protected]
Subject   Fwd: st: database store
Date   Fri, 25 Feb 2011 09:06:42 -0800

Hi Argyn,

Using odbc is probably a good choice, since it lets you skip the
-insheet- step and can pull the data in directly. Depending on how
these external tools you mention work, odbc could have a big advantage
when working with large datasets. No sense in using -insheet- with
observations from 1950-present if you are just going to drop all but
the most recent year in the next step. It's also nice to have all your
code in one place so you can run the project from start to finish
without external tools.

A couple notes about using odbc in Stata though. I have experienced
Stata locking up while querying large amount of odbc data. It still
does the job if given enough time but appears as if it's '(not
responding)'. I'm not sure how the speed of data import compares
between querying an equal amount of data from ODBC or a text file, but
when Stata imports a large text file, it may take a long time but the
same appearance of an unresponsive program doesn't occur.

Obviously, if you are executing queries other than SELECT on odbc,
there is no undo. You have to be a little more careful than when using
a 'working copy' of the data. Maybe these external tools give you a
little buffer to avoid costly mistakes?

If you use the connectionstring() option with -odbc- instead of
setting up a dsn, your username and password for the database are
saved in a .do file, which isn't very secure.

Hope that helps with your decision!

Cheers,
Andrew



On Thu, Feb 24, 2011 at 12:27 PM, Argyn Kuketayev
<[email protected]> wrote:
>
> Hello
>
> I'm looking for the best approach to use stata with data stored in
> relational database?
>
> should i use external tools to download data into flat files, then
> analyse in stata?
> should i use odbc from within stata to load data into memory?
>
> cheers
> --
> Argyn Kuketayev
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index