Move the row from the Parent table into Child Table, and across tables..

adiddigi
Tera Guru

Hello,

 

I'm trying to move a row which is in a Parent table to its Child table. While I know ways to manipulate the extensions of tables, I've not seen any ways in which we can move rows of a Parent table into it's Children's table.

 

I've also seen ways to move the Columns from Child table to Parent table. So I know that there should be a way in which we can move a Row which is in Parent table to the Row of a Child table.

 

For example : Let's say I've a row in a table called cmdb_ci, I want to move this to cmdb_ci_server, without modifying it's sys_id, so that the reference fields referring to this row will remain intact.

 

Any ideas please?

 

Thanks for all the help!

3 REPLIES 3

david_legrand
Kilo Sage

Hello,



In fact, it's super easy



Just find the "class type" field and change the value to the target class.


For example, the field is named "Class" on "cmdb_ci" and "Task Type" on task



The only thing is "If you're moving your CI from one class to another, if some fields of the source table don't exist in the target table, you'll miss data". Or before moving the data, you'll have to move the "fields" themselves from source to target table



Regards,


David


Thanks David, that's easy!



I had a thought, but again I wasn't sure if I can do that. Thanks again!


Note that can you may see two instances of the same CI in the search results until index is rebuilt. So you may want to force table re-indexing in this case.