Re: [sqlite] Inserting from other table

2010-04-27 Thread Simon Davies
On 26 April 2010 18:30, sabapathy wrote: > > Yes currently it depends on the order. Should be checking if it can be > avoided. > > The issue has been resolved by the method you've suggested (INSERT INTO > new_table (col_1, col_3) > SELECT col_1, col_2 FROM old_table;) > > Thanks to everyone!! > >

Re: [sqlite] Inserting from other table

2010-04-26 Thread sabapathy
Yes currently it depends on the order. Should be checking if it can be avoided. The issue has been resolved by the method you've suggested (INSERT INTO new_table (col_1, col_3) SELECT col_1, col_2 FROM old_table;) Thanks to everyone!! I am looking for how to get total no.of columns even if the

Re: [sqlite] Inserting from other table

2010-04-19 Thread Simon Slavin
On 19 Apr 2010, at 6:47pm, sabapathy wrote: > Can I provide mapping of columns to insert from one table to another? > (For eg, if the old table has 2 columns & new one 3 columns, I want to > insert 1st column to 1st column, 2nd to 3rd and leave 2nd column empty in > new table) You might be able

Re: [sqlite] Inserting from other table

2010-04-19 Thread P Kishor
On Mon, Apr 19, 2010 at 1:00 PM, Pavel Ivanov wrote: >> In other words, unless it grossly and severely bothers your >> sensibilities, don't waste your time on this exercise. > > AND unless application developer for some weird reason used '*' in > select statements. > > In other words, don't use S

Re: [sqlite] Inserting from other table

2010-04-19 Thread Pavel Ivanov
> In other words, unless it grossly and severely bothers your > sensibilities, don't waste your time on this exercise. AND unless application developer for some weird reason used '*' in select statements. Pavel On Mon, Apr 19, 2010 at 1:56 PM, P Kishor wrote: > On Mon, Apr 19, 2010 at 12:47 PM

Re: [sqlite] Inserting from other table

2010-04-19 Thread P Kishor
On Mon, Apr 19, 2010 at 12:47 PM, sabapathy wrote: > > The DB had some 15 columns before. > And there are lot of records saved using the s/w tool. > But in the latest version of tool there are some columns added in DB > inbetween of existing columns. > So to use the DB saved using previous version

Re: [sqlite] Inserting from other table

2010-04-19 Thread Pavel Ivanov
> But I came to know that new columns can be added only at the end. > So I have to create an empty table in new format and insert the records from > old table & delete the old table(?). Are you sure that your software tool depends on the order of columns in the database? Even if new version create

[sqlite] Inserting from other table

2010-04-19 Thread sabapathy
The DB had some 15 columns before. And there are lot of records saved using the s/w tool. But in the latest version of tool there are some columns added in DB inbetween of existing columns. So to use the DB saved using previous version of tool, I need to add some columns(blank) in between in the