目的:有一份sql代码,我们要提取出所的table name,并且生成drop table [table name];
-------------------------------------------------------- -- DDL for Table CIG_BNF_RMK -------------------------------------------------------- CREATE TABLE "DBO"."CIG_BNF_RMK" ( "WF_POLID" VARCHAR2(30 BYTE),"WF_PLANGRP" VARCHAR2(20 BYTE),"WF_RMKITM" NUMBER(*,0),"WF_RMKITM9" NVARCHAR2(2000),) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "POLYO" ; -------------------------------------------------------- -- DDL for Table CIG_BNF_RMK_PKG_W1 -------------------------------------------------------- CREATE GLOBAL TEMPORARY TABLE "DBO"."CIG_BNF_RMK_PKG_W1" ( "WF_POLID" VARCHAR2(30 BYTE),"WF_RMKITM9" NVARCHAR2(120),) ON COMMIT DELETE ROWS ; -------------------------------------------------------- -- DDL for Table CIG_CLM -------------------------------------------------------- CREATE TABLE "DBO"."CIG_CLM" ( "WF_POLID" VARCHAR2(30 BYTE),"WF_CLMNO" VARCHAR2(20 BYTE),"WF_CERTNO" VARCHAR2(20 BYTE),"WF_CONDATE" DATE,"WF_DISDATE" DATE,"WF_BNFCODE" VARCHAR2(3 BYTE),"WF_BNFCODE9" NVARCHAR2(120),"WF_CLMTYPE9" VARCHAR2(20 BYTE),"WF_INCAMT" NUMBER(19,2),"WF_PAIDAMT" NUMBER(19,"WF_SETDATE" DATE,"WF_PAYMTD" VARCHAR2(50 BYTE),"WF_PAYDATE" DATE,"WF_CLM_STS9" VARCHAR2(10 BYTE),"WF_CCY" VARCHAR2(3 BYTE),) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "POLYO" ;
(a)查找目标中输入正则表达式
CREATE (GLOBAL TEMPORARY TABLE|TABLE) \"DBO\"\.\"[A-Za-z0-9\_]+\"
(b)选中”标记所在行“
(c)查找模式中选中”正则表达式“
好了,按”查找全部“,看下图(可以看到查找到的行都上了色)
Step 2: 菜单 -> [搜索] -> [书签] -> [复制书签行]
然后,开个新文件,贴上就OK了,如下图(可以看到所有的CREATE TABLE ....行都复制过来了)
太好用了,给Notepad++作者点100个赞
原文链接:https://www.f2er.com/regex/358435.html