Thanks Razzak and Bill
I think I like this method better, I was going to
Rename the table
Create the correct table structure
Insert form old table to the new one using the correct columns...
Thanks again
Marc
--------------------------------------------------
From: "A. Razzak Memon" <[email protected]>
Sent: Tuesday, April 06, 2010 11:33 AM
To: "RBASE-L Mailing List" <[email protected]>
Subject: [RBASE-L] - Re: Insert column
At 12:12 PM 4/6/2010, Marc Schluter wrote:
I think the answer is No but I will ask anyway.
I want to insert 3 columns to the middle of a Table using a command file.
I have Col1, Col2, Col3, Col4, Col5 and I want to insert ColA, ColB, ColC
like this.
Col1, Col2 ,ColA, ColB, ColC , Col3, Col4, Col5
Is that possible?
Marc,
If you are working on an independent table (No Referenced tables),
try the following technique.
Here;s how:
-- Start here ...
PROJECT TEMPORARY tTableName FROM OriginalTableName USING ALL
ALTER TABLE tTableName ADD COLUMN <NewColumn1 definition>
ALTER TABLE tTableName ADD COLUMN <NewColumn2 definition>
ALTER TABLE tTableName ADD COLUMN <NewColumn3 definition>
DROP TABLE OriginalTableName
PROJECT OriginalTableName FROM tTableName USING +
OriginalColumn1, +
OriginalColumn2, +
OriginalColumn3, +
NewColumn1, +
OriginalColumn4, +
NewColumn2, +
OriginalColumn5, +
NewColumn3, +
OriginalColumn6
DROP TABLE tTableName
-- End here ...
-- Start here ...
Notes:
01. Make a backup of the original database
02. After completing the steps above, make sure to either RELOAD
or Re-Build the database.
Remember, nothing is impossible!
Very Best R:egards,
Razzak.