unable to write a binary file using utl_file. Please help.
670117Nov 12 2008 — edited Nov 14 2008I am unable to generate a binary file, see the code below. The same code works fine if I specify file_open mode as "w" instead of "wb" and creates a file in the directory. I have permission to write to directory. Please help me if there is anything else that needs to be done to get binary file generated.
declare
l_output utl_file.file_type;
begin
l_output := utl_file.fopen( 'RM_MHE_IN_DIR', 'test.dat', 'wb' );
utl_file.put_raw( l_output, utl_raw.cast_to_raw('hello world') );
utl_file.fclose( l_output );
end;
/
ORA-29281: invalid mode