Db2 Tools

 View Only
  • 1.  RC/Migrator for DB2

    Posted May 22, 2020 08:33 AM
    ​Hello,

    I'm adding a new column(NEWCOL) to a table via RC/M Strategy Services. Is it possible to assign the value from an existing column(EXCOL) to this new column?
    In other words, NEWCOL has the same values as EXCOL.


    ------------------------------
    Thanks in advance and best regards,
    Andi
    ------------------------------


  • 2.  RE: RC/Migrator for DB2

    Broadcom Employee
    Posted May 22, 2020 09:59 AM
    Hello Andi, while I am giving this a second thought looking into options I might not be aware of, you could take an easy path and simply execute a SQL-UPDATE statement.
    UPDATE table xx.yy
    SET NEWCOL = EXCOL.

    In case the new column has NOT NULL, this would require an unload-drop-create-load. In this case you can modify the generated LOAD control cards and use the column specification to assign the value from the other column.

    Steen Rasmussen


  • 3.  RE: RC/Migrator for DB2

    Broadcom Employee
    Posted May 26, 2020 12:50 PM
    Hi, Andi, if you are in the 'Table Alter' panel, you can either use the 'R' line command to replicate the column that contains the attributes you want, or you can use the 'C' line command to copy that column, while using the 'A' or 'B' line command to specify which position in the table the new column is to be placed. Then all you should have to do is change the new column name to the name you desire.


  • 4.  RE: RC/Migrator for DB2

    Posted May 26, 2020 02:25 PM
    Hi Edward,
    this sounded very very interesting, but unfortunately it doesn't work. Though I know this line commands, I tested it and the content of the new column is 0., because of a decimal column. Maybe there is a further option to take over the ​values of the column, well hidden anywhere…
    Many thanks for the hints so far!


  • 5.  RE: RC/Migrator for DB2

    Broadcom Employee
    Posted May 26, 2020 03:02 PM
    Hi again Andi, I must not have correctly understood either what the situation is, or where exactly you are experiencing the problem. When I do that with an integer column, I get an "ALTER TABLE ... ADD COLUMN ... WITH DEFAULT 5", which is the default of the original column. Are you seeing something different? If you can explain a little more, maybe I can come up with something to help. Although, if Steen can't come up with an answer, I am not sure I will be able to either.

    Ed


  • 6.  RE: RC/Migrator for DB2

    Broadcom Employee
    Posted May 26, 2020 03:21 PM
    Hi Andi, 
    Please feel free to open a Support case at casupport.broadcom.com and we would be glad to pursue this further.

    Regards, 
     
    Diane Visk
    Sr. Support Engineer | Mainframe Division
    DB2 Tools



  • 7.  RE: RC/Migrator for DB2

    Posted May 27, 2020 06:54 AM
    In rc/alter you can copy attributes but there is no way to copy content values. You can only assign a default as a fixed value. 
    To provide the new column with same value as another, a load replace is required. Override the unload the source column for the new column or change the load cards. 
    The update Method does work only for small tables. Depending on lockmax, you may be blocked from table space lock escalation. Also you are logging every row changed so there is impact to the subsystem.

    Darrin



    The information transmitted is intended only for the person or entity to which it is addressed
    and may contain CONFIDENTIAL material. If you receive this material/information in error,
    please contact the sender and delete or destroy the material/information.

    Humana Inc. and its subsidiaries comply with applicable Federal civil rights laws and
    do not discriminate on the basis of race, color, national origin, ancestry, age, disability, sex,
    marital status, gender, sexual orientation, gender identity, or religion. Humana Inc. and its subsidiaries do not
    exclude people or treat them differently because of race, color, national origin, ancestry, age,
    disability, sex, marital status, gender, sexual orientation, gender identity, or religion.

    English: ATTENTION: If you do not speak English, language assistance services, free
    of charge, are available to you. Call 1‐877‐320‐1235 (TTY: 711).

    Español (Spanish): ATENCIÓN: Si habla español, tiene a su disposición servicios
    gratuitos de asistencia lingüística. Llame al 1‐877‐320‐1235 (TTY: 711).

    繁體中文(Chinese):注意:如果您使用繁體中文,您可以免費獲得語言援助
    服務。請致電 1‐877‐320‐1235 (TTY: 711)。

    Kreyòl Ayisyen (Haitian Creole): ATANSION: Si w pale Kreyòl Ayisyen, gen sèvis èd
    pou lang ki disponib gratis pou ou. Rele 1‐877‐320‐1235 (TTY: 711).

    Polski (Polish): UWAGA: Jeżeli mówisz po polsku, możesz skorzystać z bezpłatnej
    pomocy językowej. Zadzwoń pod numer 1‐877‐320‐1235 (TTY: 711).

    한국어 (Korean): 주의: 한국어를 사용하시는 경우, 언어 지원 서비스를 무료로
    이용하실 수 있습니다. 1‐877‐320‐1235 (TTY: 711)번으로 전화해 주십시오.