• Oracle function


     

    CREATE OR REPLACE FUNCTION Check_Bond_By_Item (p_Organization_Id    NUMBER,                                                                                   

                                  p_Dept_Part          VARCHAR2,

                                                               p_ebpt_item_type     NUMBER)

       RETURN VARCHAR2

    IS

       x_Hs_Code_t   Msl_Bnd_Ems_Lines.Hs_Code_t%TYPE;

       x_site        VARCHAR2 (10);

     

       CURSOR Cur_ems

       IS

          SELECT Ems_No

            FROM Msl_Bnd_Ems_Headers Mbeh

           WHERE Mbeh.Site = x_Site AND Ems_Type = 8;

     

       x_Return      VARCHAR2 (2);

    BEGIN

       BEGIN

          SELECT Site

            INTO x_Site

            FROM Org_Organization_Web Oow

           WHERE Oow.Organization_Id = p_Organization_Id;

       EXCEPTION

          WHEN OTHERS

          THEN

             x_Site := '';

       END;

     

       FOR C1r IN Cur_ems

       LOOP

          BEGIN

             SELECT Hs_Code_t

               INTO x_Hs_Code_t

               FROM Msl_Bnd_Ebpt

              WHERE     Dept_Part = p_Dept_Part

                    AND Ems_No = C1r.Ems_No

                    AND Hs_Code_t IS NOT NULL

                    AND ebpt_item_type = p_ebpt_item_type

                    AND ROWNUM = 1;

          EXCEPTION

             WHEN OTHERS

             THEN

                BEGIN

                   SELECT Hs_Code_t

                     INTO x_Hs_Code_t

                     FROM Msl_Bnd_Twins_Ebpt

                    WHERE     Dept_Part = p_Dept_Part

                          AND Ems_No = C1r.Ems_No

                          AND Hs_Code_t IS NOT NULL

                          AND ebpt_item_type = p_ebpt_item_type

                          AND ROWNUM = 1;

                EXCEPTION

                   WHEN OTHERS

                   THEN

                      x_Return := 'N';

                END;

          END;

     

          IF x_Hs_Code_t IS NOT NULL

          THEN

             x_Return := 'Y';

             GOTO return_value;

          END IF;

       END LOOP;

     

      <<return_value>>

       RETURN NVL (x_Return, 'N');

    END;

  • 相关阅读:
    微信中打开 input file 在安卓设备上没有拍照功能
    vue跳转页面在个别手机返回首页index问题
    高德地图在vue-cli中的引用
    express接受图片
    几种在js中循环数组的方法
    vue 组件小例子 this.$parent
    vue.js与后台{{}}冲突的解决办法
    vue弹出框动画
    jq模仿下拉菜单select
    Java字节数组和16进制字符串的互相转化
  • 原文地址:https://www.cnblogs.com/quanweiru/p/2616128.html
Copyright © 2020-2023  润新知