name out varchar2 ) as
begin
select name into name from test where id = id;
dbms_output.put_line(name);
exception
when no_data_found then
dbms_output.put_line('no such bill');
end;
/
---exec----
2种方式
no 1.
SQL> DECLARE
2name varchar(2);
3BEGIN
4ASAS(1,:name);
5END;
6/
test
test
PL/SQL procedure successfully completed
name
---------
test
no 2.
SQL> var name varchar2(10);
SQL> call asas(1,:name);
Method called
name
---------
test