CREATE OR REPLACE PROCEDURE p_ModifyObjectName(
    tablename character varying,
    objectname character varying,
    newobjectname character varying,
    objecttype character varying,
    fieldtype character varying DEFAULT ''::character varying)
AS
DECLARE
  v_str           varchar(2000);
  v_cnt           integer;
BEGIN

  IF (ObjectType =  'OBJECT') THEN
    select COUNT(1) into v_cnt from information_schema.tables where TABLE_NAME = lower(ObjectName);
    IF(v_cnt > 0) THEN
        v_str :=  ' ALTER TABLE ' || ObjectName || ' RENAME TO ' || NewObjectName || ' ';
        execute v_str;
    END IF;
  ELSIF (ObjectType =  'COLUMN') THEN
    SELECT COUNT(1) INTO v_cnt FROM information_schema.columns WHERE TABLE_NAME = lower(TableName) AND COLUMN_NAME = lower(ObjectName);
    IF(v_cnt > 0) THEN
        v_str := ' ALTER TABLE ' || TableName || ' RENAME ' || ObjectName || ' TO ' || NewObjectName || ' ';
		execute v_str;
    END IF;
  END IF;
END;
GO
