`
ztbsuper
  • 浏览: 23484 次
  • 性别: Icon_minigender_1
  • 来自: 成都
最近访客 更多访客>>
社区版块
存档分类
最新评论

2干的NEPORT_2V

SQL 
阅读更多
-----更改设备
SELECT 'RMS_TRANSCIR_USER->对网元编号提取,存入本端和对端num:' AS remark,TO_CHAR(CURRENT_DATE,'YYYY-MM-DD HH24:MI:SS') AS deal_time FROM dual;

UPDATE RMS_TRANSCIR_USER
SET SOURCE_NE=REPLACE(SOURCE_NE,'-','-' );

UPDATE RMS_TRANSCIR_USER
SET REMOTE_TRANS_EQU=REPLACE(REMOTE_TRANS_EQU,'-','-' );

UPDATE RMS_TRANSCIR_USER
SET SOURCE_NUM=SUBSTR(SOURCE_NE,1,INSTR(SOURCE_NE,'-',1)-1);

UPDATE RMS_TRANSCIR_USER
SET REMOTE_NUM=SUBSTR(REMOTE_TRANS_EQU,1,INSTR(REMOTE_TRANS_EQU,'-',1)-1);

UPDATE RMS_TRANSCIR_USER
SET REMOTE_NUM='11074'
WHERE REMOTE_TRANS_EQU='11074广安2扩1';

UPDATE RMS_TRANSCIR_USER
SET REMOTE_NUM='11172'
WHERE REMOTE_TRANS_EQU='11172泸州2-9层扩1';

UPDATE RMS_TRANSCIR_USER
SET REMOTE_NUM='625'
WHERE REMOTE_TRANS_EQU='625南充3扩1';

UPDATE RMS_TRANSCIR_USER
SET SOURCE_NUM='11101'
WHERE SOURCE_NE='11101万年扩2';


--更新网元名称
SELECT 'RMS_TRANSCIR_USER->更新网元名:' AS remark,TO_CHAR(CURRENT_DATE,'YYYY-MM-DD HH24:MI:SS') AS deal_time FROM dual;

UPDATE RMS_TRANSCIR_USER
SET SOURCE_NE
  =(SELECT OLD_NAME
    FROM RMS_TRANSNE_2GX
    WHERE NENO=RMS_TRANSCIR_USER.SOURCE_NUM)
WHERE EXISTS (
  SELECT 1
  FROM RMS_TRANSNE_2GX
  WHERE NENO=RMS_TRANSCIR_USER.SOURCE_NUM);


UPDATE RMS_TRANSCIR_USER
SET REMOTE_TRANS_EQU
  =(SELECT OLD_NAME
    FROM RMS_TRANSNE_2GX
    WHERE NENO=RMS_TRANSCIR_USER.REMOTE_NUM)
WHERE EXISTS ( 
  SELECT 1
  FROM RMS_TRANSNE_2GX
  WHERE NENO=RMS_TRANSCIR_USER.REMOTE_NUM);


--端口处理
SELECT 'RMS_TRANSCIR_USER->G3/上下规整:' AS remark,TO_CHAR(CURRENT_DATE,'YYYY-MM-DD HH24:MI:SS') AS deal_time FROM dual;

UPDATE RMS_TRANSCIR_USER
SET SOURCE_TRANS_PORT=REPLACE(SOURCE_TRANS_PORT,'(G3)','' );

UPDATE RMS_TRANSCIR_USER
SET REMOTE_TRANS_PORT=REPLACE(REMOTE_TRANS_PORT,'(G3)','' );

UPDATE RMS_TRANSCIR_USER
SET SOURCE_TRANS_PORT=REPLACE(SOURCE_TRANS_PORT,'1上-','' );

UPDATE RMS_TRANSCIR_USER
SET REMOTE_TRANS_PORT=REPLACE(REMOTE_TRANS_PORT,'1上-','' );

UPDATE RMS_TRANSCIR_USER
SET SOURCE_TRANS_PORT=REPLACE(SOURCE_TRANS_PORT,'1下-','' );

UPDATE RMS_TRANSCIR_USER
SET REMOTE_TRANS_PORT=REPLACE(REMOTE_TRANS_PORT,'1下-','' );

UPDATE RMS_TRANSCIR_USER
SET SOURCE_TRANS_PORT=REPLACE(SOURCE_TRANS_PORT,'2上-','' );

UPDATE RMS_TRANSCIR_USER
SET REMOTE_TRANS_PORT=REPLACE(REMOTE_TRANS_PORT,'2上-','' );

UPDATE RMS_TRANSCIR_USER
SET SOURCE_TRANS_PORT=REPLACE(SOURCE_TRANS_PORT,'2下-','' );

UPDATE RMS_TRANSCIR_USER
SET REMOTE_TRANS_PORT=REPLACE(REMOTE_TRANS_PORT,'2下-','' );

------------------对端口进行规整

SELECT 'RMS_TRANSCIR_USER->对端口进行规整:' AS remark,TO_CHAR(CURRENT_DATE,'YYYY-MM-DD HH24:MI:SS') AS deal_time FROM dual;

--UPDATE RMS_TRANSCIR_USER
--SET SOURCE_TRANS_PORT=SUBSTR(SOURCE_TRANS_PORT,1,REGEXP_INSTR(SOURCE_TRANS_PORT,'[a-zA-Z]',1,1)-1)||'-'||SUBSTR(SOURCE_TRANS_PORT,REGEXP_INSTR(SOURCE_TRANS_PORT,'[a-zA-Z]',1,1),REGEXP_INSTR(SOURCE_TRANS_PORT,'-',1,1)-(REGEXP_INSTR(SOURCE_TRANS_PORT,'[a-zA-Z]',1,1)))||SUBSTR(SOURCE_TRANS_PORT,REGEXP_INSTR(SOURCE_TRANS_PORT,'-',1,1))
--WHERE REGEXP_LIKE(SOURCE_TRANS_PORT,'^\d+[A-Za-z]+\d?\-\d+$');
--UPDATE RMS_TRANSCIR_USER
--SET REMOTE_TRANS_PORT=SUBSTR(REMOTE_TRANS_PORT,1,REGEXP_INSTR(REMOTE_TRANS_PORT,'[a-zA-Z]',1,1)-1)||'-'||SUBSTR(REMOTE_TRANS_PORT,REGEXP_INSTR(REMOTE_TRANS_PORT,'[a-zA-Z]',1,1),REGEXP_INSTR(REMOTE_TRANS_PORT,'-',1,1)-(REGEXP_INSTR(REMOTE_TRANS_PORT,'[a-zA-Z]',1,1)))||SUBSTR(REMOTE_TRANS_PORT,REGEXP_INSTR(REMOTE_TRANS_PORT,'-',1,1))
--WHERE REGEXP_LIKE(REMOTE_TRANS_PORT,'^\d+[A-Za-z]+\d?\-\d+$');
----  10PQ1-2
UPDATE RMS_TRANSCIR_USER
SET SOURCE_TRANS_PORT=SUBSTR(SOURCE_TRANS_PORT,1,REGEXP_INSTR(SOURCE_TRANS_PORT,'[a-zA-Z]',1,1)-1)||'-'||SUBSTR(SOURCE_TRANS_PORT,REGEXP_INSTR(SOURCE_TRANS_PORT,'[a-zA-Z]',1,1))
WHERE REGEXP_LIKE(SOURCE_TRANS_PORT,'^\d+[A-Za-z]+\d?\-\d+$');

UPDATE RMS_TRANSCIR_USER
SET REMOTE_TRANS_PORT=SUBSTR(REMOTE_TRANS_PORT,1,REGEXP_INSTR(REMOTE_TRANS_PORT,'[a-zA-Z]',1,1)-1)||'-'||SUBSTR(REMOTE_TRANS_PORT,REGEXP_INSTR(REMOTE_TRANS_PORT,'[a-zA-Z]',1,1))
WHERE REGEXP_LIKE(REMOTE_TRANS_PORT,'^\d+[A-Za-z]+\d?\-\d+$');

----  2-10PQ1-2
UPDATE RMS_TRANSCIR_USER
SET SOURCE_TRANS_PORT= SUBSTR(SOURCE_TRANS_PORT,INSTR(SOURCE_TRANS_PORT,'-',1,1)+1,REGEXP_INSTR(SOURCE_TRANS_PORT,'[a-zA-Z]',1)-INSTR(SOURCE_TRANS_PORT,'-',1,1)-1)||'-'||SUBSTR(SOURCE_TRANS_PORT,REGEXP_INSTR(SOURCE_TRANS_PORT,'[a-zA-Z]',1),INSTR(SOURCE_TRANS_PORT,'-',1,2)-REGEXP_INSTR(SOURCE_TRANS_PORT,'[a-zA-Z]',1,1))||'-'||SUBSTR(SOURCE_TRANS_PORT,INSTR(SOURCE_TRANS_PORT,'-',1,2)+1)
WHERE REGEXP_LIKE(SOURCE_TRANS_PORT,'^\d+\-\d+[A-Za-z]+\d?\-\d+$');

UPDATE RMS_TRANSCIR_USER
SET REMOTE_TRANS_PORT= SUBSTR(REMOTE_TRANS_PORT,INSTR(REMOTE_TRANS_PORT,'-',1,1)+1,REGEXP_INSTR(REMOTE_TRANS_PORT,'[a-zA-Z]',1)-INSTR(REMOTE_TRANS_PORT,'-',1,1)-1)||'-'||SUBSTR(REMOTE_TRANS_PORT,REGEXP_INSTR(REMOTE_TRANS_PORT,'[a-zA-Z]',1),INSTR(REMOTE_TRANS_PORT,'-',1,2)-REGEXP_INSTR(REMOTE_TRANS_PORT,'[a-zA-Z]',1,1))||'-'||SUBSTR(REMOTE_TRANS_PORT,INSTR(REMOTE_TRANS_PORT,'-',1,2)+1)
WHERE REGEXP_LIKE(REMOTE_TRANS_PORT,'^\d+\-\d+[A-Za-z]+\d?\-\d+$');


UPDATE RMS_TRANSCIR_USER
SET SOURCE_TRANS_PORT=REPLACE(SOURCE_TRANS_PORT,'-EFT-','-EFT0-')
WHERE SOURCE_TRANS_PORT LIKE '%-EFT-%';

UPDATE RMS_TRANSCIR_USER
SET REMOTE_TRANS_PORT=REPLACE(REMOTE_TRANS_PORT,'-EFT-','-EFT0-')
WHERE REMOTE_TRANS_PORT LIKE '%-EFT-%';

--更改PQ->PQ1
SELECT 'RMS_TRANSCIR_USER->更改PQ->PQ1:' AS remark,TO_CHAR(CURRENT_DATE,'YYYY-MM-DD HH24:MI:SS') AS deal_time FROM dual;

UPDATE RMS_TRANSCIR_USER
SET SOURCE_TRANS_PORT=replace(SOURCE_TRANS_PORT,'-PQ-','-PQ1-')
WHERE SOURCE_TRANS_PORT LIKE '%-PQ-%';
--
UPDATE RMS_TRANSCIR_USER
SET REMOTE_TRANS_PORT=REPLACE(REMOTE_TRANS_PORT,'-PQ-','-PQ1-') 
WHERE REMOTE_TRANS_PORT LIKE '%-PQ-%';


----------------更新端口状态
--SELECT 'RMS_NEPORT_2GX->更新端口状态:' AS remark,TO_CHAR(CURRENT_DATE,'YYYY-MM-DD HH24:MI:SS') AS deal_time FROM dual;
--
--update RMS_NEPORT_2GX port
--set port.PORT_STATUS_USER=null;
--
--
--update RMS_NEPORT_2GX port
--set port.PORT_STATUS_USER='占用'
--where exists(
--  select 1
--  from RMS_TRANSCIR_USER
--  where REMOTE_TRANS_PORT=port.OLD_NAME
--       and REMOTE_TRANS_EQU=port.SOURCE_NE_COL
--);
--
--update RMS_NEPORT_2GX port
--set port.PORT_STATUS_USER='占用'
--WHERE exists (
--    SELECT 1
--    FROM RMS_TRANSCIR_USER usr
--    where usr.SOURCE_TRANS_PORT = port.OLD_NAME
--      and usr.SOURCE_NE= port.SOURCE_NE_COL 
--);
--
--UPDATE RMS_NEPORT_2GX PORT 
--SET port.PORT_STATUS_USER='空闲'
--WHERE port.PORT_STATUS_USER is null;
--
分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

    neport口封装 即串口转以太网口

    NEPORT口(串口转以太网)的PCB封装库,希望对大家有帮助

    联耀科技 NePort系列嵌入式联网模块产品简介.pdf

    NePort系列具备最高的设备服务器集成水平,其紧凑的RJ45封装内集成了32位RISC处理器、10/100兆以太网收发器、高速串行端口、状态/诊断LED灯以及2个可编程的I/O引脚。NePort节省的空间通常被连接器占用,却提供完整的...

    世界上最小的高稳定可靠低功耗的串口联网模块Neport.rar

    标题中的“世界上最小的高稳定可靠低功耗的串口联网模块Neport.rar”指的是一种先进的物联网技术产品,名为Neport。这个模块是专为串行通信设计的,具有小巧的体积、卓越的稳定性、高可靠性以及低功耗的特点。在...

    基于STM32的多网络人防警报终端设计.pdf

    其中,STM32F103VCT6-2型微控制器被选为主控芯片,其内部集成的多种外设接口,使得该芯片能够方便地连接到多种类型的传感器、通信模块和报警设备。由于其高性能的处理能力和丰富的外设,STM32微控制器适合在复杂的...

    串口转以太网模块

    接下来,从描述中的“NePort串口转以太网模块用户手册”可以看出,NePort系列模块由Conextop公司生产,具备多个高速串口和10M/100M以太网接口,这表明模块在数据传输速度和接口兼容性方面具有优势。用户手册的提供,...

Global site tag (gtag.js) - Google Analytics