Skip to content

Instantly share code, notes, and snippets.

@Pavelyev
Last active August 29, 2015 14:20
Show Gist options
  • Save Pavelyev/71dbaeb13721f2de5314 to your computer and use it in GitHub Desktop.
Save Pavelyev/71dbaeb13721f2de5314 to your computer and use it in GitHub Desktop.
Oracle field int to varchar
alter table $TABLE_NAME$ add tmp_string varchar(10);
update $TABLE_NAME$ set tmp_string = cast($FIELD_NAME$ as varchar(10));
alter table $TABLE_NAME$ drop column $FIELD_NAME$;
alter table $TABLE_NAME$ rename column tmp_string to $FIELD_NAME$;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment