problem of utl file [message #478594] |
Mon, 11 October 2010 03:35 |
narang79
Messages: 137 Registered: June 2010
|
Senior Member |
|
|
sir
following text is used in procedure
but it will create some problem
UTL_FILE.FOPEN('TDS','form26q.txt','w')
how i can check through toad what is the ptroblem
|
|
|
|
|
|
|
Re: problem in utl. file [message #478605 is a reply to message #478604] |
Mon, 11 October 2010 05:05 |
narang79
Messages: 137 Registered: June 2010
|
Senior Member |
|
|
ERROR at line 1:
ORA-04067: not executed, package body "ALLENGERSDB.UTL_FILE" does not exist
ORA-06508: PL/SQL: could not find program unit being called:
"ALLENGERSDB.UTL_FILE"
ORA-06512: at "ALLENGERSDB.CREATE_FILEF26Q", line 40
ORA-06512: at line 1
|
|
|
|
|
|
Re: problem of utl file [message #478625 is a reply to message #478624] |
Mon, 11 October 2010 05:59 |
narang79
Messages: 137 Registered: June 2010
|
Senior Member |
|
|
declare
handle utl_file.file_type;
begin
handle := utl_file.fopen('TDS','form26q.txt','W');
utl_file.fclose(handle);
end;
Error at line 1
ORA-04067: not executed, package body "ALLENGERSDB.UTL_FILE" does not exist
ORA-06508: PL/SQL: could not find program unit being called: "ALLENGERSDB.UTL_FILE"
ORA-06512: at line 4
Script Terminated on line 1.
|
|
|
Re: problem of utl file [message #478628 is a reply to message #478625] |
Mon, 11 October 2010 06:05 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
So, you are connected as ALLENGERSDB. Right? Where did you grant EXECUTE on UTL_FILE to it? Connect as a privileged user, run the following statement and copy/paste the output:select * from all_synonyms where synonym_name = 'UTL_FILE';
[Updated on: Mon, 11 October 2010 06:05] Report message to a moderator
|
|
|
Re: problem of utl file [message #478631 is a reply to message #478628] |
Mon, 11 October 2010 06:10 |
narang79
Messages: 137 Registered: June 2010
|
Senior Member |
|
|
yes i have connected in allengersdb
rights given in sys/dba
message when script run is
OWNER SYNONYM_NAME
------------------------------ ------------------------------
TABLE_OWNER TABLE_NAME
------------------------------ ------------------------------
DB_LINK
--------------------------------------------------------------------------------
PUBLIC UTL_FILE
SYS UTL_FILE
|
|
|
|
Re: problem of utl file [message #478646 is a reply to message #478641] |
Mon, 11 October 2010 07:22 |
narang79
Messages: 137 Registered: June 2010
|
Senior Member |
|
|
we are using oracle 10.2.0.4
yes if i seen in allengers db then i found spec there not body
but in sys i seen spec & body both
but if i run UTLFILE.SQL script (connect as SYS). but after that found only spec in allengersdb not found body
|
|
|
Re: problem of utl file [message #478649 is a reply to message #478646] |
Mon, 11 October 2010 07:45 |
narang79
Messages: 137 Registered: June 2010
|
Senior Member |
|
|
but i manually created pack body from sysdba to allengersdb then it shows
SQL> declare
2 handle utl_file.file_type;
3 begin
4 handle := utl_file.fopen('TDS','form26q.txt','W');
5 utl_file.fclose(handle);
6 end;
7 /
declare
*
ERROR at line 1:
ORA-06521: PL/SQL: Error mapping function
ORA-06512: at "ALLENGERSDB.UTL_FILE", line 29
ORA-06512: at "ALLENGERSDB.UTL_FILE", line 448
ORA-06512: at line 4
|
|
|
Re: problem of utl file [message #478650 is a reply to message #478649] |
Mon, 11 October 2010 07:52 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I don't think that you should create UTL_FILE in your own schema; it is supposed to exist in SYS schema, and SYS should grant EXECUTE on UTL_FILE to other users. A public synonym exists so that everyone could use it (without specifying owner's name (that would be SYS)) ("everyone" here means "everyone who owns privileges to use it).
|
|
|