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

Is sql an operating system?

537


describe mysql connection using mysql binary. : Sql dba

540


What is a temporal table?

488


What is the sql query to display the current date?

547


Can we join two tables without common column?

505






What is %type in sql?

508


Which is better cte or subquery?

534


What are the sql aggregate functions?

600


What does trigger mean in psychology?

528


Is there a way to automate sql execution from the command-line, batch job or shell script?

549


What is the difference between inner join and left join?

535


what is the syntax for using sql_variant_property? : Transact sql

524


What are the two virtual tables available at the time of database trigger execution?

627


What is a primary key? Explain

534


What is benefit of creating memory optimized table?

531