agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: 2.andriychuk@gmail.com
To: 'Monalee Bhandge' <monalee.bhandge@epps-erp.com>
To: pgsql-sql@lists.postgresql.org
Subject: RE: How to use Array in Array of Json
Date: Mon, 25 Nov 2019 08:14:18 -0800
Message-ID: <044e01d5a3ab$642ddcc0$2c899640$@gmail.com> (raw)
In-Reply-To: <CAErOoCcu=xuySa1Za0acZ5hO4OjYs5982+9=6keV0dbZQTfK+w@mail.gmail.com>
References: <CAErOoCcu=xuySa1Za0acZ5hO4OjYs5982+9=6keV0dbZQTfK+w@mail.gmail.com>
Hi Monalee,
You can just use a json/jsonb variable. Content should be looking like this:
[
{“vin_comp_cd”: 1, “vin_div_cd”:11, “vin_array”: [{“vin_loc_cd”: 33, “vin_bt_cd”: 44}] },
…
{“vin_comp_cd”: N, “vin_div_cd”:NN, “vin_array”: [{“vin_loc_cd”: AA, “vin_bt_cd”: BB}] }
]
Or if “vin_loc_cd” and “vin_bt_cd” can be independent arrays if they are independent.
Best,
Igor
From: Monalee Bhandge <monalee.bhandge@epps-erp.com>
Sent: Monday, November 25, 2019 4:02 AM
To: pgsql-sql@lists.postgresql.org
Subject: How to use Array in Array of Json
Dear Friends,
My function definition is as:
CREATE OR REPLACE FUNCTION schema1.samplefun1(
vin_comp_cd smallint,
vin_div_cd smallint,
vin_loc_cd smallint[],
vin_bt_cd integer[],
)
Here instead of passing parameter I want to just send a single i/p in Json[].
My problem is how to pass array in Json[] variable. And how to use in code.
Thanking You!
Monalee
Database Lead Engineer.
view thread (5+ messages) latest in thread
Message-ID: <044e01d5a3ab$642ddcc0$2c899640$@gmail.com>
Permalink: ../044e01d5a3ab$642ddcc0$2c899640$@gmail.com/
Also on: postgresql.org/message-id/044e01d5a3ab$642ddcc0$2c899640$@gmail.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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: 2.andriychuk@gmail.com, monalee.bhandge@epps-erp.com, pgsql-sql@lists.postgresql.org
Subject: RE: How to use Array in Array of Json
In-Reply-To: <044e01d5a3ab$642ddcc0$2c899640$@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox