Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: odbc - load MS access queries + import access labels


From   "Daniel Mueller" <[email protected]>
To   <[email protected]>
Subject   RE: st: odbc - load MS access queries + import access labels
Date   Mon, 10 Jan 2005 15:36:28 +0100

Joseph,

I can indeed simply load queries created in Access with -odbc load,
table("QueryName")-. I didn't get there because -odbc query- does not list
them and '[R] odbc' talks about tables only. thanks a lot!

Daniel

> From: Joseph Coveney
> Sent: Monday, January 10, 2005 3:25 PM
> 
> Daniel Mueller wrote:
> 
> 1. Is it possible to load queries done in MS access into 
> Stata? I am able to read in all the tables using -odbc-, but 
> can't see the MS access queries after -odbc query-. 
> 
> And I wrote:
> 
> For your purposes I believe that you can think of your Access 
> "query" as equivalent to an SQL view.  In that case, you can 
> first issue the SQL statement 
> 
> CREATE VIEW from Stata via -odbc exec- with your Access query 
> as the argument, and then go through the view you just 
> created and load the result table into Stata via -odbc load- 
> in the usual manner.
> 
> --------------------------------------------------------------
> -----------------
> 
> Come to think of it, what I suggested might be redundant:  if 
> you've already created your query in Access and saved it, 
> giving it a name, then you've essentially already done the 
> CREATE VIEW step.  In that case, I believe you should be able 
> to load the Access query's result table via -odbc load, 
> table()- in the usual manner, i.e., using the query's name as 
> the table name.
> 
> And if you've saved the query in Access already, and you try 
> to create a view via CREATE VIEW with the same name as your 
> Access query's name, you might get an error message 
> indicating that that name has already been taken by another 
> object (table or query) in the database.
> 
> Joseph Coveney

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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