开发者

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜