UTL_FILE - Reg

UTL_FILE - Reg

 

  

All:

* Do we need to execute any database scripts to use UTL_FILE
objects?

* I am getting an error while executing an procedure with UTL_FILE
objects
PLS-00382: expression is of wrong type
* Ex:

CREATE OR REPLACE PROCEDURE
stp_load_kokos (v_file_name IN VARCHAR2)
AS
filecont UTL_FILE.file_type;
filenewline VARCHAR2 (4000);

CURSOR c
IS
SELECT *
FROM t_kordoba_kokos
WHERE file_name = v_file_name
ORDER BY record_no, file_name ASC;

seq_no NUMBER
DEFAULT 0;
recpos NUMBER;
BEGIN
DBMS_OUTPUT.put_line ('A');
filecont := UTL_FILE.fopen ('KOKOS',
v_file_name || '.txt', 'r');
DBMS_OUTPUT.put_line ('B');

IF UTL_FILE.is_open (filecont)
THEN
DBMS_OUTPUT.put_line ('C');

DELETE FROM t_kordoba_kokos
WHERE file_name =
v_file_name;

DELETE FROM
t_kordoba_kokos_content
WHERE file_name =
v_file_name;
............
............

With Regards

Mukesh


Information transmitted by this EMAIL is proprietary to iGATE Group of Companies and is intended for use only by the individual or entity to whom it is addressed and may contain information that is privileged, confidential, or exempt from disclosure under applicable law. If you are not the intended recipient of this EMAIL immediately notify the sender at iGATE or [Email address protected] and delete this EMAIL including any attachments.

Oracle LazyDBA home page