#!/bin/sh
sqlplus -s apps << !!
DECLARE
v_file VARCHAR2(20);
CURSOR C1 IS
SELECT CONCURRENT_REQUEST_ID FROM RG_REPORT_REQUESTS_V
WHERE REPORT_SET_ID IN (SELECT REPORT_SET_ID FROM RG_REPORT_SETS WHERE NAME LIKE 'PBGC%')
ORDER BY SEQUENCE
BEGIN
FOR I IN C1
LOOP
v_file:='o'||i.concurrent_request_id||'.out';
/* I want to copy the v_file which exists in outpath to the current directory (/usr/tmp) */
DBMS_OUTPUT.PUT_LINE('Request ID :',i.concurrent_request_id);
END LOOP;
END;
!!
In my code i want to use the UNIX Copy command to copy the file. Please suggest me how to do the same.