Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

help me for oracle stored procedure cursor

597154Sep 15 2008 — edited Sep 15 2008
hi

i am newbie to sql server and also at oracle 9i stored procedure cursor

i have one stored procedure which has sql server format

can anybody help me conver this



Create Procedure Insert_profilebasicdetail
(
@isubprofileid as int,
@Copyisubprofileid as int,
@itranno as int,
)
As
Begin


Declare @IncKeyId as int
Declare @tempkeyId as int
set @IncKeyId=(select isNull(Max(ikeyId),0)as MaxKeyId from profilebasicdetail)


Declare TempInsert cursor for select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
from profilebasicdetail where [isubprofileid=@Copyisubprofileid|mailto:isubprofileid=@Copyisubprofileid] and [itranno=@itranno|mailto:itranno=@itranno]
open TempInsert
fetch from TempInsert into @tempkeyId
while @@fetch_Status=0
Begin

set @IncKeyId = @IncKeyId + 1

Insert into profilebasicdetail
(ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
values(select @IncKeyId,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,'1',
iyear,@isubprofileid from profilebasicdetail where [ikeyId=@tempkeyId|mailto:ikeyId=@tempkeyId])


fetch next from TempInsert into @tempkeyId
End


End


-----------------------------------------------


really required

This post has been answered by Pavan Kumar on Sep 15 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 13 2008
Added on Sep 15 2008
6 comments
278 views