为了账号安全,请及时绑定邮箱和手机立即绑定

一段存储过程

标签:
SQL Server

         CREATE PROCEDURE SS.SP_PARENTSELECTLIST ( IN P_MENUID INTEGER,IN P_TYPEFLAG VARCHAR(30))
DYNAMIC RESULT SETS 1
------------------------------------------------------------------------
-- SQL 存储过程
-- selfId 自身的ID
------------------------------------------------------------------------
P1: BEGIN-- 声明游标
DECLARE LIST CURSOR WITH RETURN FOR
with temptable(rowid,lastupdateuserDr,menuDr,name,conditionalexpression,caption,image,linkurl,leafflag,sequence,
shortcutkey,type,showinnewwindow,style,javascriptfile,javascriptfunction,valueexpression,
chart,chartbook,tree,component,target,lastupdatedate,lastupdatetime,javaclass,javamethod,validbean) as
(
select  menu.ROWID as rowid,menu.LASTUPDATEUSER_DR as lastupdateuserDr,menu.MENU_DR as menuDr,
menu.NAME as name,menu.CONDITIONALEXPRESSION as conditionalexpression,menu.CAPTION as caption,
menu.IMAGE as image,menu.LINKURL as linkurl,menu.LEAFFLAG as leafflag,menu.SEQUENCE as sequence,
menu.SHORTCUTKEY as shortcutkey,menu.TYPE as type,menu.SHOWINNEWWINDOW as showinnewwindow,
menu.STYLE as style,menu.JAVASCRIPTFILE as javascriptfile,menu.JAVASCRIPTFUNCTION as javascriptfunction,menu.VALUEEXPRESSION as valueexpression,
menu.CHART as chart,menu.CHARTBOOK as chartbook,menu.TREE as tree,menu.COMPONENT as component,
menu.TARGET as target,menu.LASTUPDATEDATE as lastupdatedate,menu.LASTUPDATETIME as lastupdatetime,
menu.JAVACLASS as javaclass,menu.JAVAMETHOD asjavamethod ,
menu.VALIDBEAN as validbean
from SS.T_MENU menu
where rowid=P_MENUID
union all
select sub.ROWID as rowid,sub.LASTUPDATEUSER_DR as lastupdateuserDr,sub.MENU_DR as menuDr,
sub.NAME as name,sub.CONDITIONALEXPRESSION as conditionalexpression,sub.CAPTION as caption,
sub.IMAGE as image,sub.LINKURL as linkurl,sub.LEAFFLAG as leafflag,sub.SEQUENCE as sequence,
sub.SHORTCUTKEY as shortcutkey,sub.TYPE as type,sub.SHOWINNEWWINDOW as showinnewwindow,
sub.STYLE as style,sub.JAVASCRIPTFILE as javascriptfile,sub.JAVASCRIPTFUNCTION as javascriptfunction,sub.VALUEEXPRESSION as valueexpression,
sub.CHART as chart,sub.CHARTBOOK as chartbook,sub.TREE as tree,sub.COMPONENT as component,
sub.TARGET as target,sub.LASTUPDATEDATE as lastupdatedate,sub.LASTUPDATETIME as lastupdatetime,
sub.JAVACLASS as javaclass,sub.JAVAMETHOD asjavamethod ,
sub.VALIDBEAN as validbean
from SS.T_MENU sub,temptable super
where super.rowid=sub.MENU_DR
)select * from T_MENU where TYPE=P_TYPEFLAG and rowid not in (select rowid from temptable);-- 游标对客户机应用程序保持打开
OPEN list;END P1

点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消