Are you sure? Send us yours commands that prove that.

I wrote:

CREATE TABLE CurrentValues (
 Time_Stamp DATETIME DEFAULT CURRENT_TIMESTAMP,
 Sensor_ID WORD DEFAULT 1 NOT NULL,
 Sensor_Name VARCHAR(20),
 Sensor_Type VARCHAR(8),
 Sensor_Value FLOAT DEFAULT 0 NOT NULL,
 Sensor_Units VARCHAR(15) DEFAULT 'NotSet' NOT NULL,
 Location VARCHAR(20),
 Alarm LOGICAL DEFAULT False,
PRIMARY KEY (Sensor_ID));

insert into CurrentValues (Sensor_Name) VALUES ('this name');

select * from CurrentValues;

And I have:

2008-08-02 21:42:05|1|this name||0.0|NotSet||False
SQLite version 3.5.7

You expected somethig else?

Bye

Emilio

> Hi,
>
> I am using SQLite 3.6.0 under Windows. I created a table using the
> following schema (prev used in another DB hence Varchars etc.) :
>
> CREATE TABLE CurrentValues (
>  Time_Stamp DATETIME DEFAULT CURRENT_TIMESTAMP,
>  Sensor_ID WORD DEFAULT 1 NOT NULL,
>  Sensor_Name VARCHAR(20),
>  Sensor_Type VARCHAR(8),
>  Sensor_Value FLOAT DEFAULT 0 NOT NULL,
>  Sensor_Units VARCHAR(15) DEFAULT 'NotSet' NOT NULL,
>  Location VARCHAR(20),
>  Alarm LOGICAL DEFAULT False,
> PRIMARY KEY (Sensor_ID));
>
> Initially the default values for Time_Stamp and Alarm worked as expected
> but Sensor_Value and Sensor_Units inserted nothing at all.
>
> I changed the Sensor_ID's type from WORD to INTEGER and this column now
> inserts the default value. I changed the Sensor_Units' type to TEXT and
> it made no difference.
>
> Can anyone see why my default text value doesn't work?
>
> David Goadby
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to