Home » RDBMS Server » Server Administration » ORA-06502 error please help
ORA-06502 error please help [message #369943] Wed, 08 November 2000 23:23 Go to next message
Deepa
Messages: 269
Registered: November 2000
Senior Member
Hi,
I am executing a procedure to insert values into a table containing CLOB .

The procedure looks like this:
PROCEDURE putoldcontent (artid IN NUMBER,body in long,pno in number)
IS
c clob;
BEGIN
insert into pagesold values ( artid, empty_clob(),pno)
returning lbody into c;
dbms_lob.writeappend( c, length(body), body );
END;


I am getting the following error while executing the procedure:
ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.DBMS_LOB", line 722

Please help. It is urgent

Thanks
Deepa
Re: ORA-06502 error please help [message #369945 is a reply to message #369943] Thu, 09 November 2000 14:38 Go to previous message
jag Anegondi
Messages: 3
Registered: November 2000
Junior Member
Hi deepa

You will get this error if you pass an invalid value for one of the arguments of DBMS_LOB, I belive you must be passing NULL to body parameter of the procedure.

Have a look at this

SQL> create table xx(artid number,name clob,pno number);

Table created.

sql> create or replace procedure test1(artid in number,name long,pno number) as
x clob;
begin
nsert into xx values(artid,empty_clob(),pno) returning name into x;
dbms_lob.append(x,length(name),1,name);
end test1;

Procedure created.

SQL> execute test1(1,'jagannadh',2);

PL/SQL procedure successfully completed.

SQL> execute test1(2,'',3);
BEGIN test1(2,'',3); END;

*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_LOB", line 526
ORA-06512: at "MDS_PTS.TEST1", line 5
ORA-06512: at line 1

Here, you can see i am passing an empty string to the procedure, which in turn passes invalid value for AMOUNT and BUFFER arguments of DBMS_LOB.

The same thing should be happening with you. Check whether you are passing not null value for body parameter.

I hope this helps.

Thanks

Jag
Previous Topic: SQL
Next Topic: Deleting from large table
Goto Forum:
  


Current Time: Thu May 02 17:05:05 CDT 2024