0

このツールを使用してSQLコードを美化したい。このツールがそれを受け入れる前に、置換機能を使用して、TextPadの「<*>」(二重引用符を除く)の各インスタンスを「\ n \ n \ n \ n \ n」(5つの新しい行)に置き換えたいと思います。正規表現。これどうやってするの?

ここに画像の説明を入力してください

http://www.dpriver.com/pp/sqlformat.htm

insert into i2b2demodata.QUERY_GLOBAL_TEMP ( patient_num , panel_count) select patient_num ,1 as panel_count from ( select /*+ index(observation_fact fact_cnpt_pat_enct_idx) */ patient_num from i2b2demodata.observation_fact where concept_cd IN (select concept_cd from i2b2demodata.concept_dimension where concept_path LIKE '\i2b2\Reports\%') AND ( valtype_cd = 'B' AND contains(observation_blob,'Arthritis') > 0 ) group by patient_num ) t <*> insert into i2b2demodata.DX ( patient_num ) select * from ( select distinct patient_num from i2b2demodata.QUERY_GLOBAL_TEMP where panel_count = 1 ) q <*> insert into i2b2demodata.MASTER_QUERY_GLOBAL_TEMP(master_id, patient_num, level_no) select 'masterid:22', patient_num, 0 from i2b2demodata.QUERY_GLOBAL_TEMP where patient_num IN ( select patient_num from i2b2demodata.QUERY_GLOBAL_TEMP where panel_count = 1 ) <*> delete i2b2demodata.DX <*> delete i2b2demodata.QUERY_GLOBAL_TEMP <*> insert into i2b2demodata.QUERY_GLOBAL_TEMP ( patient_num , panel_count) select patient_num ,1 as panel_count from ( select /*+ index(observation_fact fact_cnpt_pat_enct_idx) */ patient_num from i2b2demodata.observation_fact where concept_cd IN (select concept_cd from i2b2demodata.concept_dimension where concept_path LIKE '\i2b2\Diagnoses\Digestive system (520-579)\%') group by patient_num ) t <*> update i2b2demodata.QUERY_GLOBAL_TEMP set panel_count = 2 where i2b2demodata.QUERY_GLOBAL_TEMP.panel_count = 1 <*> update i2b2demodata.QUERY_GLOBAL_TEMP set panel_count = -1 where i2b2demodata.QUERY_GLOBAL_TEMP.panel_count = 2 and exists ( select 1 as panel_count from ( select /*+ index(observation_fact fact_cnpt_pat_enct_idx) */ patient_num from i2b2demodata.observation_fact where concept_cd IN (select concept_cd from i2b2demodata.concept_dimension where concept_path LIKE '\i2b2\Diagnoses\Circulatory system (390-459)\%') group by patient_num having count( distinct patient_num || '|' || encounter_num || '|' || provider_id || '|' || instance_num || '|' ||concept_cd || '|' ||cast(start_date as varchar(50) ) ) >= 3 ) t where i2b2demodata.QUERY_GLOBAL_TEMP.patient_num = t.patient_num group by patient_num ) <*> insert into i2b2demodata.DX ( patient_num ) select * from ( select distinct patient_num from i2b2demodata.QUERY_GLOBAL_TEMP where panel_count = 2 ) q <*> delete i2b2demodata.MASTER_QUERY_GLOBAL_TEMP where master_id = 'masterid:22' and level_no >= 1 <*> <*> insert into i2b2demodata.MASTER_QUERY_GLOBAL_TEMP(master_id, patient_num, level_no) select 'masterid:21', patient_num, 0 from i2b2demodata.QUERY_GLOBAL_TEMP where patient_num IN ( select patient_num from i2b2demodata.QUERY_GLOBAL_TEMP where panel_count = 2 ) <*> delete i2b2demodata.DX <*> delete i2b2demodata.QUERY_GLOBAL_TEMP <*> insert into i2b2demodata.QUERY_GLOBAL_TEMP ( patient_num , panel_count) select patient_num ,1 as panel_count from ( select patient_num from i2b2demodata.MASTER_QUERY_GLOBAL_TEMP where master_id = 'masterid:22' group by patient_num ) t <*> update i2b2demodata.QUERY_GLOBAL_TEMP set panel_count =2 where exists ( select 1 as panel_count from ( select patient_num from i2b2demodata.MASTER_QUERY_GLOBAL_TEMP where master_id = 'masterid:21' group by patient_num ) t where i2b2demodata.QUERY_GLOBAL_TEMP.panel_count = 1 and i2b2demodata.QUERY_GLOBAL_TEMP.patient_num = t.patient_num ) <*> insert into i2b2demodata.DX ( patient_num ) select * from ( select distinct patient_num from i2b2demodata.QUERY_GLOBAL_TEMP where panel_count = 2 ) q
4

1 に答える 1

1

<*>に一致する正規表現は<\*>です。

于 2012-07-12T01:32:40.190 に答える