create or replace procedure "public"."extract"("arg" json)
language plpgsql
as $$
declare
"hell" json := "arg"->>'global', "arg"->> 'transactional';
begin
raise notice 'test:%', "hell"->>'packetType';
raise notice 'test1:%', "hell"->>'A';
-- freeze the input
end
$$;
call "public"."extract"('{"global":{"packetType":"1"},"transactional":{"A":{"electrical":"23"}}}');
我正在獲取的錯誤 - SQL 錯誤 [42601]:錯誤:查詢“SELECT "arg"->>'global', "arg"->> 'transactional'” 回傳 2 列其中:PL/pgSQL 函式“extract”(json ) 陳述句塊區域變數初始化期間的第 4 行
請你能幫我在哪里解決這個問題,我無法理解。
uj5u.com熱心網友回復:
變數“hell”在這里聽起來沒用,試試這樣的:
create or replace procedure "public"."extract"(arg json)
language plpgsql as $$
begin
raise notice 'test:%', arg->'global'->>'packetType';
raise notice 'test1:%', arg-> 'transactional'->>'A';
-- freeze the input
end ;
$$;
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/404628.html
標籤:
