‎2024 Aug 21 10:12 AM - edited ‎2024 Aug 21 10:15 AM
Hi,
we are using SAP service layer and calling the endpoint /SQLQueries('test_contactemployee')/List
we have a following Sql query to get all the contact employees.
SELECT BP."CardCode", BP."CardName", CE."Name", CE."Position", CE."Address", BP."QryGroup1",
CE."Tel1" AS "Phone1", CE."Tel2" AS "Phone2", CE."Cellolar" AS "MobilePhone",
CE."Fax" AS "Fax", CE."E_MailL" AS "EMail",
(SELECT COUNT(*) FROM "OCRD" BP2 JOIN "OCPR" CE2 ON BP2."CardCode" = CE2."CardCode") AS "@odata.count"
FROM "OCRD" BP
JOIN "OCPR" CE ON BP."CardCode" = CE."CardCode"
where BP."CardCode" = :CardCode
What we want to achieve is that if :CardCode is null then retrieve all records otherwise particular BP. And same goes for other parameters. What are the possibilities?
WHERE (:CardCode IS NULL OR BP."CardCode" = :CardCode)
Request clarification before answering.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.