将 PL/SQL 过程结果放入变量中
Getting PL/SQL procedure result into a variable
我想将 PL/SQL 过程的结果分配给变量 aa_idstu 并在 Oracle Forms 预块触发器中使用此变量。
我的程序:
select id_stu
into aa_idstu
from k_student
where id_stu=30
我想在 Oracle Forms Builder 版本 6.0.8.26.0
中使用 aa_idstu
您已经掌握了一切 - 只需将该代码放入 PRE-BLOCK
触发器即可。不过,您首先需要 DECLARE
变量:
-- PRE-BLOCK trigger
declare
aa_idstu k_student.id_stu%type;
begin
select id_stu
into aa_idstu
from k_student
where id_stu = 30;
end;
我不知道一旦你得到它的值你将如何处理这个变量,但我想你会这样做。
此外,请注意可能的 NO_DATA_FOUND
和 TOO_MANY_ROWS
- 如果 WHERE
条件不是 return 单个值,那么 SELECT
将失败所以你必须以某种方式处理它。
我想将 PL/SQL 过程的结果分配给变量 aa_idstu 并在 Oracle Forms 预块触发器中使用此变量。
我的程序:
select id_stu
into aa_idstu
from k_student
where id_stu=30
我想在 Oracle Forms Builder 版本 6.0.8.26.0
中使用 aa_idstu您已经掌握了一切 - 只需将该代码放入 PRE-BLOCK
触发器即可。不过,您首先需要 DECLARE
变量:
-- PRE-BLOCK trigger
declare
aa_idstu k_student.id_stu%type;
begin
select id_stu
into aa_idstu
from k_student
where id_stu = 30;
end;
我不知道一旦你得到它的值你将如何处理这个变量,但我想你会这样做。
此外,请注意可能的 NO_DATA_FOUND
和 TOO_MANY_ROWS
- 如果 WHERE
条件不是 return 单个值,那么 SELECT
将失败所以你必须以某种方式处理它。