可信智能计算服务 TICS-分支语句:示例

时间:2023-11-05 10:55:03

示例

CASE
 WHEN pi_flag = 'PRI' THEN
     UPDATE tbl_mmaxtuple
     SET i_num =  pi_maxtuple
     WHERE i_moduletype = pi_moduletype 
         AND i_moduleno = pi_moduleno 
         AND i_tableid = pi_tableid;
     pi_returncode := 0;
 WHEN pi_flag = 'PUB' THEN
     UPDATE tbl_pmaxtuple
     SET i_num =  pi_maxtuple
     WHERE (i_moduletype = pi_moduletype 
            OR i_moduletype = pi_moduletype + 10000) 
         AND i_tableid = pi_tableid;
     pi_returncode := 0;
 WHEN pi_flag = 'GLO' THEN
     UPDATE  tbl_gmaxtuple
     SET i_num = pi_maxtuple
     WHERE i_tableid = pi_tableid;
     pi_returncode := 0;
 ELSE
     pi_returncode := 415055;
END CASE;

CASE pi_result
    WHEN 1 THEN 
        pi_returncode  := pi_pts_error_code;
    WHEN 2 THEN 
        pi_returncode  := pi_panw_error_code;
    WHEN 3 THEN 
        pi_returncode  := pi_preq_error_code;
    WHEN 6 THEN 
        pi_returncode  := pi_cmdunsp_error_code;
    WHEN 7 THEN 
        pi_returncode  := pi_dtunsp_error_code;
    WHEN 8 THEN 
        pi_returncode  := pi_comm_error_code;
    WHEN 9 THEN 
        pi_returncode  := pi_toolarge_error_code;
    WHEN 10 THEN 
        pi_returncode  := pi_smm_not_exist_error_code;
    ELSE 
        pi_returncode  := pi_rstivd_error_code;
END CASE;
support.huaweicloud.com/usermanual-tics/tics_rtd_01_0054.html