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
    逃避不一定躲得过,面对不一定最难过
  • 相关阅读:
    豆豆
    艺术家
    姐姐
    书名与歌名
    MySQL
    杂文
    武侠
    青年诗人
    那些歌
    传世
  • 原文地址:https://www.cnblogs.com/yangzhenlong/p/3542946.html
Copyright © 2011-2022 走看看