adspace
Answer Posted / Naveen Chand
Creating a menu in SQL*Plus or PL/SQL involves creating a stored procedure that displays options and calls other procedures based on user input. Here's a simple example:
```plsql
CREATE OR REPLACE PROCEDURE my_menu AS
option NUMBER;
BEGIN
DBMS_OUTPUT.PUT_LINE('Menu');
DBMS_OUTPUT.PUT_LINE('1 - Option A');
DBMS_OUTPUT.PUT_LINE('2 - Option B');
DBMS_OUTPUT.PUT_LINE('3 - Exit');
DBMS_OUTPUT.FLUSH;
COMMIT;
SELECT count(*) INTO option FROM dual WHERE TRUE;
IF option = 1 THEN
my_procedure_a;
ELSIF option = 2 THEN
my_procedure_b;
END IF;
END my_menu;
```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is dbms? : Sql dba
what are all the common sql function? : Sql dba
Can delete statement be rollbacked?
how many tables will create when we create table, what are they? : Sql dba
If a cursor is open, how can we find in a pl/sql block?
define sql insert statement ? : Sql dba
What is the current version of postgresql?
how to use regular expression in pattern match conditions? : Sql dba
what are the advantages of sql ? : Sql dba
What is the best sql course?
Is inner join faster than left join?
What is your daily office routine?
Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me
Can we use distinct and group by together?
what is collation? : Sql dba