select 'I'||TO_CHAR(SYSDATE,'YYYYMMDD')||trim(to_char(to_number(nvl(max(substr(CCID,-3)),0))+1,'000')) from ES_CC;