The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE Insert_Row (
pp_sync_registration_id IN NUMBER
,pp_sync_label IN VARCHAR2
,pp_order_id IN NUMBER
,pp_status IN VARCHAR2
,pp_max_participants IN NUMBER
,pp_parties_not_in_sync IN NUMBER
,po_error_code OUT NOCOPY NUMBER
,po_error_msg OUT NOCOPY VARCHAR2
);
PROCEDURE Update_Sync_Status (
pp_sync_label IN VARCHAR2
,pp_status IN VARCHAR2
,po_error_code OUT NOCOPY NUMBER
,po_error_msg OUT NOCOPY VARCHAR2
);
-- Update the Sync Registration Status
Update_Sync_Status (pp_sync_label => lv_sync_label
,pp_status => gv_SYNC_ERROR_STATUS
,po_error_code => lv_error_code
,po_error_msg => lv_error_msg);
PROCEDURE Update_Sync_Status (
pp_sync_label IN VARCHAR2
,pp_status IN VARCHAR2
,po_error_code OUT NOCOPY NUMBER
,po_error_msg OUT NOCOPY VARCHAR2
)
IS
lv_status xnp_sync_registration.status%TYPE;
SELECT status
FROM xnp_sync_registration
WHERE sync_label = cv_sync_label
FOR UPDATE OF status;
-- Select the current status and lock the row
--
OPEN lv_sync_status_cur (pp_sync_label);
-- Update the status of the Sync Registration
--
UPDATE xnp_sync_registration
SET status = pp_status
WHERE CURRENT OF lv_sync_status_cur;
po_error_msg := 'XNP_WF_SYNC.UPDATE_SYNC_STATUS-'||SQLERRM;
END Update_Sync_Status;
SELECT status
FROM xnp_sync_registration
WHERE sync_label = cv_sync_label
FOR UPDATE OF status;
-- Select the current status and lock the row
--
OPEN lv_sync_status_cur (pp_sync_label);
-- Update the status of the Sync Registration
--
UPDATE xnp_sync_registration
SET status = gv_SYNC_ACTIVE_STATUS
,parties_not_in_sync = max_participants
WHERE CURRENT OF lv_sync_status_cur;
e_SyncInsertException EXCEPTION;
SELECT order_id, line_item_name,count(*) range_count
FROM xdp_order_line_items
WHERE order_id = cv_order_id
GROUP BY order_id,line_item_name;
SELECT line_item_id
FROM xdp_order_line_items
WHERE order_id = cv_order_id
AND line_item_name = cv_line_item_name;
SELECT xnp_sync_registration_s.NEXTVAL
INTO lv_sync_registration_id
FROM dual;
-- Insert a Sync Registration
Insert_Row(pp_sync_registration_id => lv_sync_registration_id
,pp_sync_label => lv_sync_label
,pp_order_id => pp_order_id
,pp_status => gv_SYNC_ACTIVE_STATUS
,pp_max_participants => lv_range_count
,pp_parties_not_in_sync => lv_range_count
,po_error_code => po_error_code
,po_error_msg => po_error_msg);
SELECT status, max_participants
FROM xnp_sync_registration
WHERE sync_label = cv_sync_label
FOR UPDATE OF status, parties_not_in_sync ;
UPDATE xnp_sync_registration
SET status = l_status
,parties_not_in_sync = l_parties_not_in_sync
WHERE CURRENT OF l_sync_reg_cur;
PROCEDURE Insert_Row (
pp_sync_registration_id IN NUMBER
,pp_sync_label IN VARCHAR2
,pp_order_id IN NUMBER
,pp_status IN VARCHAR2
,pp_max_participants IN NUMBER
,pp_parties_not_in_sync IN NUMBER
,po_error_code OUT NOCOPY NUMBER
,po_error_msg OUT NOCOPY VARCHAR2
)
IS
BEGIN
po_error_code := 0 ;
INSERT INTO xnp_sync_registration (
sync_registration_id
,sync_label
,order_id
,status
,max_participants
,parties_not_in_sync
,created_by
,creation_date
,last_updated_by
,last_update_date
)
VALUES (
pp_sync_registration_id
,pp_sync_label
,pp_order_id
,pp_status
,pp_max_participants
,pp_parties_not_in_sync
,fnd_global.user_id
,sysdate
,fnd_global.user_id
,sysdate
);
po_error_msg := 'XNP_WF_SYNC.INSERT_ROW-'||SQLERRM;
END Insert_Row;
-- Update the XNP_SYNC_REGISTRATION status to ERROR
--
Update_Sync_Status (pp_sync_label => lv_sync_label
,pp_status => gv_SYNC_ERROR_STATUS
,po_error_code => lv_error_code
,po_error_msg => lv_error_msg);
-- Update the XNP_SYNC_REGISTRATION status to ERROR
--
Update_Sync_Status (pp_sync_label => lv_sync_label
,pp_status => gv_SYNC_TIMEOUT
,po_error_code => lv_error_code
,po_error_msg => lv_error_msg);
SELECT parties_not_in_sync,
max_participants
FROM xnp_sync_registration
WHERE sync_label = cv_sync_label
FOR UPDATE OF status,
parties_not_in_sync;
-- decrement the parties not in sync and update the registry
l_parties_not_in_sync := l_parties_not_in_sync - 1;
UPDATE xnp_sync_registration
SET parties_not_in_sync = l_parties_not_in_sync
WHERE CURRENT OF l_sync_reg_cur;
SELECT text_value
INTO l_sdp_result_code
FROM WF_NOTIFICATION_ATTRIBUTES
WHERE notification_id = WF_ENGINE.context_nid
AND NAME = 'RESULT';