Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Data loss loading integers via ODBC


From   Dave Ewart <[email protected]>
To   [email protected]
Subject   Re: st: Data loss loading integers via ODBC
Date   Tue, 10 Jul 2007 15:04:23 +0100

On Monday, 09.07.2007 at 14:57 -0500, James Hassell, StataCorp LP wrote:

> Dave Ewart <[email protected]> reported a case in which Stata could loose
> data when importing via ODBC.  He was importing data from PostgreSQL and 
> MySQL, and the data was stored using the "smallint" type.  Stata stores
> such values as -int-.  As Dave wrote, 
> 
> > In PostgreSQL and MySQL, there exists a smallint type: -32768 to +32767
> >
> > However, Stata's 'int' type is -32,767 to 32,740
> 
> The values 32,741 through 32,767 are used to store Stata's missing values, .,
> .a, .b, ..., .z.  Thus, values in the original data between 32,741 and 32,767
> turn into Stata missing values.

Ah, I wondered what the reason for that was...

> Dave also noted the same problem can arise with -byte- and -long-.
> 
> We will fix the problem.  In the meantime, we have a workaround.

Thanks for following this up.  Of course, the workarounds are only of
use if one is aware that the problem actually exists; in other
situations, one may blindly assume that all is well and that there are a
few missing values!

Thanks James.

Dave.
-- 
Dave Ewart
[email protected]
Computing Manager, Cancer Epidemiology Unit
Cancer Research UK / Oxford University
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016
*
*   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