472,332 Members | 1,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,332 software developers and data experts.

problem with UTIL_FILE

37
Hi

I have created a procedure using UTL_FILE.

Before executing the procedure i created a directory as

Expand|Select|Wrap|Line Numbers
  1.  
  2. connect system/system;
  3. grant execute on sys.utl_file to PUBLIC;
  4. alter system set processes=500 scope=spfile;
  5. grant read, write on directory gams to public;
  6. connect san/san;
  7. create or replace directory gams as 'C:\gamsdir';
  8.  
  9. CREATE OR REPLACE PROCEDURE Empl
  10. IS
  11.     f utl_file.file_type;
  12. begin
  13.   f := utl_file.fopen('GAMS', 'test.txt', 'w');
  14.   utl_file.put_line(f, 'line one: some text');
  15.   utl_file.put_line(f, 'line two: more text');
  16.   utl_file.fclose(f);
  17. end;
  18. /
  19.  
  20. --It gives the errors as
  21.  
  22. /*ERROR at line 1:
  23. ORA-29283: invalid file operation
  24. ORA-06512: at "SYS.UTL_FILE", line 475
  25. ORA-29283: invalid file operation
  26. ORA-06512: at "SAN.EMPL", line 5
  27. ORA-06512: at line 1*/
  28.  
  29.  
How can i create the directory?
How can i create the utl_file_dir and how can i set that directory in init.ora?

what can i do?
Any Help???

Thank you
Jan 4 '08 #1
9 8489
amitpatel66
2,367 Expert 2GB
Run this query:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT value FROM v$parameter WHERE name = 'utl_file_dir';
  3.  
  4.  
The output you get from the above query will be the directories that you can use for utl file operation.

If you want to add any otehr directories to the above list, then you need to modify init.ora file and restart the server.
Jan 4 '08 #2
debasisdas
8,127 Expert 4TB
try the following sample to create directory and grant read ,write previliges on the same to the user.

create or replace directory dir1 as 'c:\folder1' ;
Jan 4 '08 #3
san1014
37
Run this query:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT value FROM v$parameter WHERE name = 'utl_file_dir';
  3.  
  4.  
The output you get from the above query will be the directories that you can use for utl file operation.

If you want to add any otehr directories to the above list, then you need to modify init.ora file and restart the server.
SQL> SELECT VALUE FROM v$parameter WHERE name = 'utl_file_dir';

VALUE
--------------------------------------------------------------------------------

But it is not displaying anything?

Please Help me?
What to do?
Thank u.
Jan 4 '08 #4
amitpatel66
2,367 Expert 2GB
SQL> SELECT VALUE FROM v$parameter WHERE name = 'utl_file_dir';

VALUE
--------------------------------------------------------------------------------

But it is not displaying anything?

Please Help me?
What to do?
Thank u.
If you see below from my instance:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SQL> SELECT VALUE FROM v$parameter WHERE name = 'utl_file_dir'
  3.   2  /
  4.  
  5. VALUE
  6. --------------------------------------------------------------------------------
  7. /usr/tmp, /usr/tmp, /u01/oracle/visdb/9.2.0/appsutil/outbound/VIS_oraappsdev, /u
  8. sr/tmp
  9.  
  10.  
  11. SQL> 
  12.  
  13.  
the above list of directories are used for utl file operation.
to add any new values, you need to modify the init.ora file and bounce the server.....
Jan 4 '08 #5
san1014
37
If you see below from my instance:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SQL> SELECT VALUE FROM v$parameter WHERE name = 'utl_file_dir'
  3.   2  /
  4.  
  5. VALUE
  6. --------------------------------------------------------------------------------
  7. /usr/tmp, /usr/tmp, /u01/oracle/visdb/9.2.0/appsutil/outbound/VIS_oraappsdev, /u
  8. sr/tmp
  9.  
  10.  
  11. SQL> 
  12.  
  13.  
the above list of directories are used for utl file operation.
to add any new values, you need to modify the init.ora file and bounce the server.....
How can i modify the init.ora file and bounce the server?

Please tell me in detail.

Thank u
Jan 4 '08 #6
amitpatel66
2,367 Expert 2GB
How can i modify the init.ora file and bounce the server?

Please tell me in detail.

Thank u
The init.ora file is placed in the path "$ORACLE_HOME/dbs" of the databas eserver.

Modify this file and shutdown/restart your database server

This can be done by your DBA team.Ask your DBA team to do this.
Jan 4 '08 #7
san1014
37
The init.ora file is placed in the path "$ORACLE_HOME/dbs" of the databas eserver.

Modify this file and shutdown/restart your database server

This can be done by your DBA team.Ask your DBA team to do this.

I really confused with this.

If you dont mind can you explain in step wise , what can i do to use UTL_FILE?

Please help me.

Thank ypu
Jan 4 '08 #8
amitpatel66
2,367 Expert 2GB
I really confused with this.

If you dont mind can you explain in step wise , what can i do to use UTL_FILE?

Please help me.

Thank ypu
Check here if it helps!! and here
Jan 4 '08 #9
amitpatel66
2,367 Expert 2GB
I really confused with this.

If you dont mind can you explain in step wise , what can i do to use UTL_FILE?

Please help me.

Thank ypu
Check here if it helps!! and
here
Jan 4 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition...
11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the...
0
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement...
9
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which...
117
by: Peter Olcott | last post by:
www.halting-problem.com
17
by: Jon Slaughter | last post by:
I'm having a little trouble understanding what the slicing problem is. In B.S.'s C++ PL3rdEd he says "Becayse the Employee copy functions do...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.