Isaac Raway uttered:

Thank, I will look at that (away from my dev machine for the day).

One other related question, are there plans to expand the functionality of
ALTER TABLE? I am working on a feature that could benefit greatly from
REMOVE/RENAME COLUMN. As it stands, I am going to have to simulate this by
using generic column names and mapping them to a list of the "actual" names.
It would be *very* nice to see these features added to sqlite before I
finish this feature, but I imagine this has been requested before...


A better solution would be to transfer the contents of the table being updated to a temporary table, then recreate the original tables sans the surplus columnn:

  BEGIN;
  CREATE TABLE temp_topic AS SELECT <fields> FROM topic;
  DROP TABLE topic;
  CREATE TABLE topic ...;
  INSERT INTO topic SELECT * FROM temp_topic;
  DROP TABLE temp_topic;
  COMMIT;

It may not be quick for large tables, but how often are you going to be updating the table definition? If often, then you probably have a more fundamental problem on your hands.

If your data format is by definition user defined, then you might be best off with an <instance,name,value> table instead, and use views to map instances into a virtual table.



Isaac



Christian



On 10/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

"Isaac Raway" <[EMAIL PROTECTED]> wrote:
>
> ALTER TABLE topic ADD COLUMN type_id integer;
>
> This works fine when I run it on the sqlite3 command line, but fails in
the
> Delphi units. Any thoughts? Has anyone ahd trouble running ALTER TABLE
from
> the Delphi bindings?
>

Perhaps the delphi code is statically linked against an
older version of SQLite.  ADD COLUMN was added in version
3.2.0.  You can find what version delphi uses by executing

   SELECT sqlite_version();

--
D. Richard Hipp  <[EMAIL PROTECTED]>




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


-----------------------------------------------------------------------------






--
    /"\
    \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
     X                           - AGAINST MS ATTACHMENTS
    / \

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

Reply via email to