Arfath Tade
09/15/2021, 3:53 PMmodel Test {
id string
res Json
}
I want to update multiple rows with different id of the above model
I am getting syntax error while running the below query
prisma.$queryRaw(`UPDATE "TEST" AS T SET
"res" = a.res
FROM (VALUES ${updatedData})
AS a(id, res)
WHERE a.id = C.id;`);
updateData have value ('1', '[{"name": 'abc'}]'), ('2', '[{"name": 'xyz'}]')
I tried adding JSONB after every res values and also after a.res but nothing worked
can you please help me on this?
Error:
(node:23980) UnhandledPromiseRejectionWarning: Error:
Invalid `prisma.queryRaw()` invocation:
Raw query failed. Code: `42601`. Message: `db error: ERROR: syntax error at or near "m"`
at cb (/node_modules/@prisma/dist/runtime/index.js:34800:17)Ryan
09/16/2021, 6:20 AMC here in:
WHERE a.id = C.id;`Arfath Tade
09/16/2021, 9:06 AM