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

Write data to flat file in a loop using UTL_FILE

I am attempting to export the employee names in table employees into a flat file. The flat file should have the following structure: HEADER DETAILS JACK DETAILS JUNE TRAILER What I am struggling with is to how I can run this in a loop to store the…
MrM
  • 389
  • 1
  • 8
  • 23
0
votes
1 answer

Charset of File- Oracle

I'm trying to import a file using UTL_FILE in oracle 11g, there is a way to know what charater encoding a file is in? What I'm trying to do is return an error when the charset of a file is different from UTF-8 in order to avoid errors on insert.
Avhelsing
  • 81
  • 2
  • 7
0
votes
0 answers

Cannot write file xml output form a procedure - ORA-06512: a "SYS.UTL_FILE"

in our production environment we use a procedure that read from our DB Oracle 12c and write about 2000 files xml in output on the filesystem, all in the same directory. Now we have a problem: after that 1400 files are already writed, the procedure…
0
votes
0 answers

Saving renamed BLOB data to harddisk. Oracle SQL

I have a long SQL statement with multiple inner joins from multiple tables which outputs 2 Columns: BLOB and NameString. Using Oracle 11g Database. (select blobdata, namestring from xy innerjoin...innerjoin....)-(filtered by Sysdate) My…
muka90
  • 91
  • 10
0
votes
2 answers

UTL_FILE appends LF to end of file

With my following PLSQL block, I experience a Line Feed character at the end of the file. My expectation is that there will be no line feed. DECLARE v_MyFileHandle UTL_FILE.FILE_TYPE; BEGIN v_MyFileHandle :=…
Bender
  • 361
  • 2
  • 3
  • 13
0
votes
0 answers

/usr/tmp, default path in UTL_FILE

When i am searching for directories registered to UTL_DIR i am getting the following : select value from v$parameter where name='utl_file_dir'; /usr/tmp, /usr/tmp, /oradata/hrtst/db/tech_st/11.2.0/appsutil/outbound/HRTS, /usr/tmp Does this mean…
sreekem bose
  • 451
  • 3
  • 12
  • 28
0
votes
0 answers

Open a remote file using utl_file.fopen on Windows

I have to access a remote file in a different computer using utl_file. This is what I did: create a user with Adminstrator+Users+ora_db profile in the remote PC, the same user is created with the same role in my PC. Run the Oracle Services using…
dbabti
  • 11
  • 6
0
votes
1 answer

PL/SQL Overwrite File with new Info without appending

I'm building a PDF on my FTP Folder to send it via a Daemon, the file it's OK, but every time I put it there again this file is appended with information, PDF naturally only reads the LAST instruction, but in order to create a clean File I need to…
0
votes
1 answer

How to move to next line while reading a text file in oracle using PL-SQL when any exception occurs?

The motive is to keep the procedure running even after exception occurs. I have a code which is used to process feed (text) files. The moment it reaches an exception it logs it into a temporary error table and tries to roll back to the savepoint…
Zabit
  • 1
  • 3
0
votes
2 answers

UTL_FILE Generating Empty file

I have a requirement to generate .txt files in a particular path, i tried in 11i instance, its worked fine. but the issue is when i try to add more columns(80 columns only) its generating empty file only. when i remove some columns again its worked…
0
votes
1 answer

Zero is missing while read data from table and writing in flat file using UTL file function in oracle

Data in table(Oracle database) Date Id Flag 16-DEC-13 163750 1 16-DEC-13 163755 1 16-DEC-13 063801 1 whenever I'm read above data from table and writing into flat file using UTL file function,it misses zero from field in the…
user4993731
0
votes
1 answer

SQLCODE 433 SQLSTATE 42806 when running a DB2 procedure that generates insert statements

I am trying to pull together a script that will run through a given schema and output all of the table data as insert statements. I have tested the script on a couple of tables and has completed successfully so started to run it on the full schema…
user3165854
  • 1,505
  • 8
  • 48
  • 100
0
votes
1 answer

beginner in oracle trying to read text file

I am a beginner in oracle. I have been trying to read text file and insert its data in utl_file but unable to do so as I do not understand the following things: Comma1 := INSTR(f_line, ',' ,1 , 1); Comma2 := INSTR(f_line, ',' ,1 , 2); Comma3 :=…
Abhinav
  • 7
  • 1
  • 8
0
votes
3 answers

Getting conversion error while running a procedure - Oracle SQL

CREATE OR REPLACE PROCEDURE read_file IS f_line VARCHAR2(2000); f utl_file.file_type; comma1 VARCHAR(10); comma2 VARCHAR(10); comma3 VARCHAR(10); comma4 VARCHAR(10); comma5 VARCHAR(10); f_empno …
Abhinav
  • 7
  • 1
  • 8
0
votes
3 answers

Is there any way to use the utl_file to generate a csv from data more than 32000 in oracle plsql

.. FILE1 := UTL_FILE.FOPEN('DIR','cg.csv','w',32000); .. we are generating a csv file which has concatenated value of many columns of a view. Is there any way to use the utl_file to generate a csv from data more than 32000 in oracle plsql
guru raj
  • 39
  • 4