Re: How to use Array in Array of Json

Поиск
Список
Период
Сортировка
От Steve Midgley
Тема Re: How to use Array in Array of Json
Дата
Msg-id CAJexoS+5-VdD9YrWi=E800f_NoVRXsUMSutA_tdhzhksJZMPQg@mail.gmail.com
обсуждение исходный текст
Ответ на How to use Array in Array of Json  (Monalee Bhandge <monalee.bhandge@epps-erp.com>)
Список 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 по дате отправления:

Предыдущее
От: Monalee Bhandge
Дата:
Сообщение: How to use Array in Array of Json
Следующее
От:
Дата:
Сообщение: RE: How to use Array in Array of Json