It's all about the answers!

Ask a question

Change attribute type from Small string to Large string ?


0
1
Steve Woodbridge (1352326) | asked Mar 07 '12, 9:01 p.m.
We have a presentation with an attribute called "ABC" and the attribute ABC is of type "Small string".

It has been this way for quite a long time. So we have a lot of data collected in that field.

So what is the process for changing that attribute to be of type "Large string" without losing the data we've already collected ?
(I didn't see how you can change the type of an attribute after it has been created and the project area saved.)

2 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered Mar 08 '12, 12:23 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I don't believe that you can change the type of an existing attribute
.... I believe you'll have to create a new attribute, and show the new
attribute in presentations instead of the old one. But that still
leaves you with the need to "copy" the value of the old fields into the
new field. You'll probably have to write a script of some kind to do that.

Cheers,
Geoff


On 3/7/2012 9:10 PM, sgw wrote:
We have a presentation with an attribute called "ABC" and
the attribute ABC is of type "Small string".

It has been this way for quite a long time. So we have a lot of data
collected in that field.

So what is the process for changing that attribute to be of type
"Large string" without losing the data we've already
collected ?
(I didn't see how you can change the type of an attribute after it has
been created and the project area saved.)

Comments
Jared Russell commented Mar 28 '13, 5:18 a.m.

In terms of copying the existing data, the easiest approach I can think of would be to do a CSV export that includes the old small string field, then rename the column to that of the new large string field and import the CSV.


If you have a lot of work items this might take a while to complete, so when creating the query for the export you should filter the small string field to exclude records where its null.


Ralph Schoon commented Mar 28 '13, 5:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Also mind the query result size limit of 1000 items that you might want to increase, or split the exports by more fine grained query result sets.


permanent link
Jacob Leder (124) | answered Mar 27 '13, 8:39 p.m.
I was able to make a change like that through the Precess Configuration Source. Copy the id from the attribute that you created, and search the XML. Change the "kind" to the type that you want. Then make sure the editor presention is using the correct type. I was able to do this when I change a LargeString to a LargeHTML.

Comments
Ralph Schoon commented Mar 28 '13, 3:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I am just wondering if there are adverse effects in the database if you do that. Or if you will get issues with data that is already stored. For example I am not sure how the data is stored. I can imagine all kinds of issues could happen dependent how the storage mechanism works. Example, the size of the data is now bigger. What happens if you want to save a bigger value over data that was already allocated?

I am also not sure how EMF will handle mapping at all if the content is totally different. E.g. if you change from a string to enumeration, although I assume most of the types are really stored as strings and in blobs. Again, do blobs come with a size limit?


Ralph Schoon commented Mar 28 '13, 4:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

See my answer here https://jazz.net/forum/questions/107655/how-can-i-change-attribute-type-from-an-interval-to-an-enumeration that indicates that changing incompatible types might have bad effects.


Jacob Leder commented Mar 28 '13, 10:16 a.m.

I am aware the potential problems. The question is can you, and the answer is yes you can. Yes you need to pay attention to the types that you are changing. You could run into the condition that you are talking about. Depends on how RTC stores data in the database with the xml and the database sectors. If the content of the work items are just xml and the sectors are string based, then it would not matter what the attribute types are. If attribute is a seperate database entry type, then it does matter what the type is.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.