Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Manually renaming a table?
Thu, Feb 19 2009 1:44 PMPermanent Link

"Hedley Muscroft"
Hi,

End-users need to have the ability to rename tables. I know that Tim is
working hard on 2.03 which may include this feature but I'm just wondering
if there's a workaround at present?

I tried renaming all the .EDBTbl .EDBIdx (etc) files but obviously the table
schema is stored in the catalog file, so renaming those files to the new
name just caused EDB to re-create empty table files. Is there a quick and
easy way to update the catalog so this can be accomplished?

For example, say I have a table called "oldtable" and I want to rename it to
"newtable".

Can I just rename the files (oldtable.*) to newtable.* in the database
folder, and then do something like :-

----------------
create table "newtable" (like "oldtable");
drop table "oldtable";
----------------

Hmmm... even as I'm typing this, I am skeptical about it working - I seem to
remember reading that CREATE TABLE ... LIKE... doesn't re-create indexes or
constraints etc...

Any ideas / alternatives would much appreciated!
Thu, Feb 19 2009 4:19 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Hedley,

<< End-users need to have the ability to rename tables. I know that Tim is
working hard on 2.03 which may include this feature but I'm just wondering
if there's a workaround at present? >>

Short answer - no.   There is information in both the catalog and the table
files that links them together so as to prevent the wrong table files from
being used with a given database catalog.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Feb 20 2009 3:10 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Hedley

Also, to add a bit more to Tim's answer, even if that worked CREATE LIKE, as yet, doesn't create some of the necessary stuff like triggers etc


Roy Lambert [Team Elevate]
Image