1:冒号等于赋值 单个赋值
declare
v_name varchar2(10);
begin
v_name:='梦梦';
2:select into 赋值
select 列名 into 变量名 from 表名 where 条件
2.1 select a(值1), b(值2),c(值3) into d,e,f from emp(表名) where id=xxx;
注意点: 1:select a(值1), b(值2),c(值3) 值的个数是没有限制的,可以多个;
2:位置必须对应,a必须赋值给d;
b必须赋值给e,
c必须赋值给f;
2.2:select a(值1), b(值2),c(值3) into d,e,f from emp(表名)
1:直接从表中赋值,有多列,不能直接赋值,需要用到游标(相当于Java中的集合)
转自:https://blog.csdn.net/qq_26963433/article/details/78222800