原文地址:http://blog.csdn.net/drbing/article/details/51821262 截止到目前我发现有三种方法可以在存储过程中给变量进行赋值:1.直接法 := 如:v_flag := 0;2.select into 如:假设变量名为v_flag,select count(*) into v_flag from students;3.execute immediate 变量名(一般是sql的select语句) into 变量名 如: …
截止到目前我发现有三种方法可以在存储过程中给变量进行赋值: 1.直接法 := 如:v_flag := 0; 2.select into 如:假设变量名为v_flag,select count(*) into v_flag from students; 3.execute immediate 变量名(一般是sql的select语句) into 变量名 如: v_sqlfalg := 'select count(*) from user_tables where table_name='…
create or replace function get_sal1(id employees.employee_id%type) return number is sal employees.salary%type; begin sal := 0; select salary into sal from employees where employee_id = id; return sal; end; create or replace function get_sal1(id emplo…