Dear Listers,
While happily navigating my freshly installed Stata 8 (running under
Windows 2000) I was stopped by seemingly odd behavior of the ODBC utility
(one of the goodies in Stata 8). Loading tables via -odbc- is just a snap,
there is, however, something wrong with the way the string variables are
handled - my Stata consistently adds a 127 blank characters pad to any
downloaded string variable, so i.e. 20 characters string is loaded and
reported as having 147 characters (str147). This happens with both
SQL-server and MS Access databases - below I reproduce results of the load
from "Northwind" database to be compared with printouts given in Reference
Manual for -odbc-. Since all these 'strxxx' strings are longer than 80
characters Intercooled Stata can handle, this dataset is exploding into
user's face when trying to -list-, -drop- or -keep- (Stata crashes and
exits). One can of course extract the original strings by generating
properly defined new string variables using substr function, but this is a
bother (and you have to keep the 'oversized' string variables anyway).
Any suggestions?
Daniel
-------------------------------
. odbc load, table("Employees")
note: Photo is of a type not supported in Stata; skipped
. describe
Contains data
obs: 9
vars: 16
size: 16,740 (99.9% of memory free)
----------------------------------------------------------------------------
---
storage display value
variable name type format label variable label
----------------------------------------------------------------------------
---
EmployeeID long %12.0g
LastName str147 %147s
FirstName str137 %137s
Title str157 %157s
TitleOfCourtesy str152 %152s
BirthDate double %td
HireDate double %td
Address str187 %187s
City str142 %142s
Region str142 %142s
PostalCode str137 %137s
Country str142 %142s
HomePhone str151 %151s
Extension str131 %131s
Notes str207 %207s
ReportsTo long %12.0g
----------------------------------------------
*
* 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/