473,378 Members | 1,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 8583
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 when a child thread pops up a Pmw dialog window in...
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 function using a pointer to the derived class...
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 this Program to accept about 1 Million concurrent...
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 is a singleton. The client is a Web Application...
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 not know anything about Managers, only the Employee...
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 base class... BaseClass bc = new ChildClass();...
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 the article. The problem is: I the comment length...
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 says service packs marked as "critical" by...
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 asked by someone else what the autopostback was...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.