如何使 CONNECT BY 参数可选
我有一个使用 Connect By
的程序,
SELECT <lots of fields>
FROM Group g
<joins>
WHERE <where>
CONNECT BY PRIOR g.ID = g.ParentID
START WITH g.ID = 1337
ORDER SIBLINGS BY g.Name
;
数字 1337
是该程序的一个参数,如果该值为 0
我想忽略通过
代码连接并执行其他所有操作。
我该如何处理这个问题?
I have a procedure that uses Connect By
SELECT <lots of fields>
FROM Group g
<joins>
WHERE <where>
CONNECT BY PRIOR g.ID = g.ParentID
START WITH g.ID = 1337
ORDER SIBLINGS BY g.Name
;
The number 1337
is a parameter on this procedure, if this value is 0
I would like to ignore the connect by
code and execute everything else.
How can I handle this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最明显的答案是测试
connect by
子句中的异常值:The most obvious answer is to test for the exception value in the
connect by
clause: