-
根据数据库输出XML菜单
- USE [test_YTHH]
- GO
- /****** Object: StoredProcedure [dbo].[usp_Print_SCC_Menu] Script Date: 04/08/2013 11:21:23 ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
-
-
- ——————————–
- –简易输出Sys菜单
- —BY HXL
- —20136–04–08
- ——————————–
- CREATE PROC [dbo].[usp_Print_Sys_Menu]
- AS
- BEGIN
-
- DECLARE @parentID INT
- DECLARE @text NVARCHAR(20)
- DECLARE @value CHAR(7)
- DECLARE @text2 NVARCHAR(20)
- DECLARE @value2 CHAR(7)
- DECLARE p_cur CURSOR FOR SELECT FunctionName,FunctionCode,FunctionID FROM dbo.[Function] WHERE ParentID = 6001 AND FunctionType = 1
- OPEN p_cur
-
- FETCH NEXT FROM p_cur INTO @text,@value ,@parentID
- WHILE @@FETCH_STATUS = 0
- BEGIN
-
- –父菜单
- PRINT ‘ <Menu id=”‘+@value+‘” text=”‘+@text+‘” iconCls=”Frame_Main_icon11″>’
-
- –子菜单
- DECLARE sub_cur CURSOR FOR SELECT FunctionName,CAST(FunctionCode AS NVARCHAR(20)) FROM dbo.[Function] WHERE ParentID = @parentID AND FunctionType = 2
- OPEN sub_cur
- FETCH NEXT FROM sub_cur INTO @text2,@value2
- WHILE @@FETCH_STATUS = 0
- BEGIN
- PRINT ‘ <Menu id=”‘+@value2+‘” pid=”‘+@value+‘” text=”‘+@text2+‘” url=”../DBM/”></Menu> ‘
- FETCH NEXT FROM sub_cur INTO @text2,@value2
- END
-
- CLOSE sub_cur
- DEALLOCATE sub_cur
-
- PRINT ‘</Menu>’
- FETCH NEXT FROM p_cur INTO @text,@value,@parentID
-
- END
- –关闭游标
- CLOSE p_cur
- –释放资源
- DEALLOCATE p_cur
-
- END
- 转载自:http://www.aspnetjia.com/Cont-49.html
-
相关阅读:
UML_状态图
UML_时序图
UML_类图
浅谈依赖注入
MyEclipse_搭建SSH框架
AOP:面向切面编程
工厂模式
(转)oracle使用expdp、impdp和exp、imp导入导出表及表结构
oracle exp 和 imp 数据和表结构互相独立导出导入
oracle 清空当前用户所有对象
-
原文地址:https://www.cnblogs.com/aspnetjia/p/5141120.html
Copyright © 2020-2023
润新知