Hi,
I am trying to dynamically add a where clause to any existing SQL SELECT statement (any SELECT that comes from the user). The purpose is to allow them to select only the records flagged in a certain way. And, since the flag field is the same in all tables, I was thinking that a solution might be adding a where clause to any incoming SELECT statement. My problem is where to place this WHERE, since the SELECT can be in any format (from multiple table, with/without join, subqueries, groupings etc).
Any idea is appreciated,
Thank you
S
I am trying to dynamically add a where clause to any existing SQL SELECT statement (any SELECT that comes from the user). The purpose is to allow them to select only the records flagged in a certain way. And, since the flag field is the same in all tables, I was thinking that a solution might be adding a where clause to any incoming SELECT statement. My problem is where to place this WHERE, since the SELECT can be in any format (from multiple table, with/without join, subqueries, groupings etc).
Any idea is appreciated,
Thank you
S