@PAVB

Syntax of alter session was ok. Changed it to as suggested by you.

CREATE OR REPLACE PROCEDURE CHM_KPI_AUTO
IS
v_cnt number;
BEGIN
v_cnt:=0;
execute immediate 'alter session set global_names='''||'false'||'''' ;
select count(*) as KPI_1_APR_Numerator into v_cnt from [email protected] a where
a.ITEM = 'PREAPPR' and
a.PLANNED_START_MONTH = (select UPPER(to_char(add_months(sysdate,-1), 'mon')) from dual)
and a.PLANNED_START_YEAR = (select DECODE (UPPER(to_char(add_months(sysdate,-1), 'mon')),'DEC',to_char(to_char(sysdate,'yyyy')-1),to_char(sysdate,'yyyy')) from dual);

END;


Still get the same db link error which comes when global_names is set to true.


Regards