
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Attachment relink
Hi, I need to link all attachments that are currently linked to Design Steps to the appropriate Test Case on DB Level. So that we have the Attachment still available at the Design Step but also at Testcase level (We have Smart Repository in QC 11.5)
What I have done so fare:
1. I inserted a new record in Table Smart_Repository_locical_file by creating a new SRLF_ID and adjusting the SRLF_NAME to the appropriate Test Case and Test Case Number. Leaving the physical part as the original.
Here my insert SQL:
INSERT INTO [hpalm_db].[td].[SMART_REPOSITORY_LOGICAL_FILE] (SRLF_ID, SRLF_PARENT_PATH, SRLF_NAME, SRLF_PHYSICAL_ID, SRLF_IS_DIRECTORY, SRLF_LAST_MODIFIED, SRLF_SIZE) VALUES ('35324','.\attach\','TEST_14365_docname.docx','10936','N','2011-11-07 14:38:04.000','118288')
2. Then I update the appropriate record in Table TEST to reflect that it has an Attachment
Here my sql:
UPDATE [hpalm _db].[td].[TEST] SET [TS_ATTACHMENT] = 'Y' WHERE [TS_TEST_ID] = 14365
But it did not work! I am sure there must be an other table to alter that makes the connection of SmartRepository and TestCases as I doubt that the concatenated SRLF_NAME with the TS_TEST_ID is the only link.
But I did not find an other Table that links these entities.
Any help?
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
You will need to update at least the CROS_REF table as well.
But if I were you I would not want to update the database this way. You may end up with a corrupt database if things go wrong. I would rather create an OTA API script so you don't have to worry about updating the tables directly and jeopardizing database referential integrity.
[Please do not contact me off line for receiving support. Use the forum!]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
You will need to update at least the CROS_REF table as well.
But if I were you I would not want to update the database this way. You may end up with a corrupt database if things go wrong. I would rather create an OTA API script so you don't have to worry about updating the tables directly and jeopardizing database referential integrity.
[Please do not contact me off line for receiving support. Use the forum!]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thnanks Jan
here my insert to Cros Ref Table:
INSERT INTO [hpalm_db].[td].[CROS_REF] ([CR_ENTITY],[CR_KEY_1],[CR_REF_ID],[CR_REFERENCE],[CR_REF_TYPE],[CR_REF_SUBTYPE])
Values ('TEST','14365','46030',' TEST_14365_Docname.docx','File','0')
now it works perfectly!