I have table:

CREATE TABLE test (
   alfa char(5) NOT NULL default '',
);

when i .dump i obtain:

INSERT INTO test VALUES(01000);

but when i import in Mysql, i obtain

test = '1000'
and not
test = '01000'

because .dump create:
INSERT INTO test VALUES(01000);
and not:
INSERT INTO test VALUES('01000');

how to solve?

Why are you asking about an issue with Mysql in a SQLite list?

Assuming this (almost) happened with SQLite, (and assuming there was not really a trailing comma on the last column spec in the create statement), the literal in your insert statement becomes the same integer during parsing whether there is a leading '0' or not. It is at execution time that the column type affinity causes that (same) integer to become a character sequence.

While it is unclear what problem you intend to solve, if you wish to insert the string literal '01000', write it as a string literal in your insert statement.

--
Larry Brasfield

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to