From 4cafbff49aa054655b7623d3514c1241abf5877f Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 11 Oct 2017 13:44:56 -0400 Subject: [PATCH] filter for single source and add insert to trans --- srce.pgsql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/srce.pgsql b/srce.pgsql index 4f49fdb..783428f 100644 --- a/srce.pgsql +++ b/srce.pgsql @@ -59,6 +59,8 @@ begin TPS.srce --unwrap the schema definition array LEFT JOIN LATERAL jsonb_populate_recordset(null::tps.srce_defn_schema, defn->'schema') prs ON TRUE + WHERE + srce = 'PNCO' GROUP BY srce; @@ -79,6 +81,9 @@ $$; --SELECT * FROM csv_i; -COPY csv_i FROM 'C:\Users\ptrowbridge\downloads\transsearchcsv.csv' WITH (HEADER TRUE,DELIMITER ',', FORMAT CSV, ENCODING 'SQL_ASCII',QUOTE '"'); +COPY csv_i FROM 'C:\Users\ptrowbridge\Documents\OneDrive - The HC Companies, Inc\Cash\build_hist\full_dl\15Q1bal.csv' WITH (HEADER TRUE,DELIMITER ',', FORMAT CSV, ENCODING 'SQL_ASCII',QUOTE '"'); -SELECT row_to_json(csv_i) FROM csv_i; \ No newline at end of file +INSERT INTO + tps.trans (srce, rec) +SELECT + 'PNCO', row_to_json(csv_i) FROM csv_i; \ No newline at end of file