DO $$ 
begin
if(exists(
SELECT *
  FROM information_schema.columns
 WHERE table_schema = 'vclib'
   AND table_name   = 't_dictionary_update'
	and column_name = 'keyattrpaths'
))
then
    ALTER TABLE VCLIB.T_DICTIONARY_UPDATE DROP COLUMN KeyAttrPaths;
end if;

if(exists(
SELECT *
  FROM information_schema.columns
 WHERE table_schema = 'vclib'
   AND table_name   = 't_dictionary_update'
	and column_name = 'attrspath'
))
then
ALTER TABLE VCLIB.T_DICTIONARY_UPDATE DROP COLUMN AttrsPath;
end if;

if(exists(
SELECT *
  FROM information_schema.columns
 WHERE table_schema = 'vclib'
   AND table_name   = 't_dictionary_update'
	and column_name = 'customattributes'
))
then
    ALTER TABLE VCLIB.T_DICTIONARY_UPDATE DROP COLUMN CustomAttributes;
end if;

	end;
$$
