Skip to Content

Change DB field length

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 25 at 07:23 AM
    "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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • Apr 24 at 06:56 PM

    Hi Oliver,

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

    Regards,

    Add comment
    10|10000 characters needed characters exceeded

    • 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...