0% found this document useful (0 votes)
70 views1 page

SQL Scripts

This document contains SQL scripts for changing the status of requisitions and purchase orders in an application, identifying "ghost tasks" that are marked as active but have no associated transaction, and clearing a ghost task by updating its status to finished.

Uploaded by

C Hutch
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views1 page

SQL Scripts

This document contains SQL scripts for changing the status of requisitions and purchase orders in an application, identifying "ghost tasks" that are marked as active but have no associated transaction, and clearing a ghost task by updating its status to finished.

Uploaded by

C Hutch
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Useful SQL Scripts

Changing the Status of a Requisition

Update aporeqheader
set status = '&Desired_Status'
where order_id = '&requisition_number';

Update aporeqdetail
set status = '&Desired_Status'
where order_id = '&requisition_number';

Commit;

Changing the Status of a Purchase Order

Update apoheader
set status = '&Desired_Status'
where order_id like '&po_number';

Update apodetail
set status = '&Desired_Status'
where order_id = '&po_number';

Commit;

Identifying Ghost Tasks

select distinct(col1_value)
FROM awftask WHERE wf_status='ACT' AND col1_Descr = 'TransNo' AND
col2_descr = 'SuppID'
and col1_value not in (select cast(voucher_no as char) from asuvicrtrans) and
element_type = 'IIN' order by 1

Clearing a Ghost Task

Begin transaction GT
UPDATE awftask SET wf_status='FIN' WHERE wf_status='ACT' AND col1_Descr =
'TransNo' AND col2_descr = 'SuppID'
AND col1_value NOT IN (SELECT cast(voucher_no as char) FROM asuvicrtrans)
and element_type ='IIN';
commit;

You might also like