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: Re: odbc load variable not found


From   "Joseph Coveney" <[email protected]>
To   <[email protected]>
Subject   st: Re: odbc load variable not found
Date   Sat, 26 Oct 2013 12:15:19 +0900

David Puddicombe wrote:

I am trying to import data from an access database table to stata using odbc 
load.  There are a few variables in the access database table with a full 
stop/period in the variable name, which it seems cannot be loaded into stata 
using the odbc load command:
- Main_Form.IDNUM
- Main_Form.Genotype
- Lab_PCR.Genotype
- Vaccine.IDNUM

The command I am using is below.  It works if I exclude the variables listed 
above with the '.' in the variable name.

odbc load ///
	primarykey="Primary Key" ///
	main_formidnum="Main_Form.IDNUM" /// 
	casereport="Case Report" ///
	...
	, table(data_export_all)

Is it possible import the variables with '.' in the variable name?

--------------------------------------------------------------------------------

You can also try combining Sergiy's suggestion with the 
-odbc load, exec("SELECT [Primary Key] AS primary_key, . . .")- 
form of the command.

I'm curious as to how you managed to get an Access database with periods in the
names of columns.  According to the help file for Access, "Names of fields, 
controls, and objects in Microsoft Access: . . . Can include any combination of
letters, numbers, spaces, and special characters except a period (.), an 
exclamation point (!), an accent grave (`), and brackets ([ ])."

Is it possible that you've got a Microsoft SQL Server database with its 
three-part naming convention?

Joseph Coveney


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index