Is there any way i can build the sql query in a subprogram by passing parms from the main program. also execute the query in the sub pgm and return the value back to the main pgm. for Direct query like
SELECT COL1, COL2, COL3
FROM TAB_X
WHERE COL1 = :hvar
Create a table which contains 2 columns viz 1. Unquie integer number and other column corresponds to the SQL query. So now pass the parm to this sub program and query against this new table and gives these parms values against the first column and get the corresponding SQL and string it form a dynamic query.