| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- set define off
- set echo on
- whenever sqlerror exit sql.sqlcode
- alter session set container=ORCLPDB;
- alter session set current_schema=PMS_TEST;
- declare
- v_count number;
- begin
- select count(*) into v_count from all_tables
- where owner='PMS_TEST' and table_name='PMS_FJYRJC_CSSG1_GRJJ_BAK_20261119';
- if v_count = 0 then
- execute immediate 'create table PMS_FJYRJC_CSSG1_GRJJ_BAK_20261119 as '
- || 'select * from GRJJ where YYRYID = 111157142';
- end if;
- select count(*) into v_count from all_tables
- where owner='PMS_TEST' and table_name='PMS_FJYRJC_CSSG1_QZ_BAK_20261119';
- if v_count = 0 then
- execute immediate 'create table PMS_FJYRJC_CSSG1_QZ_BAK_20261119 as '
- || 'select * from QZ where QZID = 5001141';
- end if;
- select count(*) into v_count from all_tables
- where owner='PMS_TEST' and table_name='PMS_FJYRJC_CSSG1_QZCY_BAK_20261119';
- if v_count = 0 then
- execute immediate 'create table PMS_FJYRJC_CSSG1_QZCY_BAK_20261119 as '
- || 'select * from QZCY where QZID = 5001141';
- end if;
- select count(*) into v_count from all_tables
- where owner='PMS_TEST' and table_name='PMS_FJYRJC_CSSG1_CREATED_20261119';
- if v_count = 0 then
- execute immediate 'create table PMS_FJYRJC_CSSG1_CREATED_20261119 '
- || '(GRJJID number, QZID number, QZCYID number, CREATED_AT timestamp)';
- end if;
- end;
- /
- select 'GRJJ' source,count(*) row_count from PMS_FJYRJC_CSSG1_GRJJ_BAK_20261119
- union all
- select 'QZ',count(*) from PMS_FJYRJC_CSSG1_QZ_BAK_20261119
- union all
- select 'QZCY',count(*) from PMS_FJYRJC_CSSG1_QZCY_BAK_20261119;
- exit
|