Skip to Main Content

SQL & PL/SQL

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!

How can i run Following SQL Server Script in to Oracle 10g

659987Sep 18 2008 — edited Sep 18 2008
I m new in Oracle...



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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 16 2008
Added on Sep 18 2008
4 comments
207 views