how can i read files from a pl/sq l program

Answer Posted / guru

__________________________________________________________
DECLARE
fileHandler UTL_FILE.FILE_TYPE;
BEGIN
fileHandler := UTL_FILE.FOPEN('/tmp', 'myfile', 'R');
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;
/
________________________________________________________



Thanks

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain autonomous transaction.

632


What is the unique index?

525


Where the sql database files are stored?

484


What is oracle sql developer?

603


Is inner join faster than left join?

629






What is a function in oracle pl sql?

538


how to check myisam tables for errors? : Sql dba

597


What jobs use sql?

526


What is difference between sql and oracle?

560


What is crud sql?

537


explain commit and rollback in mysql : sql dba

545


How many clustered indexes can you have?

529


How you improve the performance of sql*loader? : aql loader

575


What are two statement types in sql?

536


What is procedure in pl sql?

536