tags:

views:

67

answers:

1

Hi all,

I have a small problem using oracle pl sql. I have a sql file with some cursor, etc, and the treatement fail but with no details. I have an idea about the problem (a function with parameters) but I would like to see the parameter for each call, to be able to debug, to see exactly with wich parameter fail. This is the message:

DECLARE
*
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 165
ORA-06512: at line 260

Is there something to set to be able to see some details ?

I'm launching my treatement like this

sqlplus -L $ORA_CONNECT @$FIC_REQ 

Thanks.

Best regards, C.C.

+2  A: 

This error occurs when you try to Select Into a variable, but your select returns more than one row.

Check these lines in your script:
165 and 260 (as displayed in the stacktrace of the error).


To output your parameters dbms_output should work. Test the following script:

Set Serveroutput On

Begin
  dbms_output.put_line('Test');
End;
/
Peter Lang
As I said, I have an idea about the error, but I need to see the parameters of a function.
CC
I tryied with dbms_output.put_line but it does not display anything.At the beginning I have set serveroutput ON;
CC
That suggests you're not reaching the point you've put your debug, so you could put `put_line` calls before the call and at earlier points.Also when running from SQL*Plus, the line numbers reported in the error are within the PL/SQL code, not line numbers of the SQL file itself, so you need to be looking at 165 and 260 lines after your `declare`.
Alex Poole
Ok, I got it, using dbms_output.put_line, I can see the output.Thanks everybody.
CC
You're welcome. I just edited my question to explain `dbms_output` when you posted your comment :)
Peter Lang
@CC: if Peter's response was helpful it would be polite to accept it.
Bob Jarvis