realbasic-nug
[Top] [All Lists]

Re: RealSQL questions

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: RealSQL questions
From: Norman Palardy <npalardy at great-white-software dot com>
Date: Mon, 31 Oct 2005 09:52:31 -0700
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <710A36BF-C552-4FAC-ABAD-5A93AC2B0932 at wanadoo dot fr>

On Oct 31, 2005, at 5:31 AM, Tehenne wrote:

Hello

First question  :
Is it possible to rename a column in a table ?
If yes, how?

 A long an involved process (and only some of it possible in the IDE)

Make a new table that has the same columns as the existing one with the column you want renamed omitted and replaced by the new name
        Insert all the data to it by
insert into newTable (columns list ) values ( select .... from oldTable )

where the select lists the old columns in the order they are in the new table list

        Drop the original (old) table

        rename the new table
                
                        alter table newTableName Rename To OldTableName

        vacuum

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>