473,385 Members | 1,806 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,385 software developers and data experts.

writing output from Pl/SQL o txt file

I need to write the o/p from an Oracle Pl/SQL to a txt file.

I tried the following , but i get an error
declare
f utl_file.file_type;
s varchar2(200) := 'this is some info';
begin
f := utl_file.fopen('SAMPLEDATA','sample2.txt','W');
utl_file.put_line(f,s);
utl_file.fclose(f);
end;


error is : r): ORA-29280: invalid directory path ORA-06512: at "SYS.UTL_FILE", line 18 ORA-06512: at "SYS.UTL_FILE", line 424 ORA-06512: at line 5

I tried to give the location path of the file as "c:\temp"------> the physical location of the file in a remote pc im working on......kindly help me
Feb 8 '07 #1
1 11381
metrey
4
I'm also new to PL/SQL. As I know it is because of your directory path object "SAMPLEDATA" is not define, you need to create this object directory with full read/write. For example:

CREATE DIRECTORY SAMPLEDATA as '/srv02/logfiles';
GRANT READ, WRITE ON DIRECTORY SAMPLEDATA TO YOUR_SCHEMA_USER1, YOUR_SCHEMA_USER2, system;

But you need to have full right access in your oracle db to use this command.

Hope it will help. And please others help to correct if have mistake.
Apr 3 '07 #2

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

Similar topics

6
by: hpy_awad | last post by:
I am writing stings ((*cust).name),((*cust).address)to a file using fgets but rabish is being wrote to that file ? Look to my source please and help me finding the reason why this rabish is being...
1
by: Tomas Vera | last post by:
Hello All, I'm having trouble writing some special characters to an XML file. I need to output a XMLSS formatted file to be read by Excel. In some cells there will be some text that contains...
3
by: RJN | last post by:
Hi I've a template excel file which has all the calculations defined. There are certain input values to be entered which gives a lot of output to the user. I don't want to expose the excel sheet...
5
by: grinder | last post by:
first off, i am an extreme newbie to C. i am an undergrad research assistant and i have been shifted to a project that involves building a fairly involved c program. The part that i am stuck on now...
16
by: Claudio Grondi | last post by:
I have a 250 Gbyte file (occupies the whole hard drive space) and want to change only eight bytes in this file at a given offset of appr. 200 Gbyte (all other data in that file should remain...
3
by: Adonis Vargas | last post by:
I am writing a program that walks a directory full of mp3s reads their ID3 data (using Mutagen), this part works perfectly. The problem is I write these tags to a CSV file through the CSV module....
3
by: sam_cit | last post by:
Hi Everyone, I have a buffer having some raw ASCII data and i want to write it into a file. One way is to loop through the buffer and write a single character at a time and close the file after...
4
by: FingerDemon | last post by:
I'm guessing I'm missing something obvious here, but I have searched around and re-read my Python books and references on simple file writing and I can't see the answer. I am running this in Windows...
2
by: mauricesmith42 | last post by:
Sorry i know this is rather large to be posting, but in order to understand the question you have to see all the code //#include <windows.h> //needed for opening folders #include...
0
by: Gabriel Genellina | last post by:
En Tue, 13 May 2008 11:57:03 -0300, Dmitry Teslenko <dteslenko@gmail.com> escribió: Is the code above contained in a function? So all references are released upon function exit? If not, you...
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
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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

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.