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 table1 rename to table2
>
>but, although it works fine on sqlite3, it doesn't work on sqlite
>
>Can anyone confirm that table renaming isn't supported in sqlite first
>version?
>Moreover, if so, is there another way to do it?
>
>Thanks and regards
>
>Valerio Bontempi

If the name of your table plus a leading and trailing space
doesn't exist anywhere in your data, you could do :

Windows:
sqlite old_db .dump |
awk "{sub(/ oldtable /,\" newtable \");print}" |
sqlite new_db

Unix:
sqlite old_db .dump |
awk '{sub(/ oldtable /," newtable ");print}' |
sqlite new_db

(all on one line, but I added linefeeds after every pipe
character for clarity)

Untested, parenthesis in positions where i assume spaces might
cause some problems, but you get the idea.

HTH
-- 
  (  Kees Nuyt
  )
c[_]

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to