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
0 answers

utl_file creating empty pdf on unix server

I'm trying to export a blob from DB and write to pdf on unix server. But what I'm getting is an empty pdf on unix server. My code is as follows: * CREATE OR REPLACE PROCEDURE write_to_file () IS v_cn_letter_name VARCHAR2 (100); v_buffer …
ab19
  • 1
0
votes
1 answer

ORA-01403 "no data found" - UTL_FILE

I have the following script to create 3 files: set serveroutput on declare nombreArchivo varchar2(30); f_out UTL_FILE.FILE_TYPE; begin nombreArchivo :='fich_fseek.txt'; dbms_output.put_line('Abrir el fichero…
Álvaro
  • 1,351
  • 1
  • 10
  • 14
0
votes
0 answers

UTL_FILE command through ASP.NET gives "[Oracle][ODBC]Syntax error or access violation." error

I am trying to execute a PLSQL UTL_FILE command through an ASP.NET web app and keep encountering this error; [Oracle][ODBC]Syntax error or access violation. I am passing in a string (filename) into the sql (insql) and using the below code to…
chrisberry86
  • 35
  • 1
  • 1
  • 9
0
votes
1 answer

Error reading a file using UTL_FILE

I am facing some issue in reading a file using utl_file. The same code is working fine in some of the instances and failing in one instance. Below is the issue: Code: procedure del_mul_tags(p_request_id in number) is fileID…
0
votes
1 answer

How do I use Oracle utl_file to write an image clob

I have an Oracle Apex application which generates automated eMails. In Apex, the user inserts a JPG image into a rich text field. That image is saved into a CLOB field. When the stored procedure is called, it reads the JPG image and stores it…
user3138025
  • 795
  • 4
  • 17
  • 46
0
votes
1 answer

Granting correct permissions to the UTL_FILE method

Say, I have an oracle directory and granted to user 'scott' CREATE OR REPLACE DIRECTORY dataFolder AS '/data/'; GRANT READ, WRITE ON DIRECTORY dataFolder TO scott; Then, I have a shell script say ExtractData.sh which uses UTL_FILE to convert…
bigbang
  • 5
  • 1
  • 2
0
votes
1 answer

pl/sql code to read data from file

I know how to read the data from file using utl_file but I am facing an issue with the data below. We can't assume in which position data will come as null. How can we handle this? Sample data: apple|bat|cat|"dog | dog"||||eee||abc Expected…
Devendra S
  • 11
  • 1
  • 1
  • 4
0
votes
1 answer

Trying to read the file using utl_file method

I am trying to see if this file exists. But I'm getting this error message. I have already checked the privileges I got them. But this file is on the server side so is there something I am missing DECLARE vInHandle utl_file.file_type; BEGIN …
Awais
  • 67
  • 2
  • 10
0
votes
1 answer

Write Output of DBMS.OUTPUT.put_line To Specified Common Location Like Desktop

I have a long series of calls like: DBMS_OUTPUT.put_line(v_1||','||v_2); I have only read priveleges to the database and invision writing the ouptut from the statement above to a common location on all computers that I might read from later (using…
ZAX
  • 968
  • 3
  • 21
  • 49
0
votes
1 answer

PL/SQL Writing Unicode File

I'm using Oracle 11g on Windows 7 with national character set equal to AL16UTF16. I'm trying to write 3 cyrillic letters with the following PL/SQL code: declare s nvarchar2(3):=nchr(1040) || nchr(1041) || nchr(1042); fileHandler…
user416472
  • 104
  • 1
  • 8
0
votes
1 answer

PL/SQL procedure output stored in file and then email in Oracle 11g

I have a procedure where I am checking whether there are new codes. If there are then insert them into a table. And also save the new data into a csv or txt file and email them to me. I can't get the logic for how to redirect the new data to file or…
Xasthur
  • 23
  • 1
  • 5
0
votes
2 answers

Problem with UTL_FILE.FCOPY in a trigger

I am new to triggers. I created a trigger below: CREATE OR REPLACE TRIGGER ac01_control_trigg AFTER INSERT ON AC01_CONTROL_TEST FOR EACH ROW DECLARE BEGIN IF :NEW.cur_pgm_name = 'LSN' AND :NEW.nxt_pgm_name ='MD' AND :NEW.file_status='RD'…
Vijay
  • 65,327
  • 90
  • 227
  • 319
0
votes
0 answers

CSV files with some double quoted Columns containing commas and some non double quoted columns with commas in the columns text

Hard time parsing a CSV file which has column data that seem to have been loaded randomly in source system: My input is a CSV file that has 88 columns , i need to load this to a oracle table. SQL loader throws out bad rows (that's pretty much…
Kfactor21
  • 412
  • 5
  • 14
0
votes
1 answer

Shell script to create directory via Oracle using UTL_FILE

#! /bin/bash sqlplus -s /nolog << EOF conn sys/password as sysdba CREATE or replace DIRECTORY LOGDIR AS '~/log'; GRANT WRITE ON DIRECTORY LOGDIR TO scott; connect scott/tiger set serveroutput on feedback off CREATE OR REPLACE PROCEDURE…
Ibrahim Quraish
  • 3,889
  • 2
  • 31
  • 39
0
votes
1 answer

how to unload from DBserver without using its OS to a remote server

I have a problem in oracle database. I am having a database on which a service is hosted and hence I am not able to see the drives or folders of oracle database. Hence, the procedures using utl_file have stopped working as directory path is invalid…
1 2 3
10
11