How to create a menu in SQLPlus or PL/SQL

后端 未结 6 1645
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-11 22:15

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

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 23:01

    I'd got with a real language for this (as per Pablo's comment).

    You could have some stuff in a login.sql that displayed a list suggestions when you connect (PRINT or PROMPT SQL*Plus statements).

    And you could have a bunch of scripts called 1.sql, 2.sql etc which would get run if the user entered @1, @2 etc. (as long as they are in the correct directory).

    But really SQL*Plus isn't suited for this.

提交回复
热议问题