Re: [sqlite] Sqlite Rename table

2007-11-07 Thread Valerio Bontempi
Hi All, about renaming table in sqlite (not sqlite3) we can use this sql 'SELECT sql,name,type FROM sqlite_master WHERE tbl_name = 'table' ORDER BY type DESC;' to create a new table like the first one, and then use insert into new table from select * from the previous one. By this way we can keep

Re: [sqlite] Sqlite Rename table

2007-11-06 Thread Valerio Bontempi
Hi Kees, thanks for your solution, it is a very interesting solution. But I need to rename a table using sql from php. (this is also the reason for my need of sqlite and not sqlite3, not supported yet by php) Thanks a lot Valerio 2007/11/5, Kees Nuyt [EMAIL PROTECTED]: Hi Valerio, On Mon,

Re: [sqlite] Sqlite Rename table

2007-11-06 Thread P Kishor
On 11/6/07, Valerio Bontempi [EMAIL PROTECTED] wrote: Hi Kees, thanks for your solution, it is a very interesting solution. But I need to rename a table using sql from php. (this is also the reason for my need of sqlite and not sqlite3, not supported yet by php) Thanks a lot Valerio

Re: [sqlite] Sqlite Rename table

2007-11-06 Thread John Stanton
Sqlite3 is supported by PHP using PDO. Valerio Bontempi wrote: Hi Kees, thanks for your solution, it is a very interesting solution. But I need to rename a table using sql from php. (this is also the reason for my need of sqlite and not sqlite3, not supported yet by php) Thanks a lot Valerio

Re: [sqlite] Sqlite Rename table

2007-11-06 Thread Valerio Bontempi
@ Kishor: thank you for the idea: although it wasn't perfectly what I needed (I have to write a generic method to rename a table, so I don't know the structure of the table before) it took me the right idea and lastly I used the following sql: create table new as select * from old It still

[sqlite] Sqlite Rename table

2007-11-05 Thread Valerio Bontempi
Hi All, I'm new in your mailing list. I need to use sqlite and not sqlite3 because of php still support only the first version. I read that sqlite3 support table renaming with common sql syntax alter table table1 rename to table2 but, although it works fine on sqlite3, it doesn't work on sqlite

Re: [sqlite] Sqlite Rename table

2007-11-05 Thread Kees Nuyt
Hi Valerio, On Mon, 5 Nov 2007 18:51:20 +0100, Valerio Bontempi [EMAIL PROTECTED] wrote: Hi All, I'm new in your mailing list. I need to use sqlite and not sqlite3 because of php still support only the first version. I read that sqlite3 support table renaming with common sql syntax alter table