I am trying the following Postgresql query with Prisma’s $executeRaw function. But it is not returning the values inserted. Instead only returning the number of records inserted.
await prismaClient.$executeRaw(`
INSERT INTO table1 (name, place, animal, thing)
SELECT * FROM table2
WHERE place = 'California'
RETURNING *;
`);
It is returning
1
While I want the records inserted to be returned. How can that be done?
2
Answers
Thanks to jian I got the answer
You are making insert and select from diferent tables. You are inserting in table1 and selecting from table2.
It could be the problem.
Try this.