CREATE OR REPLACE PROCEDURE p_ModifyObjectName
(
  TableName    IN  VARCHAR,
  ObjectName    IN  VARCHAR,
  NewObjectName  IN  VARCHAR,
  ObjectType    IN  VARCHAR,
  FieldType in VARCHAR := ''

) AS
  v_str           VARCHAR(2000);
  v_cnt           INTEGER;
BEGIN

  IF (ObjectType =  'OBJECT') THEN
    SELECT COUNT(1) INTO v_cnt FROM USER_TABLES WHERE TABLE_NAME = ObjectName;
    IF(v_cnt > 0) THEN
        v_str := ' ALTER TABLE ' || ObjectName || ' RENAME TO ' || NewObjectName || ' ';
		DBMS_OUTPUT.PUT_LINE('execute sql 1:' || v_str);
		EXECUTE IMMEDIATE v_str;
    END IF;
  ELSIF (ObjectType =  'COLUMN') THEN
    SELECT COUNT(1) INTO v_cnt FROM USER_TAB_COLUMNS WHERE TABLE_NAME = TableName AND COLUMN_NAME = ObjectName;
    IF(v_cnt > 0) THEN
        v_str := ' ALTER TABLE ' || TableName || ' RENAME COLUMN ' || ObjectName || ' TO ' || NewObjectName || ' ';
		DBMS_OUTPUT.PUT_LINE('execute sql 2:' || v_str);
		EXECUTE IMMEDIATE v_str;
    END IF;
  END IF;
END p_ModifyObjectName;
GO
