Parse queries to csv

Signed-off-by: Lucas Fernandes de Oliveira's avatarLucas Fernandes de Oliveira <lfoliveira@inf.ufpr.br>
parent c626f73c
......@@ -7,6 +7,7 @@
-- query.
COPY(
SELECT
co.cod_gesac
, ct.name AS "responsible_name"
......@@ -23,4 +24,4 @@ FROM
WHERE
co.cod_gesac IS NOT NULL
AND p.is_active
;
) TO STDOUT WITH CSV HEADER DELIMITER ';';
......@@ -7,6 +7,7 @@
-- query.
COPY(
SELECT
c.city_code
, e.access_point_id
......@@ -25,4 +26,4 @@ FROM
INNER JOIN contact ct ON p.id = ct.id_point
WHERE
p.is_active
;
) TO STDOUT WITH CSV HEADER DELIMITER ';';
......@@ -7,6 +7,7 @@
-- query.
COPY(
SELECT
t.id_onid
, ct.name AS "responsible_name"
......@@ -23,4 +24,4 @@ FROM
WHERE
t.id_onid IS NOT NULL
AND p.is_active
;
) TO STDOUT WITH CSV HEADER DELIMITER ';';
......@@ -7,6 +7,7 @@
-- query.
COPY(
SELECT
c.name AS "city"
, c.state AS "state"
......@@ -49,4 +50,4 @@ FROM
WHERE
co.cod_gesac IS NOT NULL
AND p.is_active
;
) TO STDOUT WITH CSV HEADER DELIMITER ';';
......@@ -3,6 +3,7 @@
-- for details check simmctic/database/create/data/004-load_data_entity2.sql
-- and simmctic/database/create/data/entity2_temp.csv
COPY(
SELECT
c.name AS "city"
, c.state AS "state"
......@@ -43,4 +44,4 @@ FROM
LEFT OUTER JOIN address_alternative aa ON p.id = aa.id_point
WHERE
p.is_active
;
) TO STDOUT WITH CSV HEADER DELIMITER ';';
......@@ -7,6 +7,7 @@
-- query.
COPY(
SELECT
c.city_code
, e.access_point_id
......@@ -22,4 +23,4 @@ FROM
INNER JOIN entity_net en ON p.id = en.id_point
WHERE
p.is_active
;
) TO STDOUT WITH CSV HEADER DELIMITER ';';
......@@ -3,6 +3,7 @@
-- for details check simmctic/database/create/data/003-load_data_entity.sql
-- and simmctic/database/create/data/entity_temp.csv
COPY(
SELECT
c.name AS "city"
, c.state AS "state"
......@@ -35,4 +36,4 @@ FROM
LEFT OUTER JOIN address_alternative aa ON p.id = aa.id_point
WHERE
p.is_active
;
) TO STDOUT WITH CSV HEADER DELIMITER ';';
......@@ -7,6 +7,7 @@
-- query.
COPY(
SELECT
t.id_onid
, s.value
......@@ -19,4 +20,4 @@ FROM
WHERE
t.id_onid IS NOT NULL
AND p.is_active
;
) TO STDOUT WITH CSV HEADER DELIMITER ';';
......@@ -7,6 +7,7 @@
-- query.
COPY(
SELECT
c.name AS "city"
, c.state AS "state"
......@@ -54,4 +55,4 @@ FROM
WHERE
t.id_onid IS NOT NULL
AND p.is_active
;
) TO STDOUT WITH CSV HEADER DELIMITER ';';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment