Re: How to use Array in Array of Json

From: Steve Midgley <science(at)misuse(dot)org>
To: Monalee Bhandge <monalee(dot)bhandge(at)epps-erp(dot)com>
Cc: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: How to use Array in Array of Json
Date: 2019-11-25 16:13:44
Message-ID: CAJexoS+5-VdD9YrWi=E800f_NoVRXsUMSutA_tdhzhksJZMPQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Nov 25, 2019 at 4:09 AM Monalee Bhandge <
monalee(dot)bhandge(at)epps-erp(dot)com> wrote:

> 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.
>
>
> I believe you want a json conversion function. The entire list is here:
https://www.postgresql.org/docs/current/functions-json.html

I'm guessing that the following function would be very useful to take a
single input json structure and convert it for insertion as single record
in a table: json_populate_record

I hope that is helpful?
Steve

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message 2.andriychuk 2019-11-25 16:14:18 RE: How to use Array in Array of Json
Previous Message Monalee Bhandge 2019-11-25 12:02:12 How to use Array in Array of Json