--- In [email protected], "Johannes Nel" <[EMAIL PROTECTED]> 

The confusion here is due to the affinities that you have selected.
When the AIR embedded db cannot find the affinity specified it
defaults to NUMERIC.  There is no affinity called "timestamp" (or
"bigint" for that matter) and you are left with a NUMERIC affinity. 
In this case the string value of "2008-08..." is being inserted into a
field in which a NUMERIC value is expected.  The embedded db in the
AIR runtime makes an attempt to convert that string into the desired
value, however, a conversion isn't possible, and the result is the
error you see.  Why does this work in SQLite? In the SQLite db
affinities are not enforced, so when the attempt to convert fails the
string value is inserted as is.

If you change the affinity specified here to DATE you will get what
you expect, and additionally, when you select the value back out you
will get an AS3 Date object. 

jw

wrote:
>
> Hi All
> I have a sql statement which runs sans any issues in my sqlite
viewer, but
> when executed from within air it gives me the error
> SQLError: 'Error #3132: Data type mismatch.', details:'could not convert
> text value to numeric value.'
> this is the table schema
> CREATE TABLE category (
>     id bigint NOT NULL,
>     "version" integer NOT NULL,
>     name character varying(255),
>     ordering integer NOT NULL,
>     "external" boolean NOT NULL,
>     createddate timestamp without time zone,
>     modifieddate timestamp without time zone,
>     createdby_id bigint,
>     modifiedby_id bigint
> );
> and here is the sql statement
> insert into category(id, version, name, ordering, external, createddate,
> modifieddate, createdby_id, modifiedby_id) values
> (477,14,'Leads',0,'false',NULL,'2008-08-19 16:46:54.26',NULL,1109);
> 
> any ideas?
> i find it really weird that this works on a SQLite level, but not
from AS.
> 
> johan
> 
> 
> -- 
> j:pn
> \\no comment
>


Reply via email to