Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[CAP] Select exists

So far I have not found a better/shorter way to check if a table entry exists than the following:

let exists = await SELECT(1).from(Books,201)
return (exists .length > 0) ? true : false

Found here: https://cap.cloud.sap/docs/node.js/cds-tx#cds-tx-ctx-fn

Leave a Reply

Your email address will not be published. Required fields are marked *