Application Development 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: 

Change DB field length

oliver_am
Active Participant

Hi all,

We hace a custom table with a field type CHAR 1.

The domain of this field has values from 1 to 9.

Now we need to add a new value.

So we have to options:

- Use a letter; A, B... The easiest option. But visually... its strange to see numbers and then a letter...

- Increase the length.

---

I've tried to increase the lenght with a test table changing the CHAR by NUMC 2 and Alpha in the domain and the data was converted well.

---

The problem is that the real table has millons of entries.

It's not a key field but it has secondary indexes with this field and this field is used in a lot of programs, classes, etc

We have also archived data of this table.

---

The question is: Do you recommend to increase the lenght? Or use a letter instead?

We have constants created in one class with all the values and we always (I guess) use this constants to compare in the programs. So changing the value of this constants this is not a problem.

Thanks in advance.

1 ACCEPTED SOLUTION

rajkumarnarasimman
Active Contributor
0 Kudos
"Do you recommend to increase the lenght? Or use a letter instead?

If the category is less, proceed by using Letters itself(A-Z) and maintain the relevant description in Domain Value.

If the category is more than 26, then try to increase the domain length from 1 to 2. By increasing the field length, data loss won't occur and since it holds more records and secondary index, move the transport after business hours.

4 REPLIES 4

roberto_forti
Contributor

Hi Oliver,

After changing the corresponding table is recommended transaction SE14 - Utility for database tables as attached print.

Regards,

0 Kudos

Hi, Roberto. Yes I know that.

I'm only worried for the big amount of data we have in this table, and the secondary indexes, the archived data, etc...

rajkumarnarasimman
Active Contributor
0 Kudos
"Do you recommend to increase the lenght? Or use a letter instead?

If the category is less, proceed by using Letters itself(A-Z) and maintain the relevant description in Domain Value.

If the category is more than 26, then try to increase the domain length from 1 to 2. By increasing the field length, data loss won't occur and since it holds more records and secondary index, move the transport after business hours.

0 Kudos

The reason why using a letter instead, if you can, is that changing the domain will affect all tables that use that domain, so that when you transport, they'll all have to be regenerated. Changing domains should only ever be done as a last resort.