I am storing schema names in table columns (e.g., SOURCE_SCHEMA
, TARGET_SCHEMA
) and am retrieving the schema name I want to work with as a variable in the DB2 stored procedure (e.g., vSchema
).
How do I then use the variable in a SQL statement, for example:
SELECT * from vSchema.TABLE_NAME
Is there a better way to do this? Thanks in advance.