Home » SQL & PL/SQL » SQL & PL/SQL » Please help for resolving issue for UTL_FILE (Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production)
Please help for resolving issue for UTL_FILE [message #646351] Mon, 28 December 2015 08:17 Go to next message
msol25
Messages: 396
Registered: June 2011
Senior Member
Dear,

Please help for getting the issue why file is not writing to the directory location:

A procedure code is here

Calling the Procedure through command:


begin

STC_FTP_DAS_FILE_DUMMY (
   'test.ascii',
   'monthly'
);

end;



Please help for getting the issue why file is not getting generated at given directory location.


[EDITED by LF: applied [spoiler] tags]

[Updated on: Mon, 28 December 2015 13:32] by Moderator

Report message to a moderator

Re: Please help for resolving issue for UTL_FILE [message #646352 is a reply to message #646351] Mon, 28 December 2015 08:45 Go to previous messageGo to next message
John Watson
Messages: 8930
Registered: January 2010
Location: Global Village
Senior Member
Your code is unreadable. I cannot work out what is actually meant to be executing, and what code has been converted into comments. Perhaps you have commented out everything that would write.
Re: Please help for resolving issue for UTL_FILE [message #646361 is a reply to message #646352] Mon, 28 December 2015 12:11 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
Also is the directory SAURAUBH_DIR defined and at the OS level have your given the directory the permissions to write into that directory. To find out run the folowing script

select * from Sys.All_directories
where directory_name = 'SAURAUBH_DIR';

And then outside of oracle see if the permissions on the directory and see if the oracle user can read and write the directory.
Re: Please help for resolving issue for UTL_FILE [message #646364 is a reply to message #646361] Mon, 28 December 2015 13:39 Go to previous messageGo to next message
msol25
Messages: 396
Registered: June 2011
Senior Member
Dear Bill,


Directory is having read & write privileges.
Re: Please help for resolving issue for UTL_FILE [message #646365 is a reply to message #646364] Mon, 28 December 2015 13:40 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
And the directory showed in the all_directories query that you ran?
Re: Please help for resolving issue for UTL_FILE [message #646375 is a reply to message #646365] Tue, 29 December 2015 01:15 Go to previous messageGo to next message
msol25
Messages: 396
Registered: June 2011
Senior Member
yes,

Please find below mentioned output:


select  *
from    all_directories
where   directory_name = 'SAURAUBH_DIR'

OWNER DIRECTORY_NAME DIRECTORY_PATH
SYS   SAURAUBH_DIR    /home/oracle/chk_file

select  *
from    all_tab_privs
where   table_name = 'SAURAUBH_DIR'

GRANTOR	    GRANTEE	 TABLE_SCHEMA	TABLE_NAME	 PRIVILEGE	GRANTABLE	HIERARCHY

TEST_DBA	TEMP	   SYS	       SAURAUBH_DIR	 READ	     NO	NO
TEST_DBA	TEMP	   SYS	       SAURAUBH_DIR	 WRITE	     NO	NO

Re: Please help for resolving issue for UTL_FILE [message #646381 is a reply to message #646351] Tue, 29 December 2015 04:46 Go to previous messageGo to next message
Alien
Messages: 291
Registered: June 1999
Senior Member
Hi,

what error do you get, when you remove the exception handling?

Regards,

Arian
Re: Please help for resolving issue for UTL_FILE [message #646391 is a reply to message #646381] Tue, 29 December 2015 08:35 Go to previous message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
Since your on a unix system type the following and paste it in this issue

ls -la /home/oracle/chk_file
Previous Topic: Can we Write PLSQL concept in WITH clause
Next Topic: Please help - pivot option
Goto Forum:
  


Current Time: Tue Apr 23 05:44:23 CDT 2024