show the number if impacted rows instead of returning nothing
This commit is contained in:
parent
9e381f7d78
commit
08cba77728
@ -1,4 +1,4 @@
|
|||||||
# execure the sql for scale which builds the sql and inserts into a table
|
# execure the sql for scale which builds the sql and inserts into a table
|
||||||
#$PG -f ./routes/scale/gen_scale.sql
|
psql -h hptrow.me -p 54329 -d ubm -U ptrowbridge -f ./setup_sql/05_gen_scale.sql
|
||||||
# pull the sql out of the table and write it to route directory
|
# pull the sql out of the table and write it to route directory
|
||||||
psql -h hptrow.me -p 54329 -d ubm -U ptrowbridge -c "SELECT t FROM fc.sql WHERE cmd = 'scale'" -t -A -o ./routes/scale/scale.sql
|
psql -h hptrow.me -p 54329 -d ubm -U ptrowbridge -c "SELECT t FROM fc.sql WHERE cmd = 'scale'" -t -A -o ./routes/scale/scale.sql
|
||||||
|
@ -140,6 +140,7 @@ FROM
|
|||||||
WHERE
|
WHERE
|
||||||
pscale.factor <> 0 or pscale.mod_price <> 0
|
pscale.factor <> 0 or pscale.mod_price <> 0
|
||||||
)
|
)
|
||||||
|
,ins AS (
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
fc.dcard
|
fc.dcard
|
||||||
SELECT
|
SELECT
|
||||||
@ -151,4 +152,8 @@ SELECT
|
|||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
pricing
|
pricing
|
||||||
|
RETURNING *
|
||||||
|
)
|
||||||
|
SELECT count(*) num_rows FROM ins
|
||||||
|
|
||||||
|
|
||||||
|
@ -245,6 +245,7 @@ FROM
|
|||||||
WHERE
|
WHERE
|
||||||
pscale.factor <> 0 or pscale.mod_price <> 0
|
pscale.factor <> 0 or pscale.mod_price <> 0
|
||||||
)
|
)
|
||||||
|
,ins AS (
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
$$||_target_table||$$
|
$$||_target_table||$$
|
||||||
SELECT
|
SELECT
|
||||||
@ -256,6 +257,10 @@ SELECT
|
|||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
pricing
|
pricing
|
||||||
|
RETURNING *
|
||||||
|
)
|
||||||
|
SELECT count(*) num_rows FROM ins
|
||||||
|
|
||||||
$$
|
$$
|
||||||
INTO
|
INTO
|
||||||
_sql;
|
_sql;
|
||||||
|
Loading…
Reference in New Issue
Block a user