pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: brahmesr <brahmam1234@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: How to store multiple rows in array .
Date: Sun, 19 Nov 2017 19:12:18 -0700 (MST)
Message-ID: <1511143938357-0.post@n3.nabble.com> (raw)
In-Reply-To: <11642.1511116381@sss.pgh.pa.us>
References: <CA+wLFo2wXFyAmb26Qk8-HTELi0fb4Kr9-k0fAmJFYWh=xbDjZQ@mail.gmail.com>
	<CAFj8pRBmDcB_0nMQp4uiyV6XMZTh3xAhARRyiatR=7ZELyq0+g@mail.gmail.com>
	<11642.1511116381@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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_record ap.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



view thread (5+ messages)  latest in thread

Message-ID: <1511143938357-0.post@n3.nabble.com>
Permalink:  ../1511143938357-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1511143938357-0.post@n3.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: brahmam1234@gmail.com
  Subject: Re: How to store multiple rows in array .
  In-Reply-To: <1511143938357-0.post@n3.nabble.com>
  References: <CA+wLFo2wXFyAmb26Qk8-HTELi0fb4Kr9-k0fAmJFYWh=xbDjZQ@mail.gmail.com> <CAFj8pRBmDcB_0nMQp4uiyV6XMZTh3xAhARRyiatR=7ZELyq0+g@mail.gmail.com> <11642.1511116381@sss.pgh.pa.us> <1511143938357-0.post@n3.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox