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 to avoid using cursors? What to use instead of cursor and in what cases to do so?

863


How can you load microsoft excel data into oracle? : aql loader

811


What is basic structure of pl sql?

686


What is assignment operator in pl sql?

762


How many times can we commit in a loop?

737






How many triggers can be applied to a table?

777


What is pl sql variable?

697


Is oracel sql developer written in java?

837


What are the possible values that can be stored in a boolean data field?

714


What are the sql aggregate functions?

810


what is sql in mysql? : Sql dba

812


Can we create foreign key without primary key?

705


what is single byte over head in oracle..?

2084


What does count (*) do in sql?

735


What is a table?

728