posted in Oracle 

-- 在 BEGIN 之前定义变量 v_smoke_flag 
-- 在 BEGIN 之前定义游标
cursor cur_smoke_flag is
    select smoke_flag
    from uw_apply_info uai, uw_apply_product uap
    where uai.apply_no = uap.apply_no
    and uap.product_code = p_product_info.product_code
    and uai.policy_no = p_policy_no;
    
-- 在 BEGIN 之后使用游标  v_smoke_flag可以不用定义 直接使用
open cur_smoke_flag;
fetch cur_smoke_flag into v_smoke_flag;
close cur_smoke_flag;