Statalist The Stata Listserver


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

Re: st: tosql datatypes


From   "Svend Juul" <[email protected]>
To   <[email protected]>
Subject   Re: st: tosql datatypes
Date   Wed, 13 Jun 2007 11:25:10 +0200

Hendri Adriaens wrote:

tosql writes datatypes for variables when creating a table creation
script.
But it uses the Stata datatypes for this, not the sql datatypes. I have
a
column of integers, some around 36000. Stata treats this as float, but
this
has a different meaning in sql. This is inconvenient as you will need
conversions or casts in the program using the sql database to make sure
that
computations won't fail on the datatype.

Is there a way to improve on this? For instance via an interface to
tosql
that allows for overruling the type of certain columns (or all at once).

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

- and Nick Cox gave some comments.

Would it help if you changed the variable type to long (integer)? See:

   help recast

Svend

__________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone: +45 8942 6090
Home:  +45 8693 7796
Email: [email protected]
__________________________________________ 

*
*   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