Hi,
I have a Static SQL and wish to write as a Dynamic SQL since the FROM Clause and WHERE Clause may change depending on some situations
Here is the Static SQL:
SELECT COUNT(*)
INTO :WS-COUNT
FROM EC181
WHERE PRCS_STTS_NM = 'NEW'
I understand that Host Variables cannot be used in Dynamic SQL and that Parameter Marker may be used in its place.
However, I have not seen any examples of how a Paramerter Marker can be used. Also, if I use Parameter Marker in place of WS-COUNT, how can I capture the count value in any variable? The count value captured needs to be passed to another program.
Please let me know how to execute the above SQL as a Dynamic SQL.
Thanks!!