|
-
 Originally Posted by jaieesh
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'||''''
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|