Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

Converting SQL script to Oracle

$
0
0

I created on stored procedure in SQl,Please help me in translating the same into Oracle syantax.

ALTER Procedure [dbo].[USP_CustomList_SetMenuOrder](
@RepositoryName AS VARCHAR(250)
)
AS
BEGIN

DECLARE @MaxMenuOrder INT
select @MaxMenuOrder = ISNULL(MAX(MenuOrder),0) from SKENavigationDetails

Declare @TempNavigation table(
Id int Identity(1,1),
SKId uniqueIdentifier not null,
ParentItemId uniqueIdentifier null,
MenuOrder int null
);

Insert into @TempNavigation
select Id,ParentItemId,ROW_NUMBER() OVER(PARTITION BY ParentItemId ORDER BY Id) as MenuOrder from SKENavigationDetails where MenuOrder=0

Update SKENavigationDetails
set MenuOrder = CASE When tmp.ParentItemId is not null Then (tmp.MenuOrder*10) Else @MaxMenuOrder + tmp.MenuOrder*10 End
from @TempNavigation as tmp
where SKENavigationDetails.Id=tmp.SKId and Application = @RepositoryName

END


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>