是否可以在不限定数据库名称的情况下运行 SQL 脚本?目前,我们正在使用如下程序,
SELECT I.XXXX_LOC_SKEY,
C.COUNTRY_SKEY
FROM
DEV_XXXX_DB.STAGING.XX_TABLE_LOCATION_SALES F,
DEV_XXXX_PRESENTATION_DB.DIMS.XXXX_LOCATIONS_D I,
DEV_XXXX_PRESENTATION_DB.DIMS.COUNTRY_D C,
DEV_XXXX_PRESENTATION_DB.DIMS.XXXX_DAILY_CALENDAR_D H
WHERE
F.STORE_CODE = I.DOOR
AND I.CHANNEL = 'XXXX'
AND F.COUNTRY = C.COUNTRY_CODE
AND I.COUNTRY_SKEY = C.COUNTRY_SKEY
AND F.DATE = H.DATE;
我们想运行相同的脚本,但不提及数据库名称,如下所示。
SELECT I.XXXX_LOC_SKEY,
C.COUNTRY_SKEY
FROM
STAGING.XX_TABLE_LOCATION_SALES F,
DIMS.XXXX_LOCATIONS_D I,
DIMS.COUNTRY_D C,
DIMS.XXXX_DAILY_CALENDAR_D H
WHERE
F.STORE_CODE = I.DOOR
AND I.CHANNEL = 'XXXX'
AND F.COUNTRY = C.COUNTRY_CODE
AND I.COUNTRY_SKEY = C.COUNTRY_SKEY
AND F.DATE = H.DATE;