Move the row from the Parent table into Child Table, and across tables..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2014 10:37 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2014 11:28 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2014 07:55 PM
Thanks David, that's easy!
I had a thought, but again I wasn't sure if I can do that. Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2014 01:17 AM
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.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/