adspace


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

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

1156


Can delete statement be rollbacked?

1065


Is inner join faster than left join?

1287


Is primary key always clustered index?

1101


Can we rollback truncate?

1083


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

1124


What is your daily office routine?

2353


What is the current version of postgresql?

1188


Is primary key clustered index?

1028


what are the advantages of sql ? : Sql dba

1154


what is bcp? When does it used? : Sql dba

1065


what is collation? : Sql dba

1242


what are all the common sql function? : Sql dba

1141


define sql insert statement ? : Sql dba

1110


Does group by remove duplicates?

1121