how to execute this one in plsql..
create or replace procedure p11(a in number, b out number) is begin b:=a*a; dbms_output.put_line(b); end; variable a number; variable b number;
what statement I have to give to execute; Trying to learn
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
Variables you define with the keyword
variable can be used as bind variables, not like PL/SQL variables, so you need to add a colon (
SQL> variable b number; SQL> create or replace procedure p11(a in number, b out number) is begin b:=a*a; dbms_output.put_line(b); end; / Procedure created. SQL> exec p11(10, :b); <----- ':' in front of b PL/SQL procedure successfully completed. SQL> print :b B ---------- 100
variable a number; has no effect on your program,
a is a local variable to
p11 from its argument list.