I wrote a .sh script which should upload data from file by sql*loader and then run stored procedure which should proceed uploaded data.
#!/bin/bash
ORACLE_HOME=/opt/app/oracle/product/10.2.0/db_1
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin
export PATH
export ORACLE_SID=RSK
sqlldr userid=MY_SCHEME/PASS@MY_SID control=!_control_file.ctl LOG=upload.log errors=100
# SQl procedures start
sqlplus -s MY_SCHEME@RSK/PASS<<end
# Procedure which transport data from stage tables to table_procedure_1
execute MY_SCHEME.procedure_1();
commit;
execute MY_SCHEME.procedure_2();
commit;
end
#exit from .sh script
exit;
As a result i have uploaded data, but MY_SCHEME.procedure_1() doesn't proceed uploaded data. It seems that there was not data commiting after uploading. Please, help me coorect my scipt. Thank you.
p.s. when i run procedure using sql*plus (not from .sh scirpt) it works fine.
It works coorectly:
sqlplus scheme/pass@database<<end
SET SERVEROUTPUT ON
begin
dbms_output.put_line ('Running procedure 1');
proc1();
COMMIT;
dbms_output.put_line('procedure completed');
end;
/
exit
end
Thanks to everybody!!!