note 44297 added to ref.sqlite

From: Date: Tue, 20 Jul 2004 18:50:11 +0000
Subject: note 44297 added to ref.sqlite
Groups: php.notes 
Request: Send a blank email to php-notes+get-73729@lists.php.net to get a copy of this message
Since SQLite doesn't support ALTER TABLE statements or renaming tables, modifying an existing table is a bit cumbersome. You have to: 1. create a temporary table 2. copy the original table into the temporary table 3. delete the original 4. recreate the original with new column definitions 5. copy the contents back 6. delete the temporary table As this is rather unwieldy, I've created a wrapper class that allows for ALTER TABLE queries and does the dirty work for you. It has integrated error handling to ensure that queries are completely valid and it allows for complex statements such as: ALTER TABLE foo ADD bar VARCHAR(27), DROP bar2, CHANGE bar3 foobar INTEGER, ADD bar4 DATE Documentation: http://code.jenseng.com/db/ Source: http://code.jenseng.com/db/sql.txt ---- Manual Page -- http://www.php.net/manual/en/ref.sqlite.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44297 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44297&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44297&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#73729) next »