zoukankan      html  css  js  c++  java
  • SQL——存储过程实例 调用带参数的过程(成绩输出)

    create or replace procedure test_score(input in number,output out char) is
    
    begin
    
           if input>=90 then
           begin
              output := 'A';
           end;
           end if;
           
           if input<90 then
           begin
              output := 'B';
           end;
           end if;
           
           if input<80 then
           begin
              output := 'C';
           end;
           end if;
           
            if input<70 then
           begin
              output := 'D';
           end;
           end if;
           
            if input<60 then
           begin
              output := 'E';
           end;
           end if;
           
           dbms_output.put_line('成绩为:'||output);
    end test_score;

    调用:

    declare 
         sr number;--输入参数
         sc char;--输出参数
    begin
         sr := 70;
         test(sr,sc);
    end;

    结果:

    成绩为:C
    逃避不一定躲得过,面对不一定最难过
  • 相关阅读:
    杨辉三角
    手动实现md5加密
    戳气球
    重构字符串
    四数相加 II
    背包问题 II
    组合总和 IV
    背包问题 V
    背包问题
    Win 10安装Python及环境变量配置
  • 原文地址:https://www.cnblogs.com/yangzhenlong/p/3542946.html
Copyright © 2011-2022 走看看