-- create amper variable named environ
COLUMN environ NEW_VALUE environ
SELECT SUBSTR(USER,-3) AS environ -- get last 3 characters of schema
FROM DUAL;
SELECT *
FROM xyz_ods_&environ..client_store /* use two dots
1 for concatenation after variable and
the normal 1 between table_name.owner */
;
SELECT *
FROM xyz_sbx_str_&environ..master_map
;
No comments:
Post a Comment