I have a unix script which is invoking a sql file/anonymous block.
The sql file read a flat file through UTL_FILE utility and insert/update those data to table.
While invoking SQL script I put
'SET DEFINE OFF'
to get rid of the *'&'* char in the string (input file).
Now I have to process multiple files on a single run, I am invoking the SQL script by passing arguments like :
Invoke :
start xx.sql FILE_NAME
Inside xx.sql accessing the arguments like :
declare
y varchar2(20);
begin
dbms_output.put_line('Y= '||y);
y:='&1';
dbms_output.put_line('Y= '||y);
end;
/
It only works if I put
'SET DEFINE ON'
In this case any *'&'* char being treated as read from standard input.
Creating procedure/function is out of scope.
Can anyone suggest ... what should be the approach and is there a way to manage it ?