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 conver following SQL server script in to Oracle Script

659987Sep 16 2008 — edited Sep 23 2008
could any one help me to conver following script in to oracle script




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 and 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)

fetch next from TempInsert into @tempkeyId
End

End





Regards,
Ajay
This post has been answered by JustinCave on Sep 19 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 21 2008
Added on Sep 16 2008
22 comments
951 views