Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 11 total
Thread Renaming field in existing table
Thu, May 24 2007 2:34 PMPermanent Link

"Royke"
I don't think this is possible using the EDBManager. We are converting a BDE
application to use EDB, and I am taking the opportunity to make some field
names more comprehensible. But after creating the new database, copying all
data from the BDE version into the EDB version, and only then discovering
that I wanted to change one more field name .. Redo the whole process, or
write some one-off code that adds a field under the new name, copy the data
across from the field with the old name. A hassle.

Is there an easier way to change a field name? (As in the Database Desktop.)

RoyJ

Fri, May 25 2007 3:27 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Royke


DROP and ADD. EDBMan should take care of the data (but back up first anyway).

Roy Lambert
Fri, May 25 2007 10:03 AMPermanent Link

"Royke"
"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
news:41080227-0F3D-4181-A81E-786B20E113F5@news.elevatesoft.com...
> Royke
>
>
> DROP and ADD. EDBMan should take care of the data (but back up first
> anyway).
>
> Roy Lambert

That would surprise me a bit. So, I DROP a field 'aaa', then ADD a new field
'bbb', How does EDNMan know that the original 'aaa' data should go into the
new 'bbb' field?

RoyJ

Fri, May 25 2007 10:51 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Royke


>That would surprise me a bit. So, I DROP a field 'aaa', then ADD a new field
>'bbb', How does EDNMan know that the original 'aaa' data should go into the
>new 'bbb' field?

No idea - ask Tim he's the one who told me Smiley

Roy Lambert
Fri, May 25 2007 12:46 PMPermanent Link

Bill Mullen
You will have to execute each statement one at a time.

ALTER TABLE "tablename"
Add Column NewColumn VarChar(15);

update table "tablename"
set NewColumn = OldColumn;

ALTER TABLE "tablename"
drop column OldColumn;


>I don't think this is possible using the EDBManager. We are converting a BDE
>application to use EDB, and I am taking the opportunity to make some field
>names more comprehensible. But after creating the new database, copying all
>data from the BDE version into the EDB version, and only then discovering
>that I wanted to change one more field name .. Redo the whole process, or
>write some one-off code that adds a field under the new name, copy the data
>across from the field with the old name. A hassle.
>
>Is there an easier way to change a field name? (As in the Database Desktop.)
>
>RoyJ
>
Fri, May 25 2007 1:46 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Bill


You're right, but I do remember Tim posting to the effect that EDBMan would be altered to sort it out. I know its a problem with RI, functions, procedures, views etc but I do hope he does something. Its a VERY handy feature and will be hard to live without.


Roy Lambert
Fri, May 25 2007 2:08 PMPermanent Link

Bill Mullen
No doubt that a simple alter table command that allowed a column to be
renames wouldn't be better, but the OP needs a solution nowSmiley  

>Bill
>
>
>You're right, but I do remember Tim posting to the effect that EDBMan would be altered to sort it out. I know its a problem with RI, functions, procedures, views etc but I do hope he does something. Its a VERY handy feature and will be hard to live without.
>
>
>Roy Lambert
Fri, May 25 2007 2:11 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Bill


Dead right - but every opportunity to remind Tim of useful features like that which are currently missing should be taken <vbg>

Roy Lambert
Fri, May 25 2007 6:08 PMPermanent Link

"Royke"
True. For now this helps me out.

RoyJ


"Bill Mullen" <noprivateemail@domain.com> wrote in message
news:qu8e539cnlc9vj34qve17gggm1qu1fukc7@4ax.com...
> No doubt that a simple alter table command that allowed a column to be
> renames wouldn't be better, but the OP needs a solution nowSmiley
>
>>Bill
>>
>>
>>You're right, but I do remember Tim posting to the effect that EDBMan
>>would be altered to sort it out. I know its a problem with RI, functions,
>>procedures, views etc but I do hope he does something. Its a VERY handy
>>feature and will be hard to live without.
>>
>>
>>Roy Lambert

Sat, May 26 2007 6:37 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< DROP and ADD. EDBMan should take care of the data (but back up first
anyway).>>

That's only if you're altering something about the column besides the name,
like the type.  Changing the name causes EDB to treat the column like a
brand new column.

--
Tim Young
Elevate Software
www.elevatesoft.com

Page 1 of 2Next Page »
Jump to Page:  1 2
Image