on 2022 Apr 15 11:48 AM
Hi all, I just started to learn about Dynamic SQL and I couldn't stop to wonder that if SAP uses it to search queries in DB Tables.
How does the system search for the data, Given that there are multiple Inputs one can give?
Thanks in advance. I am new to SAP and just curious.
Request clarification before answering.
If the question is, whether SAP products typically run “EXEC” or “EXECUTE IMMEDIATE” statements with inline string replacement, then the answer is: no. That’s neither safe nor efficient.
What usually happens - say in the ABAP environment or in CAP - is that the query structure is generally defined in the application code and/or the CDS data model. During execution the filter and projection conditions are handed over to the DB interface. This DB interface either picks a matching prepared SQL statement from the cache or prepares a new statement with the required number of filter parameters/conditions and selected columns.
Once prepared, the actual filter values can be assigned to the query parameters and the statement is then executed.
So, instead of dynamic SQL, a query generator is used. Which is the case with pretty much the case any DB heavy application (think any application that uses a DB access framework, ORM framework, or that has a user configurable query interface).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
30 | |
9 | |
7 | |
7 | |
6 | |
6 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.