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
0
votes
1 answer

Reason for data inconsistency if UTL_FILE is not closed after writing data into the file in Oracle SQL

I am using Oracle SQL developer as a client for Oracle 11g DB. Its a simple issue. I am fetching data from a table and writing the data into a text file. This particular piece of code is scheduled as a monthly job and the output text file is placed…
0
votes
1 answer

Oracle UTF8 File Encoding With Utl_file

I want to export my file as UTF8 encoding. When I checked v$nls_parameters, nls_characterset is WE8ISO8859P9. So encoding of my file is Ansii. How can I export my file with UTF8 encoding without changing v$nls_parameters? DECLARE v_os_touch_file …
serdanarik
  • 45
  • 1
  • 9
0
votes
1 answer

UTL_FILE.FGETATTR returns 0 for the block size

When I use UTL_FILE.FGETATTR, the block size returns 0 each time. I can get file length etc, but block size returns 0. What can be the reason for that and how can I solve this? OS : Windows 10 DB : 19c DECLARE v_fexists BOOLEAN; …
oramas
  • 881
  • 7
  • 12
0
votes
1 answer

how to read a tab delimited .txt file and insert into oracle table

I want to read a tab delimited file using PLSQL and insert the file data into a table. Everyday new file will be generated. I am not sure if external table will help here because filename will be changed based on date. Filename:…
Puja Shaw
  • 115
  • 1
  • 10
0
votes
2 answers

Oracle PLSQL coding -- UTF-8 to UTF-BOM conversion

I am working with a standard 11g Standard Edition Oracle database. These are my NLS parameters: NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC_CHARACTERS ., NLS_CHARACTERSET …
Vishnu
  • 1
  • 4
0
votes
0 answers

Append XML into a new file using UTL_File

I have an XML file created from DBMS_XMLGEN. Now, I need to put this XML file into a new OS like below. How can I achieve this? v_file := utl_file.fopen (my_dir, filename, 'A'); -- do something to put the XML file into this…
VEvergarden
  • 105
  • 11
0
votes
0 answers

oracle pl/sql utl_file ORA-29280: invalid directory path and ORA-29280: invalid directory object

work with UTL_FILE. I want to create a file in 'G:\'. I create a directory with: create or replace directory XYZ as 'G:\'; grant read, write on directory XYZ to hr; declare fp utl_file.file_type; CURSOR c1 is select EMPLOYEE_ID, FIRST_NAME,…
0
votes
1 answer

UTL_FILE and character set for spanish

I have been working on this for days. I need help on Spanish data export from DB instance. I'm trying to query table data and export into oracle Directory (Example:outbound) but I see Spanish accent characters are getting stripped off. I use…
Martin
  • 1
  • 3
0
votes
2 answers

UTL_FILE saving in local machine

Hello, I wanted to save all the functions,procedures,packages in my local machine. I tried with SPOOL but with spool im not sure to get the filename and save it. So i tried with UTL_FILE.. But the problem is my database is in UNIX and I wanted to…
0
votes
1 answer

how use UTL_FILE package for write file on map drive?

I use UTL_FILE package in my procedure for saving file on database server but i need to save file on another server for that i make a map drive but this UTL_FILE not saving files on my MAP Drive me also check manually drive Read and write the file…
0
votes
1 answer

Encountering 'ORA-29283: invalid file operation' only in the second block of code(first block executes sucessfully also which also uses UTL_FILE)

I have an SQL file which contains 2 block of code, both using UTL_FILE functions to write 2 different files in same directory. The issue I encounter is the first block of code executes successfully but when executing the second block of code I…
Mighty God Loki
  • 135
  • 3
  • 10
0
votes
1 answer

Fix date issue in a .csv file with utl_file

I am using utl_file to write in a csv file. The data includes date columns also. The issue here is For a single digit day 0 gets removed when the data gets inserted in the csv file. Eg - date 07-Jun-13 gets inserted as 7-Jun-13, how can I ensure…
user3436389
  • 71
  • 2
  • 14
0
votes
0 answers

Is there anyway to put a procedure in utl_file to print part of the file content in plsql?

I try to print something to a file. The file has header, body, footer and each of them has some function in it respectively. Is there a way I can separate it into each procedure then combine them as one procedure? For instance, I made a procedure…
Stu_Dent
  • 370
  • 1
  • 4
  • 19
0
votes
2 answers

UTL_FILE not creating a file and not giving an error

I am running a concurrent program which runs a package.procedure, it is suppose to take output of a cursor and add it into a .csv file. Earlier it was running fine however when I am running now the file is not getting created in the server…
user3436389
  • 71
  • 2
  • 14
0
votes
2 answers

How to append a word to a line in a file without moving to next line -?

I am using UTL_FILE to extract output from the .csv file and trying to append the gender to the already existing file data. But in everyway I tried I am unable to get the expected output. Need quick help on this. Actual File…