select claimId from tbl_TPM_Claims where claimref = and claimDate = and ownerId = and ownerType = update tbl_IMPORT_ProofOfDeliveryManifest set fseClaimId = where eai_batchId= and ownerId = and ownerType = select mf.manifestId, mf.ownerId, mf.ownertype, mf.claimId, mf.branchCode, mf.invoiceNbr, mf.invoiceDate, mf.claimAmount, mf.contentId, mf.batchId, mf.batchStatus, mf.batchMessage, c.mainFolder, c.subFolder, c.fileName, r.fileSize, r.docTitle, r.fileId from tbl_TPM_ProofOfDeliveryManifest mf left outer join tbl_FSC_Content c on c.contentId = mf.contentId left outer join tbl_TPM_Repository r on r.contentId= c.contentId and r.containerId = mf.claimId and r.containerType = 'TMC' where mf.ownerId = and mf.ownerType = and mf.claimId = delete from tbl_TPM_ProofOfDelivery where ownerId = and ownerType = and claimId = and contentId = delete from tbl_TPM_ProofOFDeliveryManifest where ownerId = and ownerType = and claimId = and manifestId = insert into tbl_TPM_ProofOfDeliveryManifest ( ownerId, ownerType, claimId, branchCode, invoiceNbr, invoiceDate, claimAmount ) select ownerId, ownerType, fseClaimId claimId, branchCode, invoiceNbr, invoiceDate, claimAmount * -1.0 as claimAmount from tbl_IMPORT_ProofOfDeliveryManifest where eai_batchId= and ownerId = and ownerType = and fseClaimId = order by eai_lineNumber select branchCode, invoiceNbr, invoiceDate, claimAmount from tbl_TPM_ProofOfDeliveryManifest where claimId = and ownerId = and ownerType = order by manifestId