用Linux shell 脚本实现检索.sql文件的sql语句中共有多少行含有某个表名,怎么写 5
例如:下面是一个.sql文件,做一个shell脚本,统计出包含A_MON_UNIT_BAL表的insert有多少个。insertintoAUTO_TEST_INFOSEL...
例如:下面是一个.sql文件,做一个shell脚本,统计出包含A_MON_UNIT_BAL表的insert有多少个。
insert into AUTO_TEST_INFO SELECT 'A_MON_UNIT_BAL||MON_UNIT_ID' AS OBJECT_NAME,'awm_logic_check'AS type, CASE WHEN COUNT(MON_UNIT_ID)=0 THEN 0 ELSE 1 END AS cnt,TO_CHAR(DATE(NOW()),'yyyymmdd') AS running_date,'YYYYMMDD'AS data_date from A_MON_UNIT_BAL WHERE MON_UNIT_ID NOT IN(SELECT MON_UNIT_ID FROM A_MON_UNIT WHERE MON_UNIT_TP_ID=3500006) and BSN_DT = 'YYYYMMDD'; 展开
insert into AUTO_TEST_INFO SELECT 'A_MON_UNIT_BAL||MON_UNIT_ID' AS OBJECT_NAME,'awm_logic_check'AS type, CASE WHEN COUNT(MON_UNIT_ID)=0 THEN 0 ELSE 1 END AS cnt,TO_CHAR(DATE(NOW()),'yyyymmdd') AS running_date,'YYYYMMDD'AS data_date from A_MON_UNIT_BAL WHERE MON_UNIT_ID NOT IN(SELECT MON_UNIT_ID FROM A_MON_UNIT WHERE MON_UNIT_TP_ID=3500006) and BSN_DT = 'YYYYMMDD'; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询