SQLite does have an ALTER TABLE command.  You can use it to rename a table or 
add a column but that's all.  I've used the same technique as Bob to get the 
CREATE command for a table and I believe that the sql syntax is updated by an 
ALTER command, not a second entry created.  I use the SQLite admin plugin for 
Firefox do other types of table structure changes and it does indeed unload the 
table, delete it, then load it again and it seem to recreate any 
indexes/triggers associated with the table.  The CREATE syntax in th mastr 
table is recreated automatically since the table is re-created.

Pete Haworth

On Jan 6, 2011, at 11:29 AM, Ruslan Zasukhin wrote:

> On 1/6/11 9:22 PM, "Bob Sneidar" <b...@twft.com> wrote:
> 
>> Are you saying that an Alter Table command will create a second record with
>> the alter table syntax in it? I didn't know that.
> 
> Actually as I know, Sqlite have no normal ALTER Table
> 
>> It throws a bit of a wrench
>> in my works, but then again the best practices for sqLite table mods is to
>> create a new table with the new structure from scratch and port the old data
>> in from the old table.
> 
> This is "best" practice, because no ALTER.
> 
> And our guys have spend days to workaround this behind the scene.
> Yes, they do create new table, copy records, trash old ...
> 
>> There are a lot of things you cannot do with Alter
>> Table in sqLite, as was discussed in another thread, so maybe this is a
>> non-starter anyway.
> 
> right
> 
>> Bob
>> 
>> 
>> On Jan 6, 2011, at 11:11 AM, Ruslan Zasukhin wrote:
>> 
>>>> This will give me all the Create Table syntax for every table in the sqLite
>>>> database I access.
>>> 
>>> I see, Bob,
>>> 
>>> You are using sqlite_master  system table to extract original
>>>   create table ... command
>>> 
>>> Interesting, if this is changed on any ALTERs ...
>>> Although it seems there is no alters ...
> 
> -- 
> Best regards,
> 
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
> 
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
> 
> [I feel the need: the need for speed]
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to