how can i read write files from pl/sql

Answer Posted / avi007

DECLARE
fileHandler UTL_FILE.FILE_TYPE;
BEGIN
fileHandler := UTL_FILE.FOPEN('/tmp', 'myfile', 'W');
UTL_FILE.PUTF(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 ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is oracle pl sql developer?

530


How do I create an index in word?

540


How do you declare a user-defined exception?

528


what are numeric data types? : Sql dba

574


What is latest version of sql?

523






Why we use stored procedure instead of query?

533


What are the disadvantages of not performing database normalization?

594


What is the difference between jpql and sql?

551


What is right join sql?

532


What is partition by in sql?

569


Can we use two order by clause in query?

543


Explain the update statement in sql

560


What does trigger mean in psychology?

534


What is meant by user defined function?

581


Explain the purpose of %type and %rowtype data types with the example?

549