Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

os_command.exec cannot cat file

SevConMar 18 2013 — edited Mar 19 2013
Hi,

I am not sure which category this goes under so will move it if there is a better suggestion.

I am using the os_command pl/sql and java packages from soruceforge to issue unix commands from pl/sql.

I have it at the point where I can rm, touch files and issue commands such as ls but when I try and issue cat I get the message:

begin
select os_command.exec_clob('/bin/cat /home/oracle/rules/var.txt >/home/oracle/rules/var2.txt') into x from dual;
end;

I get:

/bin/cat: /home/oracle/rules/var.txt: No such file or directory
/bin/cat: >/home/oracle/rules/var2.txt: No such file or directory

Those files are owned by and in group oracle. I can run the command from the terminal and get the correct result.

If I put this command into a shell script and then execute that from pl/sql then I it succeeds.

Is there anything in particular that cat would need?

TIA

Sev
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 16 2013
Added on Mar 18 2013
7 comments
1,570 views