Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming a field at runtime

Status
Not open for further replies.

EricDraven

Programmer
Jan 17, 2002
2,999
GB
Is there anyway a field in a table can be renamed while the application is running? I need to change the name of a field in a DBase table as it is currently called Lookup and wont allow me to create an index on it. Arte Et Labore
 
Haven't used DBase but don't think you can rename a field.

I think you need to create a new table exactly the same as the current table but with the renamed field then do something like:

insert into newtable (field1, field2 etc)
select field1, field2 from oldtable

Make sure you get the same order of fields in the insert and the select so they are mapped correctly.

Then drop the old table once you're happy with the data in the new table.

lou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top