Re: [sqlite] Different ROWID and PRIMARY KEY values

2007-03-12 Thread drh
Gerry Snyder <[EMAIL PROTECTED]> wrote: > [T]here must be a good reason why the > constraints are not copied, but I have not seen an explanation. > The statement is of the form: CREATE TABLE AS Where would the constraints come from? If the arbitrary select statement were of the form:

Re: [sqlite] Different ROWID and PRIMARY KEY values

2007-03-12 Thread Gerry Snyder
Luca Moratto wrote: I already created all the indexes after table creation, but I believed that the constraint of primary key came copied also by "create table ... as ...)... Glad everything is working now. SQLite is so well designed that there must be a good reason why the constraints

Re: [sqlite] Different ROWID and PRIMARY KEY values

2007-03-12 Thread Luca Moratto
Gerry Snyder ha scritto: Luca Moratto wrote: Thanks Gerry, but I can Create my table in memory from an attached db, I can Insert new rows and I can Select the new rows and all values are correct, except for my key field that is 0. My Insert statement is INSERT INTO myTable VALUES (?,?,?); I

Re: [sqlite] Different ROWID and PRIMARY KEY values

2007-03-09 Thread Gerry Snyder
Luca Moratto wrote: Thanks Gerry, but I can Create my table in memory from an attached db, I can Insert new rows and I can Select the new rows and all values are correct, except for my key field that is 0. My Insert statement is INSERT INTO myTable VALUES (?,?,?); I prepare this statement wi

Re: [sqlite] Different ROWID and PRIMARY KEY values

2007-03-08 Thread Luca Moratto
Thanks Gerry, but I can Create my table in memory from an attached db, I can Insert new rows and I can Select the new rows and all values are correct, except for my key field that is 0. My Insert statement is INSERT INTO myTable VALUES (?,?,?); I prepare this statement with sqlite3_prepare I

Re: [sqlite] Different ROWID and PRIMARY KEY values

2007-03-08 Thread Gerry Snyder
Luca Moratto wrote: Hi, I'm using c++ interface for SQLite 3.3.8. 1) I open a db in memory, 2) attach a file with one table with a INTEGER PRIMARY KEY (ATTACH DATABASE 'SQliteFile.s3db' AS 'attachedDb'), 3) copy in memory the tble from attached db table (CREATE TABLE 'myTable' AS SELECT * FRO

[sqlite] Different ROWID and PRIMARY KEY values

2007-03-08 Thread Luca Moratto
Hi, I'm using c++ interface for SQLite 3.3.8. 1) I open a db in memory, 2) attach a file with one table with a INTEGER PRIMARY KEY (ATTACH DATABASE 'SQliteFile.s3db' AS 'attachedDb'), 3) copy in memory the tble from attached db table (CREATE TABLE 'myTable' AS SELECT * FROM 'attachedDb.myTable