Getting error while using UTL files
I'm getting following error -
ORA-29282: invalid file ID ORA-06512: at "SYS.UTL_FILE", line 774 ORA-06512: at "IMPORT_NEW", line 781 ORA-01722: invalid number
To used UTL i have done following steps -
1. created directory
2. grant read, write to that directory from sys
but every time I'm getting above error.
Can any one tell me, where am I going wrong?
here is the basic code...
CREATE OR REPLACE PROCEDURE import_new
|| TO_CHAR (SYSDATE, 'YYMMDDHH24MI')
vsfile := UTL_FILE.fopen ('import_LOG', logfilename, 'w');
'No treatments have been done, Data are already in Source area.'
UTL_FILE.put_line (vsfile, '');
'Run began on '
|| TO_CHAR (beginrun, 'DAY MON DD HH24:MI:SS')
'Run ended on '
|| TO_CHAR (endrun, 'DAY MON DD HH24:MI:SS')