--Order 20011048.90
begin
  execute immediate('insert into systemsetting
select ''COGALLOWEDONLYPLPCEXT'',
       p.plant_id,
       ''Customer Screen Settings'',
       (select decode(st.value,''N'',''2'',''1'') from systemsetting st where st.name = ''COGALLOWEDONLYPLPC'' and st.plant_id = p.plant_id),
       ''I'',
       ''1'',
       ''Y'',
       ''N'',
        1,
        3,
        trim('' ''),
        ''Module EXTENDEDCODEUNIQUECOG :default value for attribute in customer screen. '' || chr(10) || 
        ''1: only allow to select products defined in PLPC to select for adding COG item.''|| chr(10) ||''2: allow to select other products (defined in COG wash price table) to select when adding COG item. The product will be added in the PLPC.''|| chr(10) ||''3: only allow to select restricted products defined in PLPC to select for adding COG item.''|| chr(10) || chr(10) ||''This setting is derived from the setting COGALLOWEDONLYPLPC but extended with a third option and it replaces it as of now.'',
        getminsystemuser(),
        sysdate,
       trim(''Y'')
       from dual, plant p');
exception
  when others then
    null;
end;
/

commit;