i try to find a simple solution to update data with the json_to_record statement. I want to update the data every night with a json_array i get by web_craping. Any idea how i can solve the problem when theres a new article?
Thanks a lot :)
INSERT INTO prices
Select * from
json_to_record(
'{"distributor“: "1", "articelnr": 4711, "price": „700“, "delivery": "too late", "created_on": "2022-09-25 03:14:07"}'
) AS x(distributor INT, articelnr VARCHAR, price VARCHAR, delivery VARCHAR, created_on TIMESTAMP)
Is it possible to use an update statement in a similar way like:
UPDATE prices
SET
json_to_record(
'{"distributor“: "1", "articelnr": 4711, "price": „700“, "delivery": "too late", "created_on": "2022-09-25 03:14:07"}'
) AS x(distributor INT, articelnr VARCHAR, price VARCHAR, delivery VARCHAR, created_on TIMESTAMP)