Home » SQL & PL/SQL » SQL & PL/SQL » Duplicate Row Containing a Long Raw Field.
icon2.gif  Duplicate Row Containing a Long Raw Field. [message #236544] Thu, 10 May 2007 04:11 Go to next message
kahlid_mehz
Messages: 10
Registered: May 2007
Location: Islamabad
Junior Member
Dear Experts!

I am trying to make a duplicate record of my table. The table contains 14 columns including one Long Raw. I have select three records to be copied. first record is successfully copied but on the second record my procedure give an error of ORA-06502: PL/SQL: numeric or value error.

--Code is Here--
procedure CopyLong(VBomID in number, VCount out number)
is
--
VImage long raw ;
--
/* cursor c1(v1 number) is
select image
from BomDrawings
where BomDrawingId = V1 ;*/
--
VId number ;
--
begin
--
VCount := 0 ;
--
select nvl(max(BomDrawingId), 0) + 1
into VId
from Bomdrawings ;
--
for bg in(select BomDrawingId
from BomDrawIngs
where BomId = VBomId) loop
--
for i in(select Bomdrawingid, Bomid, Drawingcode, Descr, Imgtype, Application,
Drawingstatus, Isactive, Filepath, Imgsize, Auther, Addedon,
Lastmodified
from Bomdrawings
where BomDrawingId = bg.bomdrawingid) loop
--
insert into Bomdrawings(Bomdrawingid, Bomid, Drawingcode, Descr, Imgtype, Application,
Drawingstatus, Isactive, Filepath, Imgsize, Auther, Addedon,
Lastmodified)
values(VId, 7, i.Drawingcode, i.Descr, i.Imgtype, i.Application,
i.Drawingstatus, i.Isactive, i.Filepath, i.Imgsize, i.Auther, i.Addedon,
i.Lastmodified) ;
--
--for m in c1(bg.Bomdrawingid) loop
--
select Image
into VImage
from Bomdrawings
where BomDrawingId = bg.bomdrawingid ;
--
update BomDrawings
set Image = VImage
where BomDrawingId = bg.bomdrawingid ;
--
--end loop ;
--
VCount := VCount + 1 ;
VId := VId + 1 ;
--
end loop ;
--
end loop ;
end CopyLong ;


please suggest what i should do. Thanks in anticipation.

[Updated on: Thu, 10 May 2007 04:56]

Report message to a moderator

Re: Duplicate Row Containing a Long Raw Field. [message #236549 is a reply to message #236544] Thu, 10 May 2007 04:28 Go to previous message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Of course posting your code, a copy and paste of your execution, your Oracle version is completly irrelevant and useless.

Regards
Michel
Previous Topic: Passing variable in IN clause with more than one values
Next Topic: Searching excluding certain characters
Goto Forum:
  


Current Time: Thu Dec 08 02:08:25 CST 2016

Total time taken to generate the page: 0.16638 seconds