Last active
August 29, 2015 14:20
-
-
Save Pavelyev/71dbaeb13721f2de5314 to your computer and use it in GitHub Desktop.
Oracle field int to varchar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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