[sqlite] More on Column types

2007-09-04 Thread Andre du Plessis
What is the difference between:

 

MYCOLUMN NUMERIC

 

Vs

 

MYCOLUMN INTEGER

 

Or does it really mean nothing, 

I remember somewhere the default column type could be integer, after
that it defaults to whatever you insert.

 

But I was wondering... what would the preferred type be to

 

A: Store Int32 - Int64 values

B: Floating point values.

 

Is there a way to alter SQLite so that a select would always return a
column as a type you want? Either in the DB file or as part of the
select.

 

Thank you.



Re: [sqlite] More on Column types

2007-09-07 Thread Dennis Cote

Andre du Plessis wrote:

What is the difference between:

 


MYCOLUMN NUMERIC

 


Vs

 


MYCOLUMN INTEGER

 
  
See http://www.sqlite.org/datatype3.html for a complete description of 
the difference.


Or does it really mean nothing, 


I remember somewhere the default column type could be integer, after
that it defaults to whatever you insert.

 


But I was wondering... what would the preferred type be to

 


A: Store Int32 - Int64 values

B: Floating point values.

 
  

A: use a declared type of INTEGER

B: use a declared type of REAL


Is there a way to alter SQLite so that a select would always return a
column as a type you want? Either in the DB file or as part of the
select.

 

  
Yes, only insert data of the declared type into the column. If you 
declare the column as an integer, and only insert integer values, you 
will always get integer results when selecting the column.


HTH
Dennis Cote


-
To unsubscribe, send email to [EMAIL PROTECTED]
-