Re: [sqlite] replacing a table

2010-06-27 Thread Igor Tandetnik
Sam Carleton wrote: > In other databases there have been times when I have played some tricks with > the master tables, an example is: > > Goal: change some fundamental characteristics of 'target_table' which cannot > be done by an ALTER > > 1: Create the new table with a different name: target_

Re: [sqlite] replacing a table

2010-06-27 Thread Jay A. Kreibich
On Sun, Jun 27, 2010 at 07:41:48PM -0400, Sam Carleton scratched on the wall: > 1: Create the new table with a different name: target_table2 with the changes > 2: Do an insert/select to insert the contents of target_table into > target_table2 > 3: Drop target_table > 4: Modify the master table to

[sqlite] replacing a table

2010-06-27 Thread Sam Carleton
In other databases there have been times when I have played some tricks with the master tables, an example is: Goal: change some fundamental characteristics of 'target_table' which cannot be done by an ALTER 1: Create the new table with a different name: target_table2 with the changes 2: Do an in

Re: [sqlite] Replacing a table

2009-10-15 Thread P Kishor
atabase" > Cc: "Kelvin Xu" > Sent: Thursday, October 15, 2009 10:28:23 AM GMT -06:00 US/Canada Central > Subject: Re: [sqlite] Replacing a table > > I guess you didn't work with SQL anywhere in your developer life, > right? Read some books or internet pages

Re: [sqlite] Replacing a table

2009-10-15 Thread Gerry Snyder
Pavel Ivanov wrote: > > > To update column in all rows of the table you need to issue the > following statement: > > UPDATE table_name SET column_name = value > And note that the "value" above does not have to be a constant. It can, for instance, depend on other values in the row being up

Re: [sqlite] Replacing a table

2009-10-15 Thread Kavita Raghunathan
uot;General Discussion of SQLite Database" Cc: "Kelvin Xu" Sent: Thursday, October 15, 2009 10:28:23 AM GMT -06:00 US/Canada Central Subject: Re: [sqlite] Replacing a table I guess you didn't work with SQL anywhere in your developer life, right? Read some books or internet

Re: [sqlite] Replacing a table

2009-10-15 Thread Pavel Ivanov
en O'Neill" > To: "General Discussion of SQLite Database" > Sent: Thursday, October 15, 2009 9:59:32 AM GMT -06:00 US/Canada Central > Subject: Re: [sqlite] Replacing a table > > > Run the sql > 'delete from "tablename";' > > if t

Re: [sqlite] Replacing a table

2009-10-15 Thread O'Neill, Owen
-boun...@sqlite.org] On Behalf Of Kavita Raghunathan Sent: Thursday, October 15, 2009 4:22 PM To: General Discussion of SQLite Database Cc: Kelvin Xu Subject: Re: [sqlite] Replacing a table Thanks Pavel and Owen. This is very useful information. Also how can we change a whole column at a time ? In oth

Re: [sqlite] Replacing a table

2009-10-15 Thread Kavita Raghunathan
- Original Message - From: "Owen O'Neill" To: "General Discussion of SQLite Database" Sent: Thursday, October 15, 2009 9:59:32 AM GMT -06:00 US/Canada Central Subject: Re: [sqlite] Replacing a table Run the sql 'delete from "tablename";' if the ta

Re: [sqlite] Replacing a table

2009-10-15 Thread O'Neill, Owen
, 2009 3:51 PM To: General Discussion of SQLite Database Cc: Kelvin Xu Subject: [sqlite] Replacing a table Hi, Is there a way to use the sqlite wrappers to "replace" or delete a table completely ? (without looping through and deleting each row and column) The number of columns and rows of t

Re: [sqlite] Replacing a table

2009-10-15 Thread Pavel Ivanov
> Is there a quick way to do that? DROP TABLE table1; ALTER TABLE table2 RENAME TO table1; And doesn't matter how many rows and columns have each of the tables. Hope I've understood your question correctly. Pavel On Thu, Oct 15, 2009 at 10:51 AM, Kavita Raghunathan wrote: > Hi, > > Is there a

[sqlite] Replacing a table

2009-10-15 Thread Kavita Raghunathan
Hi, Is there a way to use the sqlite wrappers to "replace" or delete a table completely ? (without looping through and deleting each row and column) The number of columns and rows of the new table is identical to the number of columns and rows of the old table being replaced. Is there a quick wa