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

how can we take a backup of a mysql table and how can we restore it. ? : Sql dba

521


What is the difference between instead of trigger and after trigger?

514


which tcp/ip port does sql server run on? : Sql dba

519


How to take user input in pl sql?

705


Can we use pl sql in sql server?

541






What is scalar function?

569


Explain the difference between rename and alias?

543


What is the sql query to display the current date?

551


Is delete faster than truncate?

550


What is coalesce sql?

518


how to start mysql server? : Sql dba

615


What is the use of stored procedures?

519


How to raise user-defined exception with custom sqlerrm ?

682


What are different types of statements supported by sql?

609


What are stored procedures used for?

537