Questions tagged [utl-file]

An Oracle package to enable reading and writing of text files on the operating system.

utl_file is an Oracle package that offers a limited version of standard operating system file I/O to read and write text files outside of the database.

Access to files is possible through a directory object but is also restricted by any operating system privileges.

Questions tagged should also be tagged .

Further reading:

164 questions
1
vote
2 answers

Write to a file in PL/SQL without spools or utl_file

Trying to create an output file through a procedure but am unable to modify the init.ora to allow for utl_file_dir or create directory. Is there another way to accomplish this without creating a table and doing a simple spool, this unfortunately, is…
DEwok
  • 73
  • 2
  • 3
  • 11
1
vote
1 answer

Error when trying to write to file

I have the following procedure which is supposed to write some data to a file. CREATE OR REPLACE PROCEDURE export_to_xml IS F UTL_FILE.FILE_TYPE; CURSOR c_cursor IS SELECT x FROM (select xmlelement( "user", xmlforest( uname, action, time ) )…
districktt
  • 81
  • 1
  • 5
1
vote
1 answer

export multiple table data into csv file in oracle

I have five different tables as a,b,c,d,e with different number of columns. I want to export the data into the csv file from all this five table. In common i have seq_no in all five tables.seq_no wise file should get generated. And table a data…
user3195273
  • 193
  • 1
  • 5
  • 13
1
vote
1 answer

File corruption with UTL_FILE script

I have definitely searched FAR and WIDE for an answer to this, but I can't find anything! I am using a UTL_FILE script to pull down some file BLOBS from an Oracle table and save them to a file directory. It's working for a lot of the files, but I…
kharvey
  • 71
  • 1
  • 9
1
vote
1 answer

Exporting files from Oracle BLOB to SQL FileTable - file types?

I am trying to do an ETL for a data conversion/upgrade of an Oracle table that contains HUGEBLOB files, and the columns in that table list only a file name and the MIME type. The file names don't always (in a lot of cases in fact) provide the…
kharvey
  • 71
  • 1
  • 9
1
vote
2 answers

UTL_FILE_DIR on Oracle 11g SQL client

Is it possible to set up a UTL_FILE_DIR path that points to a directory on a different server than the database server?
user4217271
1
vote
1 answer

utl_file fopen - I'm unable to to write text to a file

Recently, I updated a version for DB, to Oracle 11G. From that moment, writing to a file fails. My code: UTL_FILE.FOPEN('/tmp', 'file.txt', 'w'); I got "ora-29280 invalid directory path" I know I should use with Oracle DIRECTORY ("create…
Refael
  • 6,753
  • 9
  • 35
  • 54
1
vote
1 answer

utl_file.put_line not working

I need to generate a XML and write it to a file. I have used utl_file.put_line. It creates the file, but nothing is written into it. Also, it shows no errors. I've already checked if I have the permissions to write on the directory. Code: SET…
rvcam
  • 157
  • 5
  • 15
1
vote
1 answer

PL/SQL UTF_FILE.PUT_LINE does not add a new line

I've created a procedure that writes text to a file yet for some reason I'm not able to create a new line through the code and the end result is that the procedure writes everything to the same line until it breaks to a new line due to size. this is…
user3050187
  • 17
  • 1
  • 6
1
vote
1 answer

PL/SQL UTL_FILE read trouble on anonymous block

DECLARE data_line VARCHAR2(200); -- Data line read from input file data_file UTL_FILE.FILE_TYPE; -- Data file handle my_dir VARCHAR2(250); -- Directory containing the data file my_filename VARCHAR2(50); BEGIN …
Dug
  • 21
  • 2
  • 3
1
vote
2 answers

Oracle UTL_FILE - multiple rows in excel for a single cell

I have a requirement to display the below in a csv file which is generated using UTL_FILE package of PL/SQL. Heading1 Heading2 Heading3 ABCDE 123 987641213 xxx street yyyy For each value in…
Avinash
  • 55
  • 1
  • 9
1
vote
1 answer

How to return LOW VALUES HEX '00' in sql statement?

I need to write into file (in the middle of the string) a LOW VALUES HEX'00'. I could do it using package utl_file using the next code utl_file.put_raw(v_file, hextoraw('000000')). But I may do it only in the beginning and end of file, not in the…
May12
  • 2,420
  • 12
  • 63
  • 99
0
votes
1 answer

Oracle UTL_FILE. how to create OS directory

I should store some files from DB table into server directories. the repository tree should be structured as follow \\server\REPOSITORY\[FOLDER]\[list of files...] where [FOLDER] name and list of files are retrieved from DB. so, I used the UTL_FILE…
mr anto
  • 23
  • 1
  • 6
0
votes
2 answers

Got ORA-29280 with UTL_FILE

I'm having issues running the following code: I'm trying to do a theorical exercise on the usage of UTL_FILE in which I intend to write an XML into a file. DECLARE XML_VAL01 XMLTYPE; XML_VALUE CLOB; VAR_DIRID VARCHAR(10)…
Felipe Vidal
  • 437
  • 3
  • 15
0
votes
1 answer

Cursor and CSV using utl_file package

Hi I want to create a csv file using plsql utl file. For that I am creating cursor in utl file but I dont want to enter duplicate data. Because I want to create that csv file daily from the same table. Please help I tried by cursor but I have no…