Skip to content

Instantly share code, notes, and snippets.

@ujnak
Created June 15, 2023 01:07
JSON列を含む表を更新するコード
begin
case :APEX$ROW_STATUS
when 'C' then
insert into jig_clothes(
name
,features
,price
)
values
(
:NAME
,json_object(
key 'color' value :COLOR
,key 'size' value :SIZE
)
,:PRICE
)
returning id into :ID;
when 'U' then
update jig_clothes set
name = :NAME
,features = json_object(
key 'color' value :COLOR
,key 'size' value :SIZE
)
,price = :PRICE
where id = :ID;
when 'D' then
delete from jig_clothes where id = :ID;
end case;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment