ALTER TABLE PHARM.T_PACKAGE_TYPE ALTER COLUMN code TYPE integer;

INSERT INTO VCLib.T_GEN_NUMBERS
           (GenNumbersID
           ,EntityID
           ,NumberName
           ,NextNumber)
     VALUES
           (gen_random_uuid()
           ,(select e.EntityID from VCLib.T_ENTITIES e where e.EntName = 'PACKAGE_TYPE')
           ,'PHARM.PACKAGE_TYPE'
           ,(select coalesce(max(Code) + 1, 1) from PHARM.T_PACKAGE_TYPE));
