I have a requirement in a SQL environment that under specific circumstances, all references to table (or view) A in a procedure actually use table (or view) B. On the iSeries I would have used the OVRDBF command to override references to table A with table B: OVRDBF FILE(A) TOFILE(B). What would be the equivalent to this in SQL? Is there one?
My goal is to end up with a procedure that is ignorant of the override. I don't want conditional logic inside the procedure that directs processing at table B when certain conditions are met. The vision:
Under typical circumstances: Just invoke the procedure
Under specific alternative circumstances: Perform the OVRDBF equivalent and then Invoke the procedure