-- 块:定义部分、执行部分、例外处理部分
--1.定义变量:v_作为前缀
--2.定义常量:c_作为前缀
--3.定义游标:_cursor作为后缀
--4.定义例外:e_作为前缀
declear
定义部分
begin
执行部分
exception
例外处理部分
end
declare
v_name mytest.name%type;
v_password mytest.password%type;
begin
select name,password into v_name,v_password from mytest where name=&name;
dbms_output.put_line('姓名:'||v_name||' 密码:'||v_password);
exception
when no_data_found then
dbms_output.put_line('编号输入错误,请重新输入');
end;