adspace


how can i read write files from pl/sql

Answer Posted / avi007

--Read file

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is inner join faster than left join?

1287


What is the current version of postgresql?

1188


What is the current version of sql?

1106


how many tables will create when we create table, what are they? : Sql dba

1154


Can we use distinct and group by together?

1146


Can delete statement be rollbacked?

1065


how to use regular expression in pattern match conditions? : Sql dba

1125


Can we rollback truncate?

1083


what are aggregate and scalar functions? : Sql dba

1142


Do we need to rebuild index after truncate?

1151


How do I remove duplicates in two columns?

1201


how to escape special characters in sql statements? : Sql dba

1124


what are the advantages of sql ? : Sql dba

1153


what is collation? : Sql dba

1242


define sql insert statement ? : Sql dba

1108