Query doesn't run when function is passed
Hi All, we are on 11203 and I don't have access to the DB ( joined recently) yet. I need help in tuning the query below.
The query below doesn't start , and hung forever.
SELECT
src.addressid,
src.countrycode,
src.modifiableind,
src.addressdata,
src.addresslayouttype,
src.geocode,
src.latitude,
src.longitude,
src.versionno,
src.lastwritten,
CASE WHEN tgt.ADDRESSID IS NULL THEN 'I' ELSE 'U' END InsUpdInd
FROM CURAM_S1_USER.ADDRESS@sit src
LEFT OUTER JOIN ADDRESS tgt
ON tgt.ADDRESSID=src.ADDRESSID
WHERE NVL(src.lastwritten,SYSDATE) > get_ETL_TABLE_LASTWRITTEN('ADDRESS')
The function get_ETL_TABLE_LASTWRITTEN('ADDRESS') will return the value