Re: [GENERAL] How to store multiple rows in array . - Mailing list pgsql-general

From brahmesr
Subject Re: [GENERAL] How to store multiple rows in array .
Date
Msg-id 1511143938357-0.post@n3.nabble.com
Whole thread Raw
In response to Re: [GENERAL] How to store multiple rows in array .  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [GENERAL] How to store multiple rows in array .
List pgsql-general
I already defined the composite type as
"validate_crtr_line_items$inv_lines_rt" with the selected
columns(COL1,COL2,COl3)

DeCLARE Block :
   INV_LINES_T  validate_crtr_line_items$inv_lines_rt ARRAY;   L_INV_LINES INV_LINES_T%TYPE;
L_INV_LINES$temporary_recordap.validate_crtr_line_items$inv_lines_rt;
 
Collecting the records into L_INV_LINES 

SELECT ARRAY (SELECT ROW (COL1,COL2, COUNT(*) *AS txn_cnt* )::
ap.validate_crtr_line_items$inv_lines_rt FROM Distinct_Records GROUP BY
COL1, COL2  HAVING COUNT(*) > 1) INTO L_INV_LINES;

ERROR:  syntax error at or near "AS"
LINE 73: COL1,COL2, COUNT(*) AS txn_cnt...

Why "AS" is throwing an error ?



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Chris Mair
Date:
Subject: Re: [GENERAL] parallel query in 9.6.6 + oracle_fdw -> ERROR: invalidcache ID: 41
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] How to store multiple rows in array .