Any ideas on why this might erroring out? I have tried it on another database and it worked. I made some modifications to the original script, but the same error remains.
Update: It actually does copy 36 PDFs to a folder successfully before the error. Not sure why yet. I'm would expect 400+ attachments, I will keep digging.
Solved! Go to Solution.
Seems like you have empty attachments. Are there entries with DATA_SIZE = 0 ?
Try to include a where clause in the cursor:
with da.SearchCursor(inTable, ["DATA", "ATT_NAME"], "DATA IS NOT NULL") as cursor:
#...
Seems like you have empty attachments. Are there entries with DATA_SIZE = 0 ?
Try to include a where clause in the cursor:
with da.SearchCursor(inTable, ["DATA", "ATT_NAME"], "DATA IS NOT NULL") as cursor:
#...
Thanks for the tip! I just checked and there doesn't appear to be any records with DATA_SIZE = 0
I decided to try this even though I couldn't find any entries with DATA_SIZE = 0 and it worked. Maybe there were some corrupt records or something, I'm not sure yet, but thank you!
Update: It actually does copy 36 PDFs to a folder successfully. Not sure why yet. I'm would expect 400+ attachments, I will keep digging.