Re: [sqlite] Manifest Typing question

2005-06-21 Thread D. Richard Hipp
On Tue, 2005-06-21 at 06:18 -0400, Ken & Deb Allen wrote:
> Will declaring the column as VARCHAR not achieve the same thing? Does  
> SQLITE not translate VARCHAR to TEXT, rather than numeric?
> 

VARCHAR, TEXT, and CLOB are all the same thing.
See http://www.sqlite.org/datatype3.html section 2.1
for details.
-- 
D. Richard Hipp <[EMAIL PROTECTED]>



Re: [sqlite] Manifest Typing question

2005-06-21 Thread Ken & Deb Allen
Will declaring the column as VARCHAR not achieve the same thing? Does  
SQLITE not translate VARCHAR to TEXT, rather than numeric?


-ken

On 21-Jun-05, at 5:10 AM, D. Richard Hipp wrote:


On Tue, 2005-06-21 at 00:13 -0400, Tito Ciuro wrote:


Hello,

When I add text to the database, it's getting truncated because
SQLite is converting it to a number. For example, I enter "9.0", but
SQLite stores it as "9".

Is there a way to force the value to be inserted as string?




Make the declared datatype of the column TEXT.

Example:

CREATE TABLE t1(a, b INTEGER, c REAL, d TEXT);
INSERT INTO t1 VALUES(9.0,9.0,9.0,9.0);
SELECCT * FROM t1;

Results in:

9|9|9|9.0

--
D. Richard Hipp <[EMAIL PROTECTED]>





Re: [sqlite] Manifest Typing question

2005-06-21 Thread D. Richard Hipp
On Tue, 2005-06-21 at 00:13 -0400, Tito Ciuro wrote:
> Hello,
> 
> When I add text to the database, it's getting truncated because  
> SQLite is converting it to a number. For example, I enter "9.0", but  
> SQLite stores it as "9".
> 
> Is there a way to force the value to be inserted as string?
> 

Make the declared datatype of the column TEXT.

Example:

CREATE TABLE t1(a, b INTEGER, c REAL, d TEXT);
INSERT INTO t1 VALUES(9.0,9.0,9.0,9.0);
SELECCT * FROM t1;

Results in:

9|9|9|9.0

-- 
D. Richard Hipp <[EMAIL PROTECTED]>



[sqlite] Manifest Typing question

2005-06-20 Thread Tito Ciuro

Hello,

When I add text to the database, it's getting truncated because  
SQLite is converting it to a number. For example, I enter "9.0", but  
SQLite stores it as "9".


Is there a way to force the value to be inserted as string?

Thanks,

-- Tito