Quote Originally Posted by jaieesh View Post
CREATE OR REPLACE PROCEDURE CHM_KPI_AUTO IS
v_cnt number;
a_cnt number;
BEGIN

select 'alter session set global_names='''||'false'||'''' into a_cnt
from dual;
select count(*) 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;
Jaieesh --

What I gave you was a way to test if syntax was correct or not.

What you have to include in your code is:
execute immediate 'alter session set global_names='''||'false'||''''