Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re: Problems Debugging UTL_FILE

Status
Not open for further replies.

iparkin

Programmer
Joined
Aug 3, 2005
Messages
1
Location
US
DECLARE
*
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.UTL_FILE", line 98
ORA-06512: at "SYS.UTL_FILE", line 157
ORA-06512: at line 811


SP2-0670: Internal number conversion failed

I get the above error report whenever I run/compile a program with UTL_FILE components. I was told that you have to handle a number of EXCEPTIONs individually I think I got all of them, but I could be missing some Could any body enlighten me as to what I am missing.
INVALID PATH
INVALID MODE
INVALID OPERATION
INVALID FILEHANDLE
READ ERROR
WRITE ERROR
INTERNAL ERROR
I am trying to write to a text file.
 
IParkin,

The problem you are having comes with Oracle's very poor "run-time error" monitor...it doesn't identify specific lines of code where problems occur.

When I receive an obscure error message that I cannot isolate to a specific line of code, I start commenting out major code chunks until the code compiles/executes (even though the functionality is highly reduced...at least it works, right?) Then, I start "adding" back in code functionality by reducing what is commented out, and then I re-run the code. I continue that process until the code again fails. I then "re-comment" subsets of the just-uncommented code (and re-run) until I can isolate the problem to a single line of code.

With your specific situation, you have an additional possible troubleshooting opportunity: create an EXCEPTION section that uses this code:
Code:
(before starte of PL/SQL block):
SET SERVEROUTPUT ON
Declare
...
exception
    when others then
        dbms_output.put_line(sqlerrm);
end;
/
Try these ideas, then let us know how your findings.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Could you confirm that you do obtain ORA-06510 error during compile time also? This sounds quite strange for me.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top