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
29
votes
6 answers

UTL_FILE.FOPEN() procedure not accepting path for directory?

I am trying to write in a file stored in c:\ drive named vin1.txt and getting this error .Please suggest! > ERROR at line 1: ORA-29280: invalid > directory path ORA-06512: at > "SYS.UTL_FILE", line 18 ORA-06512: at > "SYS.UTL_FILE", line 424…
Vineet
  • 5,029
  • 10
  • 29
  • 34
13
votes
1 answer

How to write to a text file from Pl/SQL, PLS error 00363

I am trying to write to a file from a procedure: out_File := Utl_File.FOpen('C:\test', 'batotest.txt' , 'W'); Utl_File.Put_Line(out_file , 'Hi this is text file!'); Utl_File.FClose(out_file); Compilation errors for PACKAGE xxxxxxxx Error:…
Bato-Bair Tsyrenov
  • 1,174
  • 3
  • 17
  • 40
6
votes
4 answers

Oracle PL/SQL UTL_FILE.PUT buffering

I'm writing a large file > 7MB from an Oracle stored procedure and the requirements are to have no line termination characters (no carriage return/line feed) at the end of each record. I've written a stored procedure using UTL_FILE.PUT and I'm…
Dustin
  • 101
  • 1
  • 1
  • 7
5
votes
1 answer

What is the recommended way to encrypt in Oracle?

I need some help from Oracle/Security experts. I'm going to make functions for encryption/decryption in our Oracle DB. I intend to use dbms_crypto with AES256. I understand that I should store the key file in the O/S and read it using utl_file. Is…
Zesty
  • 2,922
  • 9
  • 38
  • 69
4
votes
2 answers

UTL_FILE.WRITE_ERROR when calling utl_file.put in a loop

I have below code in my PL/SQL procedure, which I called in API_XXX.put(it calls utl_file.put) in a while loop. And the l_xmldoc is CLOB from a function of getReportXML, which returns the xml clob. the code I write to write xml into a file is…
JaskeyLam
  • 15,405
  • 21
  • 114
  • 149
4
votes
6 answers

Read text file to insert data into Oracle SQL table

I am studying Oracle SQL developer. What I am doing is reading text file line by line from the folder. Then Inserting data to the SQL table. I am able to compile my PROCEDURE, however, it doesn't seem to be inserting the data to file. Create or…
Dc Redwing
  • 1,681
  • 11
  • 32
  • 42
3
votes
1 answer

Pl SQL reading text file from directory on database

I have to read a text file that I have created on the database. I am not sure what the appropriate path would be for the UTL_FILE.FOPEN directory parameter. I am confused because the path is not on my local pc. The path where I found this file is…
chickenman
  • 728
  • 2
  • 9
  • 29
3
votes
2 answers

Extracting BLOB files from Oracle table with UTL_FILE en masse, some compressed some not

I have a script that extracts documents en masse out of an Oracle BLOB table. This is necessary for a huge rewrite and database conversion from Oracle to SQL where the files are going to be stored in an SQL file table. Since the documents have to…
kharvey
  • 71
  • 1
  • 9
3
votes
1 answer

Write contents into UTL_FILE immediately after a single iteration

I have PL/SQL Block, it query from a Table function and I use a cursor to process it record by record, have some business logic and finally write the Qualified records into the file. Number of records to be processed is upto 1 Million. And the total…
user3169323
  • 33
  • 1
  • 4
2
votes
2 answers

Oracle - Create text file using stored procedure

Need help on creating text file using stored procedure in oracle 10. I'm very new to this so please guide me from the start. I found code and created it as stored procedure. I run it and it is VALID. But I executed it, I got error of "INVALID FILE…
user1249603
  • 31
  • 1
  • 1
  • 4
2
votes
3 answers

Downloading file from S3 bucket - AWS Oracle RDS

I'm new to Oracle AWS RDS, we have a RDS deployed and an S3 bucket. The download from S3 works fine, however I wanted to write a script which checks if the file download has been completed. DECLARE V_TASKID VARCHAR2(100); V_CTR integer := 0; V_CMD…
2
votes
1 answer

Is possible write in xls file and open the file when executed using plsql developer?

I have a procedure to write a report in Xls file using utl_file. This procedure works correctly but my question is: is it possible to open this file directly in Excel after executed? I ask it because, when it's executing now, I must open the folder…
M.Youssef
  • 146
  • 9
2
votes
2 answers

how do I read a local file in SQL Developer?

I want to read a file on my local machine that contains query parameters when I execute a query in Oracle SQL developer. The examples that I've found on the web so far are inadequate. I keep getting "ORA-29283: invalid file operation" errors when…
user786149
  • 21
  • 1
  • 1
  • 2
2
votes
0 answers

Invalid PATH for file

I am testing the following code in TOAD. create directory test_dir AS 'c:\'; DECLARE fileHandler UTL_FILE.FILE_TYPE; BEGIN fileHandler := UTL_FILE.FOPEN('test_dir', 'test_file.txt', 'W'); UTL_FILE.PUTF(fileHandler, 'Test writing to a…
ohnycany
  • 67
  • 5
2
votes
0 answers

Accute accent in flat file PL/SQL

I have a file which has 4500 records , few records has accute accent ..each record has length of 2600..when i process that file say record 1000 has two accute accents in that case V_newline brings only 2598 ignoring those accute accents ..this is…
Achilles
  • 21
  • 2
1
2 3
10 11