Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rename table command problem
Message
From
22/10/2001 02:04:08
 
 
To
22/10/2001 01:04:23
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00571539
Message ID:
00571545
Views:
30
Hi!

In the help file for RENAME command:

>>>>>>>
Do not use RENAME to change the name of a table in a database; RENAME does not change the name of the table in the database. Use RENAME TABLE to change the name of a table in a database.
>>>>>>

Because RENAME TABLE just change the name of the table in the database container, you require to do this anotehr way. 2 suggestions:

1. Use your 3-d approachm but after renaming both file and table name in the database, use VALIDATE DATABASE command and see if it will map tables correctly automatically (just by the name).

2. Copy structure Extended, then create similar table with another name in the database, copy data by COPY command, then delete old table. I know this could be slow, but I guess you do not going to do such things every day in production database...

HTH.

>It is not problem to rename table in the database designer.
>I needed to rename big numbers of tables due to some criteria.
>So I tryed to do this by code, not in the database designer
>First I did
>1 rename table oldtable to newtable
>The result was name was changed only in the database, but file name was old
>
>2 rename table oldtable to newtable
> rename oldtable.dbf to newtable.dbf
>rename oldtable.cdx to newtable.cdx
>I changed files names, but attempt to modify table in the designer gave error , it is not possible to find table at the path, locate or delete
>
>3 rename oldtable.dbf to newtable.dbf
>rename oldtable.cdx to newtable.cdx
>rename table oldtable to newtable
>It also did not give good result.
>What code lines do emulate changing table in the database designer
>Thanks in advance, Vladimir.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform