Hi
I have created a procedure using UTL_FILE.
Before executing the procedure i created a directory as
[code=oracle]
connect system/system;
grant execute on sys.utl_file to PUBLIC;
alter system set processes=500 scope=spfile;
grant read, write on directory gams to public;
connect san/san;
create or replace directory gams as 'C:\gamsdir';
CREATE OR REPLACE PROCEDURE Empl
IS
f utl_file.file_t ype;
begin
f := utl_file.fopen( 'GAMS', 'test.txt', 'w');
utl_file.put_li ne(f, 'line one: some text');
utl_file.put_li ne(f, 'line two: more text');
utl_file.fclose (f);
end;
/
--It gives the errors as
/*ERROR at line 1:
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FI LE", line 475
ORA-29283: invalid file operation
ORA-06512: at "SAN.EMPL", line 5
ORA-06512: at line 1*/
[/code]
How can i create the directory?
How can i create the utl_file_dir and how can i set that directory in init.ora?
what can i do?
Any Help???
Thank you
I have created a procedure using UTL_FILE.
Before executing the procedure i created a directory as
[code=oracle]
connect system/system;
grant execute on sys.utl_file to PUBLIC;
alter system set processes=500 scope=spfile;
grant read, write on directory gams to public;
connect san/san;
create or replace directory gams as 'C:\gamsdir';
CREATE OR REPLACE PROCEDURE Empl
IS
f utl_file.file_t ype;
begin
f := utl_file.fopen( 'GAMS', 'test.txt', 'w');
utl_file.put_li ne(f, 'line one: some text');
utl_file.put_li ne(f, 'line two: more text');
utl_file.fclose (f);
end;
/
--It gives the errors as
/*ERROR at line 1:
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FI LE", line 475
ORA-29283: invalid file operation
ORA-06512: at "SAN.EMPL", line 5
ORA-06512: at line 1*/
[/code]
How can i create the directory?
How can i create the utl_file_dir and how can i set that directory in init.ora?
what can i do?
Any Help???
Thank you
Comment