#!/bin/ksh
#myscript.sh
sqlplus mfahd/password <
foo();
end;
/
exit;
ENDOFSQL
===================================================
create or replace procedure foo as
f utl_file.file_type;
vname varchar2(30);
vempno number;
vrecord varchar2(300);
begin
select empno, ename into vempno, vname from emp where empno=1;
vrecord:=vname || '|' || vempno;
f := utl_file.fopen('LOADDATA','test.txt','W');
utl_file.put_line(f,vrecord);
utl_file.fclose(f);
end;
/
No comments:
Post a Comment