Re: How to use Array in Array of Json - Mailing list pgsql-sql

From Steve Midgley
Subject Re: How to use Array in Array of Json
Date
Msg-id CAJexoS+5-VdD9YrWi=E800f_NoVRXsUMSutA_tdhzhksJZMPQg@mail.gmail.com
Whole thread Raw
In response to How to use Array in Array of Json  (Monalee Bhandge <monalee.bhandge@epps-erp.com>)
List pgsql-sql


On Mon, Nov 25, 2019 at 4:09 AM Monalee Bhandge <monalee.bhandge@epps-erp.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

pgsql-sql by date:

Previous
From: Monalee Bhandge
Date:
Subject: How to use Array in Array of Json
Next
From:
Date:
Subject: RE: How to use Array in Array of Json