Skip to content

Instantly share code, notes, and snippets.

@asgrdev
asgrdev / prosessInsertJson.sql
Last active January 14, 2019 12:05
postegreSql json input function with json rows return
CREATE OR REPLACE FUNCTION public.inseupcontacts(data json, img json)
RETURNS SETOF jsonb
LANGUAGE plpgsql
AS $function$
DECLARE
ref refcursor;
record contacts%ROWTYPE;
I_Max integer := json_array_length(data)-1;
uid integer;
name character varying;