Interactive PL/SQL script
How do I write a PL/SQL script that acceptsthe user input like in the following format?
1 : Output Customers
2 : Output Employees
3 : Output Tran开发者_如何学Pythonsactions
Enter your option (1/2/3) :
Thanks, Pradeep
If you're running in sqlplus something like this
PROMPT 1 : Output Customers
PROMPT 2 : Output Employees
PROMPT 3 : Output Transactions
DEFINE option = &enter_your_option
BEGIN
IF( '&option' = '1' )
THEN
....
ELSIF( '&option' = '2' )
THEN
....
ELSIF( '&option' = '3' )
THEN
....
ELSE
RAISE error;
END IF;
END;
精彩评论