Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table entry becomes null when field name is updated using database utility

Former Member
0 Likes
1,416

Hello,

I created a table in se11. I added entries to the table but after some time i changed a field name. So to activate the table i go to database utility and activate it with option persist data.

But strangely the data in the field becomes null after the change.

The table fields are provided in below screenshot

I make the changes to the field emp_address to EMP_ADDRESS1. The new output from se16 is below.

Can anyone tell why this is happening?

1 ACCEPTED SOLUTION
Read only

Former Member
1,242

Strange ? No I don't think so. You removed EMP_ADDRESS and added EMP_ADDRESS1. The DB Utility recognises fields by name when saving data, not by position so since EMP_ADDRESS1 is not the same as EMP_ADDRESS your data was not preserved.

Rich

6 REPLIES 6
Read only

Former Member
1,243

Strange ? No I don't think so. You removed EMP_ADDRESS and added EMP_ADDRESS1. The DB Utility recognises fields by name when saving data, not by position so since EMP_ADDRESS1 is not the same as EMP_ADDRESS your data was not preserved.

Rich

Read only

1,242
  • @joby chacko i.e. your data is now lost forever.
  • So to rename a column emp_address to emp_address1, you should:
  • 1) add a new column emp_address1 and keep the old one (emp_address)
  • 2) activate the table
  • 3) Via any SQL editor, do : "update ZYOURTABLE set emp_address1 = emp_address"
  • 4) delete the column emp_address
  • 5) activate the table via the database utility.
Read only

Former Member
0 Likes
1,242

thanks Richard.

So it is an expected behaviour.

Is there a way to keep the data as it is and change the column name?

Read only

1,242

Richard gives you the correct answer ==> you should have choose his answer as the best answer

Read only

0 Likes
1,242

I second Chaouki Akir !

Read only

1,242

sandra.rossi Thank you. I understood it now.