So, I studied programming in C macros and used them, but in my work I often use PL / SQL, and I was wondering if there is a way to do the same in PL / SQL. Right now I have a function call with three different by values and then returning the value, but the function is so simple that I think I can do it from within the original stored procedure. In C a, Macro is a line (or lines) of code that is simply completely replaced by a compilation call, but it is more efficient than calling a function many times.
Example from C:
#define query(fieldValue, Attribute, Table) (select fieldValue from Table where record = Attribute)
and when called in the body of the code, the request (value, value, value) will completely replace the select statement.
just an example of how it might appear in C, because I'm really not sure how it will be in PL / SQL.
Is this possible in SQL? It should be for 2-3 lines of code, here it is.
Thanks a lot, SMKS
source
share