• ORACLE存储过程语法


    ORACLE 存储过程的基本语法如下:

    create or replace procedure 存储过程名(参数) is或as

    声明参数

    begin

    代码

    end 存储过程名。

    其中or replace代表如果没有此存储过程则创建,如果有的话则更新存储过程。

    下面是一个存储过程的简单例子:

    create or replace procedure Vid_UnRegStateNoCharging
    (
        pTelno in varchar2,
        pClass in number,
        pVid in out varchar2,
        pAgent in varchar2,
        pRole in varchar2,
        pRe out number,
        pDesc out varchar2
    )
    is
        tTmpNum number:=0;
        tVidOnUnRegReNotes number:=0;
    begin
        select count(*) into tTmpNum from t_online where TELNO = pTelno;
        if(tTmpNum < 1) then
             select count(*) into tVidOnUnRegReNotes from T_UNREG_LOG  where TELNO = pTelno ;
             if(tVidOnUnRegReNotes>1) then
             pRe :=10;
             pDesc:='用户已注销,无法计费.';
            return;
            end if;
        end if;
        commit;
        pRe :=0;
        pDesc :='正常';
        return;
    end Vid_UnRegStateNoCharging;

    存储过程里可以有一些逻辑判断,也可以存储过程调用存储过程,上面的In 代表输入参数,out代表输出参数。

  • 相关阅读:
    网页解析Jsoup简单使用
    ios开发中加载的image无法显示
    数据懒加载
    ijkplayer
    ijkplayer的一些优化
    Ambiguous expansion of macro weakify和Ambiguous expansion of macro strongify的警告
    xcode11新项目删除main.storyboard 两种方法
    iOS
    iOS
    iOS 12中获取WiFi的SSID
  • 原文地址:https://www.cnblogs.com/dashouqianxiaoshou/p/4535746.html
Copyright © 2020-2023  润新知