How to Execute stored procedure from SQL Plus?

后端 未结 2 1020
暖寄归人
暖寄归人 2021-01-05 02:31

I have a stored procedure in oracle and want to test it from SQLPlus.

If I use

execute  my_stored_proc (-1,2,0.01) 

I get this erro

相关标签:
2条回答
  • 2021-01-05 02:36

    You forgot to put z as an bind variable.

    The following EXECUTE command runs a PL/SQL statement that references a stored procedure:

    SQL> EXECUTE -
    > :Z := EMP_SALE.HIRE('JACK','MANAGER','JONES',2990,'SALES')
    

    Note that the value returned by the stored procedure is being return into :Z

    0 讨论(0)
  • 2021-01-05 02:59

    You have two options, a PL/SQL block or SQL*Plus bind variables:

    var z number
    
    execute  my_stored_proc (-1,2,0.01,:z)
    
    print z
    
    0 讨论(0)
提交回复
热议问题