declare
procedure rename_col(table_in varchar2, col_in varchar2, new_name varchar2, new_col_type varchar2) is
sql_string varchar2(500);
begin
sql_string := 'ALTER TABLE ' || table_in || ' ADD ' || new_name || ' ' || new_col_type ;
	 dbms_output.put_line(sql_string);
	 EXECUTE IMMEDIATE sql_string; 
sql_string := 'update ' ||  table_in || ' set ' || new_name || ' = ' || col_in;
	 dbms_output.put_line(sql_string);
	 EXECUTE IMMEDIATE sql_string;
sql_string := 'commit';
	 dbms_output.put_line(sql_string);
	 EXECUTE IMMEDIATE sql_string; 
sql_string := 'ALTER TABLE ' || table_in || ' drop(' || col_in || ')';
	 dbms_output.put_line(sql_string);
	 EXECUTE IMMEDIATE sql_string; 
end;
begin
	 rename_col('logbook.AAA','Submission','Submission_2', 'number(3)');
end;


