From f946885161b9ad0066c5d264089c24243bc70f42 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 16 Jan 2024 23:00:23 +0800 Subject: [PATCH] =?UTF-8?q?add=20workflow=20=E6=B3=B0=E5=85=8B=E5=AE=A2?= =?UTF-8?q?=E6=88=B7,dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tk_cust/china_city/S98_S_china_city.sql | 38 +++++++++++++++++++ .../tk_cust/china_city/sa_foreign_tables.sql | 16 ++++++++ TK_Cust/dev/tk_cust/china_city/sa_tables.sql | 35 +++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 TK_Cust/dev/tk_cust/china_city/S98_S_china_city.sql create mode 100644 TK_Cust/dev/tk_cust/china_city/sa_foreign_tables.sql create mode 100644 TK_Cust/dev/tk_cust/china_city/sa_tables.sql diff --git a/TK_Cust/dev/tk_cust/china_city/S98_S_china_city.sql b/TK_Cust/dev/tk_cust/china_city/S98_S_china_city.sql new file mode 100644 index 0000000..0f82509 --- /dev/null +++ b/TK_Cust/dev/tk_cust/china_city/S98_S_china_city.sql @@ -0,0 +1,38 @@ +/*******Main Section**************************************************************************/ +\set ON_ERROR_STOP on +\set AUTOCOMMIT on +\timing on +delete from p10_sa.S98_S_china_city +; +insert into p10_sa.S98_S_china_city +( area_cn + , area_cd + , parent + , area_en + , etl_tx_dt ) + select + area_cn + , area_cd + , parent + , area_en + , etl_tx_dt + from p00_tal.S98_S_china_city + ; + delete from p12_sfull.S98_S_china_city +; +; +insert into p12_sfull.S98_S_china_city +( area_cn + , area_cd + , parent + , area_en + , etl_tx_dt ) + select + area_cn + , area_cd + , parent + , area_en + , etl_tx_dt + from p10_sa.S98_S_china_city +; +\q \ No newline at end of file diff --git a/TK_Cust/dev/tk_cust/china_city/sa_foreign_tables.sql b/TK_Cust/dev/tk_cust/china_city/sa_foreign_tables.sql new file mode 100644 index 0000000..452e196 --- /dev/null +++ b/TK_Cust/dev/tk_cust/china_city/sa_foreign_tables.sql @@ -0,0 +1,16 @@ + +CREATE FOREIGN TABLE if not exists p00_tal.S98_S_china_city ( + area_cn TEXT + , area_cd TEXT + , parent TEXT + , area_en TEXT + , etl_tx_dt TIMESTAMP +) + + +SERVER pgsql_server_S98_S OPTIONS(schema_name 'data_api', table_name 'china_city' ); + + + + + diff --git a/TK_Cust/dev/tk_cust/china_city/sa_tables.sql b/TK_Cust/dev/tk_cust/china_city/sa_tables.sql new file mode 100644 index 0000000..52c4962 --- /dev/null +++ b/TK_Cust/dev/tk_cust/china_city/sa_tables.sql @@ -0,0 +1,35 @@ + +create table if not exists p10_sa.S98_S_china_city ( + area_cn TEXT + , area_cd TEXT + , parent TEXT + , area_en TEXT + , etl_tx_dt TIMESTAMP +) ; + + COMMENT ON COLUMN p10_sa.S98_S_china_city.area_cn IS '地区名称'; + COMMENT ON COLUMN p10_sa.S98_S_china_city.area_cd IS '地区代码'; + COMMENT ON COLUMN p10_sa.S98_S_china_city.parent IS '上级地区'; + COMMENT ON COLUMN p10_sa.S98_S_china_city.area_en IS '城市英文'; + COMMENT ON COLUMN p10_sa.S98_S_china_city.etl_tx_dt IS ''; + +COMMENT ON TABLE p10_sa.S98_S_china_city IS ''; + + + +create table if not exists p12_sfull.S98_S_china_city ( + area_cn TEXT + , area_cd TEXT + , parent TEXT + , area_en TEXT + , etl_tx_dt TIMESTAMP +) ; + + COMMENT ON COLUMN p12_sfull.S98_S_china_city.area_cn IS '地区名称'; + COMMENT ON COLUMN p12_sfull.S98_S_china_city.area_cd IS '地区代码'; + COMMENT ON COLUMN p12_sfull.S98_S_china_city.parent IS '上级地区'; + COMMENT ON COLUMN p12_sfull.S98_S_china_city.area_en IS '城市英文'; + COMMENT ON COLUMN p12_sfull.S98_S_china_city.etl_tx_dt IS ''; + +COMMENT ON TABLE p12_sfull.S98_S_china_city IS ''; +