We have a requirement where we need to add entries of TABLE1 into TABLE2 based on WHERE clause.
the only relevant document/blog I found is https://cap.cloud.sap/docs/node.js/cds-ql#insert-as and https://blogs.sap.com/2022/06/21/getting-started-with-cds.ql-in-nodejs-for-cap-101-on-how-to-query-data/
as of now I have implemented the below query which I am triggering through function defined in .cds file
const c = await INSERT.into("TABLE1").
as(SELECT.from("TABLE2").where({STATUS : 'X'}))
getting below 400 error.
{
"error": {
"code": "400",
"message": "Expected uri token 'EOF' could not be found in 'functionName();' at position 37"
}
}