Re: View of Union Multiple Tables - Only If table EXISTS

2021-07-25 Thread David G. Johnston
On Sunday, July 25, 2021, Avi Weinberg wrote: > > Is it possible to write the view syntax once and it will do some type of > SELECT IF EXISTS. > > > Not with a virew. Dynamic SQL in a function can be used to build a query at runtime that includes only tables that exist. David J.

View of Union Multiple Tables - Only If table EXISTS

2021-07-25 Thread Avi Weinberg
Hi, I would like to create a view which is UNION of multiple tables with the same name from different schemas. Select col1, col2 from schemaA.table UNION Select col1, col2 from schemaB.table However, it is possible that in some of the schemas the table was not created yet. I know I can check