show the number if impacted rows instead of returning nothing

This commit is contained in:
Paul Trowbridge 2022-05-12 00:17:31 -04:00
parent 9e381f7d78
commit 08cba77728
3 changed files with 11 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# 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
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

View File

@ -140,6 +140,7 @@ FROM
WHERE
pscale.factor <> 0 or pscale.mod_price <> 0
)
,ins AS (
INSERT INTO
fc.dcard
SELECT
@ -151,4 +152,8 @@ SELECT
*
FROM
pricing
RETURNING *
)
SELECT count(*) num_rows FROM ins

View File

@ -245,6 +245,7 @@ FROM
WHERE
pscale.factor <> 0 or pscale.mod_price <> 0
)
,ins AS (
INSERT INTO
$$||_target_table||$$
SELECT
@ -256,6 +257,10 @@ SELECT
*
FROM
pricing
RETURNING *
)
SELECT count(*) num_rows FROM ins
$$
INTO
_sql;