Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Change attribute type from Small string to Large string ?

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

1

0 votes



2 answers

Permanent link
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.)

0 votes

Comments

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.

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

0 votes

Comments

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?

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.

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Mar 07 '12, 9:01 p.m.

Question was seen: 5,143 times

Last updated: Mar 28 '13, 10:16 a.m.

Confirmation Cancel Confirm