本文介绍了如何在 SQLPlus 或 PL/SQL 中创建菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我有几个脚本,我想从提供给 SQLPlus 用户的菜单开始.类似于:
请选择:
1:做脚本a
2:做脚本b
3:做脚本c
I have several scripts that I would like to start from a menu presented to the SQLPlus user. Something like:
Please make a selection:
1: Do script a
2: Do script b
3: Do script c
我只需要一个正确方向的观点,而不是一个快速的答案.
I just need a point in the right direction, not a quick answer.
推荐答案
这是一个 SQL Plus 脚本:
Here is a SQL Plus script to do that:
prompt Please make a selection:
prompt 1: Do script a
prompt 2: Do script b
prompt 3: Do script c
accept selection prompt "Enter option 1-3: "
set term off
column script new_value v_script
select case '&selection.'
when '1' then 'script_a'
when '2' then 'script_b'
when '3' then 'script_c'
else 'menu'
end as script
from dual;
set term on
@&v_script.
注意 case 表达式的 ELSE 部分中的菜单"是此脚本的名称,以便在用户输入无效选项时它会再次运行.
NB The 'menu' in the ELSE part of the case expression is the name of this script, so that it runs itself again when the user enters an invalid option.
这篇关于如何在 SQLPlus 或 PL/SQL 中创建菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
The End


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)