首页 数据库 mysql教程 Oracle中通过游标执行带参数的存储过程实现解析CLOB字段内的xml

Oracle中通过游标执行带参数的存储过程实现解析CLOB字段内的xml

Jun 07, 2016 pm 03:32 PM
oracle 参数 存储 实现 执行 游标 解析 过程 通过

摘要:近来之前的项目数据出现了问题,原因是由于之前在设计数据库的时候把时间字段设置成了字符串式,所以给后期的数据操作带来了很大的麻烦,这里提醒一下各位程序猿,以后在开发项目的时候时间字段一定要是时间字段,不要为了方便操作就设成字符串,这样

摘要:近来之前的项目数据出现了问题,原因是由于之前在设计数据库的时候把时间字段设置成了字符串格式,所以给后期的数据操作带来了很大的麻烦,这里提醒一下各位程序猿,以后在开发项目的时候时间字段一定要是时间字段,不要为了方便操作就设成字符串,这样后期改你带来的麻烦是你想象不到的,接下来就看看我解决这个问题的方法吧!

一:存储数据的零时表:

Oracle中通过游标执行带参数的存储过程实现解析CLOB字段内的xml

二:零时表里CLOB字段里面存储的xml字符串格式:

Oracle中通过游标执行带参数的存储过程实现解析CLOB字段内的xml












三:存储解析完成的xml的数据表:

Oracle中通过游标执行带参数的存储过程实现解析CLOB字段内的xml

四:执行解析CLOB字段里面xml字符串的存储过程SQL:

CREATE OR REPLACE PROCEDURE MIP.MIP_PARSE (xmlStr IN CLOB)
IS
   
   STYP     VARCHAR2 (100);
   RENO     VARCHAR2 (100);
   AIRLINE  VARCHAR2 (100);
   FFID     VARCHAR2 (100);
   FFID_A   VARCHAR2 (100);
   FFID_D   VARCHAR2 (100);
   ABNS     VARCHAR2 (100);
   ACFT     VARCHAR2 (100);
   CHDT     VARCHAR2 (100);
   EIBT     VARCHAR2 (100);
   FATA     VARCHAR2 (100);
   FETA     VARCHAR2 (100);
   FSTA     VARCHAR2 (100);
   LMDT     VARCHAR2 (100);
   LMUR     VARCHAR2 (100);
   PSTM     VARCHAR2 (100);
   RWAY     VARCHAR2 (100);
   SPOT     VARCHAR2 (100);
   STND     VARCHAR2 (100);
   SDEC     VARCHAR2 (100);
   A_TOBT   VARCHAR2 (100);
   A_WEATHER     VARCHAR2 (100);
   ASAT     VARCHAR2 (100);
   BCTM     VARCHAR2 (100);
   BOTM     VARCHAR2 (100);
   BETM     VARCHAR2 (100);
   BSTM     VARCHAR2 (100);
   C_TOBT   VARCHAR2 (100);
   COBT     VARCHAR2 (100);
   CTOT     VARCHAR2 (100);
   DINT     VARCHAR2 (100);
   DLAB     VARCHAR2 (100);
   DNAP     VARCHAR2 (100);
   DOUT     VARCHAR2 (100);
   EDDI     VARCHAR2 (100);
   EOBT     VARCHAR2 (100);
   EPGT     VARCHAR2 (100);
   EPOT     VARCHAR2 (100);
   FATD     VARCHAR2 (100);
   FSTD     VARCHAR2 (100);
   OFTM     VARCHAR2 (100);
   STDI     VARCHAR2 (100);
   TSAT     VARCHAR2 (100);
   FLIGHTNUMBER VARCHAR2 (100);
   FLIGHTMARK   VARCHAR2 (100);
   ALAP     VARCHAR2 (100);
   APRT     VARCHAR2 (100);
   DPRT     VARCHAR2 (100);
   PARK     VARCHAR2 (100);
   INTERNALORINTERNATIONAL  VARCHAR2 (100);
   TERMINAL VARCHAR2 (100);
   GROUNDDISTRIBUTION VARCHAR2 (100);

   --定义出港信息表要格式的时间字段
   A_TOBT_D VARCHAR2 (100);
   ASAT_D   VARCHAR2 (100);
   BCTM_D   VARCHAR2 (100);
   BOTM_D   VARCHAR2 (100);
   BETM_D   VARCHAR2 (100);
   C_TOBT_D VARCHAR2 (100);
   COBT_D   VARCHAR2 (100);
   CTOT_D   VARCHAR2 (100);
   DINT_D   VARCHAR2 (100);
   DOUT_D   VARCHAR2 (100);
   EDDI_D   VARCHAR2 (100);
   EOBT_D   VARCHAR2 (100);
   EPGT_D   VARCHAR2 (100);
   EPOT_D   VARCHAR2 (100);
   FATD_D   VARCHAR2 (100);
   FSTD_D   VARCHAR2 (100);
   LMDT_D   VARCHAR2 (100);
   OFTM_D   VARCHAR2 (100);
   STDI_D   VARCHAR2 (100);
   TSAT_D   VARCHAR2 (100);

   --定义进港信息表要格式化的时间字段
   BSTM_A     VARCHAR2 (100);
   EIBT_A   VARCHAR2 (100);
   FATA_A   VARCHAR2 (100);
   FETA_A   VARCHAR2 (100);
   FSTA_A   VARCHAR2 (100);
   LMDT_A   VARCHAR2 (100);
   PSTM_A   VARCHAR2 (100);
   SPOT_A   VARCHAR2 (100);

   COUNTS   NUMBER(36);

   --定义出港信息要修改的除时间外的字段
   STND_D   VARCHAR2 (100);
   A_WEATHER_D VARCHAR2 (100);
   ABNS_D   VARCHAR2 (100);
   ACFT_D   VARCHAR2 (100);
   AIRLINE_D VARCHAR2 (100);
   DLAB_D   VARCHAR2 (100);
   DNAP_D   VARCHAR2 (100);
   LMUR_D   VARCHAR2 (100);
   RENO_D   VARCHAR2 (100);
   RWAY_D   VARCHAR2 (100);
   DPRT_D   VARCHAR2 (100);
   PARK_D   VARCHAR2 (100);
   INTERNALORINTERNATIONAL_D  VARCHAR2 (100);
   TERMINAL_D VARCHAR2 (100);
   GROUNDDISTRIBUTION_D VARCHAR2 (100);

   --定义进港信息要修改的除时间外的字段
   ABNS_A   VARCHAR2 (100);
   ACFT_A   VARCHAR2 (100);
   AIRLINE_A VARCHAR2 (100);
   ALAP_A   VARCHAR2 (100);
   APRT_A   VARCHAR2 (100);
   CHDT_A   VARCHAR2 (100);
   RENO_A   VARCHAR2 (100);
   LMUR_A   VARCHAR2 (100);
   RWAY_A   VARCHAR2 (100);
   STND_A   VARCHAR2 (100);
   PARK_A     VARCHAR2 (100);
   INTERNALORINTERNATIONAL_A  VARCHAR2 (100);
   TERMINAL_A VARCHAR2 (100);
   GROUNDDISTRIBUTION_A VARCHAR2 (100);
   
BEGIN
    
   STYP := GetXmlNodeValue (xmlStr, 'STYP');
   RENO := GetXmlNodeValue (xmlStr, 'RENO');
   FFID := GetXmlNodeValue (xmlStr, 'FFID');
   ABNS := GetXmlNodeValue (xmlStr, 'ABNS');
   ACFT := GetXmlNodeValue (xmlStr, 'ACFT');
   CHDT := GetXmlNodeValue (xmlStr, 'CHDT');
   EIBT := GetXmlNodeValue (xmlStr, 'EIBT');
   FATA := GetXmlNodeValue (xmlStr, 'FATA');
   FETA := GetXmlNodeValue (xmlStr, 'FETA');
   FSTA := GetXmlNodeValue (xmlStr, 'FSTA');
   LMDT := GetXmlNodeValue (xmlStr, 'LMDT');
   LMUR := GetXmlNodeValue (xmlStr, 'LMUR');
   PSTM := GetXmlNodeValue (xmlStr, 'PSTM');
   RWAY := GetXmlNodeValue (xmlStr, 'RWAY');
   SPOT := GetXmlNodeValue (xmlStr, 'SPOT');
   STND := GetXmlNodeValue (xmlStr, 'STND');
   SDEC := GetXmlNodeValue (xmlStr, 'STND');

   A_TOBT := GetXmlNodeValue (xmlStr, 'A_TOBT');
   A_WEATHER := GetXmlNodeValue (xmlStr, 'A_WEATHER');
   ALAP := GetXmlNodeValue (xmlStr, 'ALAP');
   APRT := GetXmlNodeValue (xmlStr, 'APRT');
   ASAT := GetXmlNodeValue (xmlStr, 'ASAT');
   BCTM := GetXmlNodeValue (xmlStr, 'BCTM');
   BOTM := GetXmlNodeValue (xmlStr, 'BOTM');
   BETM := GetXmlNodeValue (xmlStr, 'BETM');
   BSTM := GetXmlNodeValue (xmlStr, 'BSTM');
   C_TOBT := GetXmlNodeValue (xmlStr, 'C_TOBT');
   COBT := GetXmlNodeValue (xmlStr, 'COBT');
   CTOT := GetXmlNodeValue (xmlStr, 'CTOT');
   DINT := GetXmlNodeValue (xmlStr, 'DINT');
   DLAB := GetXmlNodeValue (xmlStr, 'DLAB');
   DNAP := GetXmlNodeValue (xmlStr, 'DNAP');
   DOUT := GetXmlNodeValue (xmlStr, 'DOUT');
   EDDI := GetXmlNodeValue (xmlStr, 'EDDI');
   EOBT := GetXmlNodeValue (xmlStr, 'EOBT');
   EPGT := GetXmlNodeValue (xmlStr, 'EPGT');
   EPOT := GetXmlNodeValue (xmlStr, 'EPOT');
   FATD := GetXmlNodeValue (xmlStr, 'FATD');
   FSTD := GetXmlNodeValue (xmlStr, 'FSTD');
   OFTM := GetXmlNodeValue (xmlStr, 'OFTM');
   STDI := GetXmlNodeValue (xmlStr, 'STDI');
   TSAT := GetXmlNodeValue (xmlStr, 'TSAT');
   DPRT := GetXmlNodeValue (xmlStr, 'DPRT');
   PARK := GetXmlNodeValue (xmlStr, 'PARK');
   INTERNALORINTERNATIONAL := GetXmlNodeValue (xmlStr, 'INTERNALORINTERNATIONAL');
   TERMINAL := GetXmlNodeValue (xmlStr, 'TERMINAL');
   GROUNDDISTRIBUTION := GetXmlNodeValue (xmlStr, 'GROUNDDISTRIBUTION');
   
   --出港信息表中时间字段的时间格式函数的用法
   A_TOBT_D := FORMATDATEVALUE (A_TOBT, 'A_TOBT_D');
   ASAT_D := FORMATDATEVALUE (ASAT, 'ASAT_D');
   BCTM_D := FORMATDATEVALUE (BCTM, 'BCTM_D');
   BOTM_D := FORMATDATEVALUE (BOTM, 'BOTM_D');
   BETM_D := FORMATDATEVALUE (BETM, 'BETM_D');
   C_TOBT_D := FORMATDATEVALUE (C_TOBT, 'C_TOBT_D');
   COBT_D := FORMATDATEVALUE (COBT, 'COBT_D');
   CTOT_D := FORMATDATEVALUE (CTOT, 'CTOT_D');
   DINT_D := FORMATDATEVALUE (DINT, 'DINT_D');
   DOUT_D := FORMATDATEVALUE (DOUT, 'DOUT_D');
   EDDI_D := FORMATDATEVALUE (EDDI, 'EDDI_D');
   EOBT_D := FORMATDATEVALUE (EOBT, 'EOBT_D');
   EPGT_D := FORMATDATEVALUE (EPGT, 'EPGT_D');
   EPOT_D := FORMATDATEVALUE (EPOT, 'EPOT_D');
   FATD_D := FORMATDATEVALUE (FATD, 'FATD_D');
   FSTD_D := FORMATDATEVALUE (FSTD, 'FSTD_D');
   LMDT_D := FORMATDATEVALUE (LMDT, 'LMDT_D');
   OFTM_D := FORMATDATEVALUE (OFTM, 'OFTM_D');
   STDI_D := FORMATDATEVALUE (STDI, 'STDI_D');
   TSAT_D := FORMATDATEVALUE (TSAT, 'TSAT_D');
   
   --进港信息表中时间字段的时间格式函数的用法
   EIBT_A := FORMATDATEVALUE (EIBT, 'EIBT_A');
   FATA_A := FORMATDATEVALUE (FATA, 'FATA_A');
   FETA_A := FORMATDATEVALUE (FETA, 'FETA_A');
   FSTA_A := FORMATDATEVALUE (FSTA, 'FSTA_A');
   LMDT_A := FORMATDATEVALUE (LMDT, 'LMDT_A');
   PSTM_A := FORMATDATEVALUE (PSTM, 'PSTM_A');
   SPOT_A := FORMATDATEVALUE (SPOT, 'SPOT_A');
   BSTM_A := FORMATDATEVALUE (BSTM, 'BSTM_A');
   
   --出港信息要修改的除时间外的字段
   STND_D := GetXmlNodeValue (xmlStr, 'STND');
   A_WEATHER_D := GetXmlNodeValue (xmlStr, 'A_WEATHER');
   ABNS_D := GetXmlNodeValue (xmlStr, 'ABNS');
   ACFT_D := GetXmlNodeValue (xmlStr, 'ACFT');
   AIRLINE_D := GetXmlNodeValue (xmlStr, 'AIRLINE');
   DLAB_D := GetXmlNodeValue (xmlStr, 'DLAB');
   DNAP_D := GetXmlNodeValue (xmlStr, 'DNAP');
   LMUR_D := GetXmlNodeValue (xmlStr, 'LMUR');
   RENO_D := GetXmlNodeValue (xmlStr, 'RENO');
   RWAY_D := GetXmlNodeValue (xmlStr, 'RWAY');
   DPRT_D := GetXmlNodeValue (xmlStr, 'DPRT');
   PARK_D := GetXmlNodeValue (xmlStr, 'PARK');
   TERMINAL_D := GetXmlNodeValue (xmlStr, 'TERMINAL');
   GROUNDDISTRIBUTION_D := GetXmlNodeValue (xmlStr, 'GROUNDDISTRIBUTION');
   
   --进港信息要修改的除时间外的字段
   ABNS_A := GetXmlNodeValue (xmlStr, 'ABNS');
   ACFT_A := GetXmlNodeValue (xmlStr, 'ACFT');
   AIRLINE_A := GetXmlNodeValue (xmlStr, 'AIRLINE');
   ALAP_A := GetXmlNodeValue (xmlStr, 'ALAP');
   APRT_A := GetXmlNodeValue (xmlStr, 'APRT');
   CHDT_A := GetXmlNodeValue (xmlStr, 'CHDT');
   RENO_A := GetXmlNodeValue (xmlStr, 'RENO');
   LMUR_A := GetXmlNodeValue (xmlStr, 'LMUR');
   RWAY_A := GetXmlNodeValue (xmlStr, 'RWAY');
   STND_A := GetXmlNodeValue (xmlStr, 'STND');
   PARK_A := GetXmlNodeValue (xmlStr, 'PARK');
   TERMINAL_A := GetXmlNodeValue (xmlStr, 'TERMINAL');
   GROUNDDISTRIBUTION_A := GetXmlNodeValue (xmlStr, 'GROUNDDISTRIBUTION');
   
   
   IF STYP = 'FGIS' THEN 
   
   IF INSTR(FFID,'-D-') > 0 THEN

    FFID_D := FFID;
    
    --截取航空公司代码
    AIRLINE := SUBSTR(FFID_D,0,2);

    --截取航班号
    FLIGHTNUMBER := SUBSTR(FFID_D,INSTR(FFID_D,'-',1)+1,INSTR(FFID_D,'-',INSTR(FFID_D,'-',1)+1)-INSTR(FFID_D,'-',1)-1);

    --截取出港标志

    FLIGHTMARK := SUBSTR(FFID_D,INSTR(FFID_D,'-',2,2)+1,INSTR(FFID_D,'-',2,3)-1-INSTR(FFID_D,'-',2,2));
    
    --截取进离港标志
    INTERNALORINTERNATIONAL := SUBSTR(FFID_D,-1);

    --UPDATE之前要先根据FFID查询一下看看数据表中是否已经存在该条数据,如果存在就UPDATE,如果不存在就SAVE

    SELECT COUNT(1) INTO COUNTS FROM TB_CMS_FLGTINFO_D where FFID = FFID_D;

    IF COUNTS > 0 THEN
    
      IF A_TOBT_D != ' ' THEN
      
      UPDATE TB_CMS_FLGTINFO_D SET A_TOBT = A_TOBT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF A_WEATHER_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET A_WEATHER = A_WEATHER_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF ABNS_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET ABNS = ABNS_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF ACFT_D != ' ' THEN
      
      UPDATE TB_CMS_FLGTINFO_D SET ACFT = ACFT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF ASAT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET ASAT = ASAT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF BCTM_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET BCTM = BCTM_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF BOTM_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET BOTM = BOTM_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF BETM_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET BETM = BETM_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF C_TOBT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET C_TOBT = C_TOBT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF COBT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET COBT = COBT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF CTOT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET CTOT = CTOT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF DINT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET DINT = DINT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF DLAB_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET DLAB = DLAB_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF DNAP_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET DNAP = DNAP_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF DOUT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET DOUT = DOUT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF EDDI_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET EDDI = EDDI_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF EOBT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET EOBT = EOBT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF EPGT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET EPGT = EPGT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF EPOT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET EPOT = EPOT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF FATD_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET FATD = FATD_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF FSTD_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET FSTD = FSTD_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF LMDT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET LMDT = LMDT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF LMUR_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET LMUR = LMUR_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF OFTM_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET OFTM = OFTM_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF RENO_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET RENO = RENO_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF RWAY_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET RWAY = RWAY_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF STDI_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET STDI = STDI_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF STND_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET STND = STND_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF TSAT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET TSAT = TSAT_D WHERE FFID = FFID_D;
      
      END IF; 
      
      IF DPRT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET DPRT = DPRT_D WHERE FFID = FFID_D;
      
      END IF; 
      
      IF PARK_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET PARK = PARK_D WHERE FFID = FFID_D;
      
      END IF; 
      
      IF TERMINAL_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET TERMINAL = TERMINAL_D WHERE FFID = FFID_D;
      
      END IF; 
      
      IF GROUNDDISTRIBUTION_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET GROUNDDISTRIBUTION = GROUNDDISTRIBUTION_D WHERE FFID = FFID_D;
      
      END IF; 
      
    ELSE

    INSERT INTO TB_CMS_FLGTINFO_D (ID,A_TOBT,A_WEATHER,ABNS,ACFT,AIRLINE,ASAT,BCTM,BOTM,BETM,C_TOBT,COBT,CTOT,DINT,DLAB,DNAP,DOUT,DPRT,EDDI,EOBT,EPGT,EPOT,FATD,FFID,FLIGHTNUMBER,
                 FLIGHTMARK,FSTD,GROUNDDISTRIBUTION,INTERNALORINTERNATIONAL,LMDT,LMUR,OFTM,PARK,RENO,RWAY,STDI,STND,TERMINAL,TSAT)
       VALUES   (FLGTINFO_D_SEQ.NEXTVAL,
                 A_TOBT_D,
                 A_WEATHER,
                 ABNS,
                 ACFT,
                 AIRLINE,
                 ASAT_D,
                 BCTM_D,
                 BOTM_D,
                 BETM_D,
                 C_TOBT_D,
                 COBT_D,
                 CTOT_D,
                 DINT_D,
                 DLAB,
                 DNAP,
                 DOUT_D,
                 DPRT,
                 EDDI_D,
                 EOBT_D,
                 EPGT_D,
                 EPOT_D,
                 FATD_D,
                 FFID_D,
                 FLIGHTNUMBER,
                 FLIGHTMARK,
                 FSTD_D,
                 GROUNDDISTRIBUTION,
                 INTERNALORINTERNATIONAL,
                 LMDT_D,
                 LMUR,
                 OFTM_D,
                 PARK,
                 RENO,
                 RWAY,
                 STDI_D,
                 STND,
                 TERMINAL,
                 TSAT_D);

    END IF;


   ELSE

     FFID_A := FFID;
     
     --截取航空公司代码
     AIRLINE := SUBSTR(FFID_A,0,2);

     --截取航班号
     FLIGHTNUMBER := SUBSTR(FFID_A,INSTR(FFID_A,'-',1)+1,INSTR(FFID_A,'-',INSTR(FFID_A,'-',1)+1)-INSTR(FFID_A,'-',1)-1);

     --截取出港标志
     FLIGHTMARK := SUBSTR(FFID_A,INSTR(FFID_A,'-',2,2)+1,INSTR(FFID_A,'-',2,3)-1-INSTR(FFID_A,'-',2,2));
     
     --截取进离港标志
     INTERNALORINTERNATIONAL := SUBSTR(FFID_A,-1);

    --UPDATE之前要先根据FFID查询一下看看数据表中是否已经存在该条数据,如果存在就UPDATE,如果不存在就SAVE

     SELECT COUNT(1) INTO COUNTS FROM TB_CMS_FLGTINFO_A where FFID = FFID_A;

     IF COUNTS > 0 THEN
     
         IF ABNS_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET ABNS = ABNS_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF ACFT_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET ACFT = ACFT_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF ALAP_A != ' ' THEN
         
         UPDATE TB_CMS_FLGTINFO_A SET ALAP = ALAP_A WHERE FFID = FFID_A;
         
         END IF;
         
         IF BSTM_A != ' ' THEN
         
         UPDATE TB_CMS_FLGTINFO_A SET BSTM = BSTM_A WHERE FFID = FFID_A;
         
         END IF;
         
         IF CHDT_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET CHDT = CHDT_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF RENO_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET RENO = RENO_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF EIBT_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET EIBT = EIBT_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF FATA_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET FATA = FATA_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF FETA_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET FETA = FETA_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF FSTA_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET FSTA = FSTA_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF LMDT_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET LMDT = LMDT_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF LMUR_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET LMUR = LMUR_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF PSTM_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET PSTM = PSTM_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF RWAY_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET RWAY = RWAY_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF SPOT_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET SPOT = SPOT_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF STND_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET STND = STND_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF APRT_A != ' ' THEN
    
         UPDATE TB_CMS_FLGTINFO_A SET APRT = APRT_A WHERE FFID = FFID_A;
                  
         END IF; 
                  
         IF PARK_A != ' ' THEN
                
         UPDATE TB_CMS_FLGTINFO_A SET PARK = PARK_A WHERE FFID = FFID_A;
                  
         END IF; 
                  
         IF TERMINAL_A != ' ' THEN
                
         UPDATE TB_CMS_FLGTINFO_A SET TERMINAL = TERMINAL_A WHERE FFID = FFID_A;
                  
         END IF; 
                  
         IF GROUNDDISTRIBUTION_A != ' ' THEN
                
         UPDATE TB_CMS_FLGTINFO_A SET GROUNDDISTRIBUTION = GROUNDDISTRIBUTION_A WHERE FFID = FFID_A;
                  
         END IF; 
         
     
     ELSE

     INSERT INTO TB_CMS_FLGTINFO_A (ID,ABNS,ACFT,AIRLINE,ALAP,BSTM,CHDT,APRT,FFID,FLIGHTNUMBER,FLIGHTMARK,GROUNDDISTRIBUTION,INTERNALORINTERNATIONAL,RENO,EIBT,FATA,FETA,FSTA,LMDT,LMUR,PARK,PSTM,RWAY,SPOT,STND,TERMINAL)

     VALUES   (FLGTINFO_A_SEQ.NEXTVAL,
               ABNS,
               ACFT,
               AIRLINE,
               ALAP,
               BSTM_A,
               CHDT,
               APRT,
               FFID_A,
               FLIGHTNUMBER,
               FLIGHTMARK,
               GROUNDDISTRIBUTION,
               INTERNALORINTERNATIONAL,
               RENO,
               EIBT_A,
               FATA_A,
               FETA_A,
               FSTA_A,
               LMDT_A,
               LMUR,
               PARK,
               PSTM_A,
               RWAY,
               SPOT_A,
               STND,
               TERMINAL);

     END IF;

   END IF;
   
   ELSE
   
   IF INSTR(FFID,'-D-') > 0 THEN

    FFID_D := FFID;
    
    --截取航空公司代码
    AIRLINE := SUBSTR(FFID_D,0,2);

    --截取航班号
    FLIGHTNUMBER := SUBSTR(FFID_D,INSTR(FFID_D,'-',1)+1,INSTR(FFID_D,'-',INSTR(FFID_D,'-',1)+1)-INSTR(FFID_D,'-',1)-1);

    --截取出港标志

    FLIGHTMARK := SUBSTR(FFID_D,INSTR(FFID_D,'-',2,2)+1,INSTR(FFID_D,'-',2,3)-1-INSTR(FFID_D,'-',2,2));
    
    --截取进离港标志
    INTERNALORINTERNATIONAL := SUBSTR(FFID_D,-1);

    --UPDATE之前要先根据FFID查询一下看看数据表中是否已经存在该条数据,如果存在就UPDATE,如果不存在就SAVE

    SELECT COUNT(1) INTO COUNTS FROM TB_CMS_FLGTINFO_D where FFID = FFID_D;

    IF COUNTS > 0 THEN
    
      IF A_TOBT_D != ' ' THEN
      
      UPDATE TB_CMS_FLGTINFO_D SET A_TOBT = A_TOBT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF A_WEATHER_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET A_WEATHER = A_WEATHER_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF ABNS_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET ABNS = ABNS_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF ACFT_D != ' ' THEN
      
      UPDATE TB_CMS_FLGTINFO_D SET ACFT = ACFT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF ASAT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET ASAT = ASAT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF BCTM_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET BCTM = BCTM_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF BOTM_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET BOTM = BOTM_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF BETM_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET BETM = BETM_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF C_TOBT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET C_TOBT = C_TOBT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF COBT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET COBT = COBT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF CTOT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET CTOT = CTOT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF DINT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET DINT = DINT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF DLAB_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET DLAB = DLAB_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF DNAP_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET DNAP = DNAP_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF DOUT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET DOUT = DOUT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF EDDI_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET EDDI = EDDI_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF EOBT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET EOBT = EOBT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF EPGT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET EPGT = EPGT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF EPOT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET EPOT = EPOT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF FATD_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET FATD = FATD_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF FSTD_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET FSTD = FSTD_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF LMDT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET LMDT = LMDT_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF LMUR_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET LMUR = LMUR_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF OFTM_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET OFTM = OFTM_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF RENO_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET RENO = RENO_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF RWAY_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET RWAY = RWAY_D WHERE FFID = FFID_D;
      
      END IF;
      
      IF STDI_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET STDI = STDI_D WHERE FFID = FFID_D;
      
      END IF;
      
      
      IF SDEC != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET SDEC = SDEC WHERE FFID = FFID_D;
      
      END IF;
      
      IF TSAT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET TSAT = TSAT_D WHERE FFID = FFID_D;
      
      END IF; 
      
      IF DPRT_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET DPRT = DPRT_D WHERE FFID = FFID_D;
      
      END IF; 
      
      IF PARK_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET PARK = PARK_D WHERE FFID = FFID_D;
      
      END IF; 
      
      IF TERMINAL_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET TERMINAL = TERMINAL_D WHERE FFID = FFID_D;
      
      END IF; 
      
      IF GROUNDDISTRIBUTION_D != ' ' THEN
    
      UPDATE TB_CMS_FLGTINFO_D SET GROUNDDISTRIBUTION = GROUNDDISTRIBUTION_D WHERE FFID = FFID_D;
      
      END IF; 
      
    ELSE

    INSERT INTO TB_CMS_FLGTINFO_D (ID,A_TOBT,A_WEATHER,ABNS,ACFT,AIRLINE,ASAT,BCTM,BOTM,BETM,C_TOBT,COBT,CTOT,DINT,DLAB,DNAP,DOUT,DPRT,EDDI,EOBT,EPGT,EPOT,FATD,FFID,FLIGHTNUMBER,
                 FLIGHTMARK,FSTD,GROUNDDISTRIBUTION,INTERNALORINTERNATIONAL,LMDT,LMUR,OFTM,PARK,RENO,RWAY,STDI,SDEC,TERMINAL,TSAT)
       VALUES   (FLGTINFO_D_SEQ.NEXTVAL,
                 A_TOBT_D,
                 A_WEATHER,
                 ABNS,
                 ACFT,
                 AIRLINE,
                 ASAT_D,
                 BCTM_D,
                 BOTM_D,
                 BETM_D,
                 C_TOBT_D,
                 COBT_D,
                 CTOT_D,
                 DINT_D,
                 DLAB,
                 DNAP,
                 DOUT_D,
                 DPRT,
                 EDDI_D,
                 EOBT_D,
                 EPGT_D,
                 EPOT_D,
                 FATD_D,
                 FFID_D,
                 FLIGHTNUMBER,
                 FLIGHTMARK,
                 FSTD_D,
                 GROUNDDISTRIBUTION,
                 INTERNALORINTERNATIONAL,
                 LMDT_D,
                 LMUR,
                 OFTM_D,
                 PARK,
                 RENO,
                 RWAY,
                 STDI_D,
                 SDEC,
                 TERMINAL,
                 TSAT_D);

    END IF;


   ELSE

     FFID_A := FFID;
     
     --截取航空公司代码
     AIRLINE := SUBSTR(FFID_A,0,2);

     --截取航班号
     FLIGHTNUMBER := SUBSTR(FFID_A,INSTR(FFID_A,'-',1)+1,INSTR(FFID_A,'-',INSTR(FFID_A,'-',1)+1)-INSTR(FFID_A,'-',1)-1);

     --截取出港标志
     FLIGHTMARK := SUBSTR(FFID_A,INSTR(FFID_A,'-',2,2)+1,INSTR(FFID_A,'-',2,3)-1-INSTR(FFID_A,'-',2,2));
     
     --截取进离港标志
     INTERNALORINTERNATIONAL := SUBSTR(FFID_A,-1);

    --UPDATE之前要先根据FFID查询一下看看数据表中是否已经存在该条数据,如果存在就UPDATE,如果不存在就SAVE

     SELECT COUNT(1) INTO COUNTS FROM TB_CMS_FLGTINFO_A where FFID = FFID_A;

     IF COUNTS > 0 THEN
     
         IF ABNS_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET ABNS = ABNS_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF ACFT_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET ACFT = ACFT_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF ALAP_A != ' ' THEN
         
         UPDATE TB_CMS_FLGTINFO_A SET ALAP = ALAP_A WHERE FFID = FFID_A;
         
         END IF;
         
         IF BSTM_A != ' ' THEN
         
         UPDATE TB_CMS_FLGTINFO_A SET BSTM = BSTM_A WHERE FFID = FFID_A;
         
         END IF;
         
         IF CHDT_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET CHDT = CHDT_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF RENO_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET RENO = RENO_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF EIBT_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET EIBT = EIBT_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF FATA_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET FATA = FATA_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF FETA_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET FETA = FETA_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF FSTA_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET FSTA = FSTA_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF LMDT_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET LMDT = LMDT_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF LMUR_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET LMUR = LMUR_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF PSTM_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET PSTM = PSTM_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF RWAY_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET RWAY = RWAY_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF SPOT_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET SPOT = SPOT_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF STND_A != ' ' THEN
          
         UPDATE TB_CMS_FLGTINFO_A SET STND = STND_A WHERE FFID = FFID_A;
          
         END IF;
         
         IF APRT_A != ' ' THEN
    
         UPDATE TB_CMS_FLGTINFO_A SET APRT = APRT_A WHERE FFID = FFID_A;
                  
         END IF; 
                  
         IF PARK_A != ' ' THEN
                
         UPDATE TB_CMS_FLGTINFO_A SET PARK = PARK_A WHERE FFID = FFID_A;
                  
         END IF; 
                  
         IF TERMINAL_A != ' ' THEN
                
         UPDATE TB_CMS_FLGTINFO_A SET TERMINAL = TERMINAL_A WHERE FFID = FFID_A;
                  
         END IF; 
                  
         IF GROUNDDISTRIBUTION_A != ' ' THEN
                
         UPDATE TB_CMS_FLGTINFO_A SET GROUNDDISTRIBUTION = GROUNDDISTRIBUTION_A WHERE FFID = FFID_A;
                  
         END IF; 
         
     
     ELSE

     INSERT INTO TB_CMS_FLGTINFO_A (ID,ABNS,ACFT,AIRLINE,ALAP,BSTM,CHDT,APRT,FFID,FLIGHTNUMBER,FLIGHTMARK,GROUNDDISTRIBUTION,INTERNALORINTERNATIONAL,RENO,EIBT,FATA,FETA,FSTA,LMDT,LMUR,PARK,PSTM,RWAY,SPOT,STND,TERMINAL)

     VALUES   (FLGTINFO_A_SEQ.NEXTVAL,
               ABNS,
               ACFT,
               AIRLINE,
               ALAP,
               BSTM_A,
               CHDT,
               APRT,
               FFID_A,
               FLIGHTNUMBER,
               FLIGHTMARK,
               GROUNDDISTRIBUTION,
               INTERNALORINTERNATIONAL,
               RENO,
               EIBT_A,
               FATA_A,
               FETA_A,
               FSTA_A,
               LMDT_A,
               LMUR,
               PARK,
               PSTM_A,
               RWAY,
               SPOT_A,
               STND,
               TERMINAL);

     END IF;

   END IF;
   
   END IF;
   

   COMMIT;

EXCEPTION

   WHEN OTHERS THEN

      DBMS_OUTPUT.PUT_LINE (SQLERRM);

END MIP_PARSE;
/
登录后复制

五:存储过程里面用到的Function.SQL:

CREATE OR REPLACE FUNCTION MIP.FormatDateValue (key VARCHAR2, value VARCHAR2)
   RETURN VARCHAR2
IS
   --定义几个变量,出来解析过来的时间字符串
   --日月年时分(11OCT141024)
   Str      VARCHAR2(32);
   
   AA       VARCHAR2(32);

   DAY      VARCHAR2(32);

   MOUNTH   VARCHAR2(32);

   YEAR     VARCHAR2(32);

   HOUR     VARCHAR2(32);

   MINUTE   VARCHAR2(32);

   ValueReturn   VARCHAR2 (64);

BEGIN

   IF key != ' ' THEN

   DAY := SUBSTR(key,0,2);
   
   MOUNTH := SUBSTR(key,3,3);
   
   IF INSTR (MOUNTH,'JAN') > 0 THEN
   MOUNTH := 01;
   END IF;
   
   IF INSTR (MOUNTH,'FEB') > 0 THEN
   MOUNTH := 02;
   END IF;
   
   IF INSTR (MOUNTH,'MAR') > 0 THEN
   MOUNTH := 03;
   END IF;
   
   IF INSTR (MOUNTH,'APR') > 0 THEN
   MOUNTH := 04;
   END IF;
   
   IF INSTR (MOUNTH,'MAY') > 0 THEN
   MOUNTH := 05;
   END IF;
   
   IF INSTR (MOUNTH,'JUN') > 0 THEN
   MOUNTH := 06;
   END IF;
   
   IF INSTR (MOUNTH,'JUL') > 0 THEN
   MOUNTH := 07;
   END IF;
   
   IF INSTR (MOUNTH,'AUG') > 0 THEN
   MOUNTH := 08;
   END IF;
   
   IF INSTR (MOUNTH,'SEP') > 0 THEN
   MOUNTH := 09;
   END IF;
   
   IF INSTR (MOUNTH,'OCT') > 0 THEN
   MOUNTH := 10;
   END IF;
   
   IF INSTR (MOUNTH,'NOV') > 0 THEN
   MOUNTH := 11;
   END IF;
   
   IF INSTR (MOUNTH,'DEC') > 0 THEN
   MOUNTH := 12;
   END IF;
   
   YEAR := SUBSTR(key,6,2);
   
   HOUR := SUBSTR(key,8,2);
   
   MINUTE := SUBSTR(key,-2);
   
   AA := 20;
   
   Str := 0;

   --日月年时分(11OCT141017)
   IF length(MOUNTH) <br>
<pre class="brush:php;toolbar:false">
登录后复制


六:最后是调用存储过程执行解析Clob字段里面的xml字符串的游标SQL:

/* Formatted on 2015/1/15 14:20:27 (QP5 v5.115.810.9015) */
DECLARE
   --定义游标
   CURSOR c_cursor
   IS
      --这里查询指定时间内的数据,根据时间判断一下id>那个编号开始
      SELECT MBINMSGS_CLOB_MSG FROM MBINMSGS_TEMP;

   v_MBINMSGS_CLOB_MSG   MBINMSGS_TEMP.MBINMSGS_CLOB_MSG%TYPE;
BEGIN
   --打开游标
   OPEN c_cursor;

   --提取游标数据
   FETCH c_cursor INTO   v_MBINMSGS_CLOB_MSG;

   WHILE c_cursor%FOUND
   LOOP
      DBMS_OUTPUT.put_line (v_MBINMSGS_CLOB_MSG);

      FETCH c_cursor INTO   v_MBINMSGS_CLOB_MSG;
      
      MIP_PARSE(v_MBINMSGS_CLOB_MSG);
   END LOOP;
END;
登录后复制

总结:以上所以的SQL操作都是在PL/SQL中完成的,这样执行完成后的结果就是把零时表里面的所有的CLOB字段里面的xml解析并更新到对应的数据表中。


本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
2 周前 By 尊渡假赌尊渡假赌尊渡假赌
仓库:如何复兴队友
1 个月前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
4 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

oracle数据库日志会保存多久 oracle数据库日志会保存多久 May 10, 2024 am 03:27 AM

Oracle 数据库日志的保留期限取决于日志类型和配置,包括:重做日志:由 "LOG_ARCHIVE_DEST" 参数配置的最大大小决定。归档重做日志:由 "DB_RECOVERY_FILE_DEST_SIZE" 参数配置的最大大小决定。在线重做日志:不归档,在数据库重启时丢失,保留期限与实例运行时间一致。审计日志:由 "AUDIT_TRAIL" 参数配置,默认保留 30 天。

oracle中计算两个日期之间天数的函数 oracle中计算两个日期之间天数的函数 May 08, 2024 pm 07:45 PM

Oracle 中计算两个日期之间天数的函数是 DATEDIFF()。具体用法如下:指定时间间隔单位:interval(如 day、month、year)指定两个日期值:date1 和 date2DATEDIFF(interval, date1, date2) 返回天数差

oracle数据库启动步骤顺序为 oracle数据库启动步骤顺序为 May 10, 2024 am 01:48 AM

Oracle 数据库启动顺序为:1. 检查前置条件;2. 启动监听器;3. 启动数据库实例;4. 等待数据库打开;5. 连接到数据库;6. 验证数据库状态;7. 启用服务(如果需要);8. 测试连接。

oracle中interval的用法 oracle中interval的用法 May 08, 2024 pm 07:54 PM

Oracle 中的 INTERVAL 数据类型用于表示时间间隔,语法为 INTERVAL <精度> <单位>,可使用加减乘除运算操作 INTERVAL,适用于存储时间数据、计算日期差值等场景。

oracle中某个字符出现的次数怎么看出来 oracle中某个字符出现的次数怎么看出来 May 09, 2024 pm 09:33 PM

要在 Oracle 中查找字符出现的次数,执行以下步骤:获取字符串的总长度;获取字符所在子字符串的长度;计算字符出现的次数:用总长度减去子字符串长度。

oracle需要多少内存 oracle需要多少内存 May 10, 2024 am 04:12 AM

Oracle 所需内存量取决于数据库大小、活动水平和所需性能水平:用于存储数据缓冲区、索引缓冲区、执行 SQL 语句和管理数据字典缓存。具体数量受数据库大小、活动水平和所需性能水平影响。最佳实践包括设置适当的 SGA 大小、调整 SGA 组件大小、使用 AMM 和监控内存使用情况。

oracle数据库服务器硬件配置要求 oracle数据库服务器硬件配置要求 May 10, 2024 am 04:00 AM

Oracle 数据库服务器硬件配置要求:处理器:多核,主频至少 2.5 GHz,大型数据库建议 32 核以上。内存:小型数据库至少 8GB,中等规模 16-64GB,大型数据库或高负载工作负载高达 512GB 或更多。存储:SSD 或 NVMe 磁盘,RAID 阵列提高冗余和性能。网络:高速网络(10GbE 或更高),专用网卡,低延迟网络。其他:稳定电源、冗余组件、兼容操作系统和软件、散热和冷却系统。

oracle中字符串用什么符号连接数据库 oracle中字符串用什么符号连接数据库 May 08, 2024 pm 07:36 PM

Oracle使用“||”符号连接字符串。使用方法如下:将要连接的字符串用“||”符号连接起来;字符串连接的优先级较低,需要使用括号来保证优先级;空字符串连接后仍为一个空字符串;NULL值连接后仍为NULL。

See all articles