The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT distinct VPSBatchID
INTO loc_vpsid
FROM iby_batches_all
WHERE payeeid = merchant_id_in AND
BatchID = batch_id_in AND
bepid = vendor_id_in AND
bepkey = vendor_key_in;
SELECT status, bepid, bepkey, transactionid, trxnref
FROM iby_trxn_summaries_all
WHERE tangibleid = order_id_in
AND payeeid = merchant_id_in
AND reqtype IN (i_reqtype1, i_reqtype2)
AND reqtype IS NOT NULL -- to ignore the 2nd arg
ORDER BY reqdate DESC;
SELECT tracenumber
FROM iby_transactions_v
WHERE order_Id = order_id_in
AND merchant_id = merchant_id_in
AND trxn_type IN (tx1, tx2)
ORDER BY time DESC;
-- So we need to select based on this set
-- For an explanation of various trxn_types refer the design doc
IF (s1%ISOPEN) THEN
CLOSE s1;
SELECT BatchStatus, VPSBatchID
FROM iby_batches_all
WHERE BatchID = batch_id_in
AND payeeid = merchant_id_in
ORDER BY BatchCloseDate DESC;
SELECT order_Id
FROM iby_transactions_v trn, iby_bepinfo ven
WHERE merchant_id = merchant_id_in
AND UPPER(ven.suffix) = UPPER(vendor_suffix)
AND ven.bepid = trn.vendor_id
AND status = 0
AND trxn_type IN (8, 9, 5, 10) -- only looking at capture/return
AND merchbatchid IS NULL
ORDER BY time ASC;
SELECT amount, currencynamecode, status
INTO amount_out,currency_out, status_out
FROM iby_trxn_summaries_all
WHERE (transactionid=trxnid_in) AND (trxntypeid IN (trxntypeid_in,trxntypeid_aux_in))
AND (status in (status_in,status_aux_in));