Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 2:33 PM, Spora  wrote:

> it is too complicated for me
>

OK then, why don't you ".dump" into a file, then do a regular-expression
search and replace to quote all of the numbers.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Spora

it is too complicated for me

Richard Hipp ha scritto quanto segue il 31/05/2013 20.29>



On Fri, May 31, 2013 at 2:18 PM, Spora > wrote:

I need a scriptable solution.


Probably if you modify this line of code:

http://www.sqlite.org/src/artifact/46a1757c1?ln=395

so that the condition is always false and so that the else-clause is
always taken, then the ".dump" command will output everything as if it
were a string.  This should import fine into sqlite3.  Then from SQLite3
you can export to whatever you want.

--
D. Richard Hipp
d...@sqlite.org 



--
Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP 
autenticato? GRATIS solo con Email.it http://www.email.it/f

Sponsor:
Offerta speciale PEC per ditte individuali e liberi professionisti, sconto del 
20% se attivi ora!
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=12827=31-5
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 2:18 PM, Spora  wrote:

> I need a scriptable solution.
>

Probably if you modify this line of code:

http://www.sqlite.org/src/artifact/46a1757c1?ln=395

so that the condition is always false and so that the else-clause is always
taken, then the ".dump" command will output everything as if it were a
string.  This should import fine into sqlite3.  Then from SQLite3 you can
export to whatever you want.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Spora

I need a scriptable solution.

Michael Black ha scritto quanto segue il 31/05/2013 20.08>

So why don't you use SQLMaestro to import, then export it again.  I would
think that would quote it correctly.

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Spora
Sent: Friday, May 31, 2013 1:01 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] numeric string quotation db2 to db3

But i see that sqlMaestro is able to do it.
How can he do?







--
Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP 
autenticato? GRATIS solo con Email.it http://www.email.it/f

Sponsor:
PEC nel Registro delle Imprese entro il 30/6/2013, attivala ora e risparmi fino 
al 20%
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=12825=31-5
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Michael Black
So why don't you use SQLMaestro to import, then export it again.  I would
think that would quote it correctly.

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Spora
Sent: Friday, May 31, 2013 1:01 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] numeric string quotation db2 to db3

But i see that sqlMaestro is able to do it.
How can he do?



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


Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 2:01 PM, Spora  wrote:

> But i see that sqlMaestro is able to do it.
> How can he do?
>

I don't know.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Spora

But i see that sqlMaestro is able to do it.
How can he do?

Richard Hipp ha scritto quanto segue il 31/05/2013 19.44>



On Fri, May 31, 2013 at 1:32 PM, Spora > wrote:

I have sqlite2 table:


In sqlite2, everything is a string.  So there is no solution to your
problem there.  Please consider using sqlite3 instead.

SQLite3 came out in 2004.  The last release of sqlite2 was in 2005.  The
last update to the sqlite2 sources was in 2007.


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

when i .dump i obtain:

INSERT INTO test VALUES(01000);

but when i import in sqlite3, 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?

excuse previuos in MySql.


--
Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e
SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f

Sponsor:

Clicca qui:
http://adv.email.it/cgi-bin/__foclick.cgi?mid=12824=31-5

_
sqlite-users mailing list
sqlite-users@sqlite.org 
http://sqlite.org:8080/cgi-__bin/mailman/listinfo/sqlite-__users





--
D. Richard Hipp
d...@sqlite.org 



--
Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP 
autenticato? GRATIS solo con Email.it http://www.email.it/f

Sponsor:
Crea la tua PEC con sconti fino al 20%: 2GB di spazio, sms di notifica, 
archivio di sicurezza.
* Prova adesso!
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=12826=31-5
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 1:54 PM, Spora  wrote:

> I undstand, but now i have to import a large db2 in db3.
>


sqlite old.db .dump | sqlite3 new.db

The above will probably cause your '01000' to be convert to '1000'.  I
don't think that can be helped without hacking on the ".dump" code for
sqlite2.


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Spora

I undstand, but now i have to import a large db2 in db3.

Richard Hipp ha scritto quanto segue il 31/05/2013 19.44>



On Fri, May 31, 2013 at 1:32 PM, Spora > wrote:

I have sqlite2 table:


In sqlite2, everything is a string.  So there is no solution to your
problem there.  Please consider using sqlite3 instead.

SQLite3 came out in 2004.  The last release of sqlite2 was in 2005.  The
last update to the sqlite2 sources was in 2007.


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

when i .dump i obtain:

INSERT INTO test VALUES(01000);

but when i import in sqlite3, 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?

excuse previuos in MySql.


_
sqlite-users mailing list
sqlite-users@sqlite.org 
http://sqlite.org:8080/cgi-__bin/mailman/listinfo/sqlite-__users





--
D. Richard Hipp
d...@sqlite.org 



--
Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP 
autenticato? GRATIS solo con Email.it http://www.email.it/f

Sponsor:
Ami i PELUCHE? Acquistali online su MisterCupido.com! Tante offerte su: Disney, 
Simpson, Spongebob, Puffi, Sette Nani, Super Mario, Barbapapà, Teletubbies, 
Angry Birds, ecc
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=12384=31-5
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 1:32 PM, Spora  wrote:

> I have sqlite2 table:
>

In sqlite2, everything is a string.  So there is no solution to your
problem there.  Please consider using sqlite3 instead.

SQLite3 came out in 2004.  The last release of sqlite2 was in 2005.  The
last update to the sqlite2 sources was in 2007.



>
> CREATE TABLE test (
>   alfa char(5) NOT NULL default '',
> );
>
> when i .dump i obtain:
>
> INSERT INTO test VALUES(01000);
>
> but when i import in sqlite3, 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?
>
> excuse previuos in MySql.
>
>
> --
> Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP
> autenticato? GRATIS solo con Email.it http://www.email.it/f
>
> Sponsor:
>
> Clicca qui: 
> http://adv.email.it/cgi-bin/**foclick.cgi?mid=12824=31-5
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] numeric string quotation

2013-05-31 Thread Michael Black
I think you showed us the insert you do and not the .dump result.
You need to ensure your inserted values are single-quoted.

sqlite> create table test(alfa char(5) not null default '');
sqlite> insert into test values(01000);
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE seqnumber(stepid);
INSERT INTO "seqnumber" VALUES(5);
CREATE TABLE test(alfa char(5) not null default '');
INSERT INTO "test" VALUES('1000');
COMMIT;
sqlite> insert into test values('01000');
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE seqnumber(stepid);
INSERT INTO "seqnumber" VALUES(5);
CREATE TABLE test(alfa char(5) not null default '');
INSERT INTO "test" VALUES('1000');
INSERT INTO "test" VALUES('01000');
COMMIT;

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Spora
Sent: Friday, May 31, 2013 11:52 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] numeric string quotation

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?
 
 
 --
 Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP
autenticato? GRATIS solo con Email.it http://www.email.it/f
 
 Sponsor:
 Ami l'arte e vuoi arredare casa con stile? Su MisterCupido.com puoi
acquistare le RIPRODUZIONI DEI QUADRI di: Van Gogh, Monet, Klimt,
Modigliani, Cezanne, Hayez, Michelangelo, Raffaello, ecc
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=12386=31-5
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


[sqlite] numeric string quotation db2 to db3

2013-05-31 Thread Spora

I have sqlite2 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 sqlite3, 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?

excuse previuos in MySql.


--
Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP 
autenticato? GRATIS solo con Email.it http://www.email.it/f

Sponsor:

Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=12824=31-5
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] numeric string quotation

2013-05-31 Thread Larry Brasfield

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


Re: [sqlite] numeric string quotation

2013-05-31 Thread Richard Hipp
On Fri, May 31, 2013 at 12:52 PM, Spora  wrote:

> I have table:
>
> CREATE TABLE test (
>   alfa char(5) NOT NULL default '',
> );
>
> when i .dump i obtain:
>
> INSERT INTO test VALUES(01000);
>

I get

INSERT INTO text VALUES('01000');

I tried this with older versions of SQLite too, going back to 3.3.5 circa
2006.  So I don't know how you are getting the results you are reporting.
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] numeric string quotation

2013-05-31 Thread Spora

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?


--
Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP 
autenticato? GRATIS solo con Email.it http://www.email.it/f

Sponsor:
Ami l'arte e vuoi arredare casa con stile? Su MisterCupido.com puoi acquistare 
le RIPRODUZIONI DEI QUADRI di: Van Gogh, Monet, Klimt, Modigliani, Cezanne, 
Hayez, Michelangelo, Raffaello, ecc
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=12386=31-5
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users