Author Topic: Changing Application Group Field Data Type  (Read 2533 times)

rstockton

  • Guest
Changing Application Group Field Data Type
« on: July 31, 2015, 01:52:18 PM »
We have a index field setup in an existing Application Group as "string"  and we need to change it to "Decimal".  Is there a way to do this in OnDemand?

Thanks

Russell

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2231
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Changing Application Group Field Data Type
« Reply #1 on: August 03, 2015, 01:47:31 AM »
Nope, as far as I know, DB2 doesn't support that, so CMOD can't make it happen.  You've got to build a new App Group, and then combine the data from both at the Folder level.

You could do an export/import with arsdoc and arsload, but that may take a long time, and be unnecessarily complex if you have a lot of data.

-JD.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Changing Application Group Field Data Type
« Reply #2 on: August 03, 2015, 05:14:42 AM »
Or what you can do, is add a new field in your existing application group, and then do an update on the segment table to fill the new field from string to decimal.
Then on the folder, you change the string field with a decimal field (meaning basically to recreate a new folder...)
On the application side, you put a default value on the old string field with a dummy value "."

So you don't need to recreate a new application group.

Unofficially, there is a non supported way :-) but that requires a lot of DB2 manipulation... lots of changes in the ARS tables too... and I don't know if it is worth mentioning it!!
If you have some DBA, and some time to kill... and some nerves then to do it in the production... then it can be done.... (I've done it to convert a column from string to integer, and also the reverse integer to string).
But I won't advise it...
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

rstockton

  • Guest
Re: Changing Application Group Field Data Type
« Reply #3 on: August 03, 2015, 07:24:44 AM »
Thanks Justin and Alessandro.

Alessandro,


You mentioned updating the segment table to fill the new field form the string to decimal.  Is there an update command that I can run, or would this have to be done by the DBA?

Thanks,
Russell

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Changing Application Group Field Data Type
« Reply #4 on: August 03, 2015, 08:29:07 AM »
Hi Russell,

Well it can be done either from a DBA or from you. Depending on who has the right to perform such operation.

for DB2 a command like that could do the trick:

Code: [Select]
$ db2 "update SEG set newField=double(oldField)"
for each SEG table of your AG.

Of course, it means that every string in each row is correctly structured, if something is not "correct" maybe you will need to correct everything, and run or rerun several times this command.

Alex
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

rstockton

  • Guest
Re: Changing Application Group Field Data Type
« Reply #5 on: August 03, 2015, 12:03:58 PM »
Thanks.