Which method is better, truncating the attachment table or using remove attachments?

429
2
08-19-2022 10:16 AM
RPGIS
by
Occasional Contributor III

Hi,

I have a simple yet general question. I have a script that adds attachments to a related table. However, whenever I script to renew the attachments(remove and add attachments), it seems that they don't attach to the correct records.

My question is, would it be better to write my script to recreate the table to then remove attachments or would the truncate option work as well? I am trying to configure my code to so that the attachments (in the future) are are kept up to date and account for any additional changes.

0 Kudos
2 Replies
by Anonymous User
Not applicable

Some tables (I think versioned tables) will not allow you to truncate. If the the attachments are not attaching to the right record in your refresh script without recreating the whole table, I'd step through it with the debugger and figure out why.

0 Kudos
RPGIS
by
Occasional Contributor III

That's what I'm working on. I'm rewriting that part of my script to remove and update the attachments. The script is complicated in such that it exports pdfs from a map series and then sets those as attachments.

0 Kudos