how can i read write files from pl/sql

Answer Posted / avi007

--Read file

DECLARE
fileHandler UTL_FILE.FILE_TYPE;
BEGIN
fileHandler := UTL_FILE.FOPEN('/tmp', 'myfile', 'R');
UTL_FILE.GETF(fileHandler, 'Look ma, I''m writing to a
file!!!\n');
UTL_FILE.FCLOSE(fileHandler);
EXCEPTION
WHEN utl_file.invalid_path THEN
raise_application_error(-20000, 'ERROR:
Invalid path
for file or path not in INIT.ORA.');
END;
/

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What packages are available to pl/sql developers?

801


What are field types?

721


Can you call pl/sql package functions from within a fast formula?

762


Explain the difference between sql and mysql.

748


What is exception? What are the types of exceptions?

779






What is the difference between partition and index?

653


What are the most important characteristics of pl/sql?

775


define join and explain different type of joins? : Sql dba

730


Can we write dml inside a function in sql server?

669


what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba

690


Is ms sql is free?

704


How to avoid using cursors?

758


Why primary key is required?

717


What is delimiter in pl sql?

734


Why join is faster than subquery?

789