The SQL statements were being executed within the programs conditionally. That is, the program had some conditional logic in it (written in RPG) which would determine whether we would execute one query or the other.
Now what we are trying to do is to create a single view which would be an equivalent of the RPG program.
That is somehow include the conditional logic in the view code.
Below is the simplest pseudocode of the view that I could imagine of what I am trying to achieve
Code: Select all
if (condition 1 is true)
Select * from table1;
else
Select * from table2;
Please note that the condition 1 used above is a very high level representation. The logic is actually comprised of several program calls etc.
Any advise would be appreciated.