{"id":854,"date":"2017-10-03T14:24:19","date_gmt":"2017-10-03T07:24:19","guid":{"rendered":"https:\/\/oracletutorial.com\/?page_id=854"},"modified":"2025-05-05T19:41:26","modified_gmt":"2025-05-06T02:41:26","slug":"oracle-alter-table-modify-column","status":"publish","type":"page","link":"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/","title":{"rendered":"Oracle ALTER TABLE MODIFY Column"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn how to use the Oracle <code>ALTER TABLE MODIFY<\/code> column statement to change the definition of existing columns.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-oracle-alter-table-modify-column-statement'>Introduction to Oracle ALTER TABLE MODIFY Column statement <a href=\"#introduction-to-oracle-alter-table-modify-column-statement\" class=\"anchor\" id=\"introduction-to-oracle-alter-table-modify-column-statement\" title=\"Anchor for Introduction to Oracle ALTER TABLE MODIFY Column statement\">#<\/a><\/h2>\n\n\n\n<p>To change the definition of a column in a table, you use the <code>ALTER TABLE MODIFY<\/code> column  statement.<\/p>\n\n\n\n<p>Here&#8217;s the basic syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> table_name \n<span class=\"hljs-keyword\">MODIFY<\/span> column_name <span class=\"hljs-keyword\">action<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, specify the name of table from which you want to modify a column in the <code>ALTER TABLE<\/code> clause.<\/li>\n\n\n\n<li>Second, prorivde the column name and action you want to perform in the <code>MODIFY<\/code> clause.<\/li>\n<\/ul>\n\n\n\n<p>Oracle allows you to perform many actions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Modifying the visiblity of a column.<\/li>\n\n\n\n<li>Adding \/ removing <code>NOT NULL<\/code> constraints.<\/li>\n\n\n\n<li>Making the column&#8217;s size bigger or smaller.<\/li>\n\n\n\n<li>Changing the default value of a column.<\/li>\n\n\n\n<li>Modifying the expression of virtual columns.<\/li>\n<\/ul>\n\n\n\n<p>Oracle lets you to modify multiple columns at once using the following syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> table_name\n<span class=\"hljs-keyword\">MODIFY<\/span> (\n    column1 action1,\n    column2 action2,\n    ...\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='oracle-alter-table-modify-column-examples'>Oracle ALTER TABLE MODIFY column examples <a href=\"#oracle-alter-table-modify-column-examples\" class=\"anchor\" id=\"oracle-alter-table-modify-column-examples\" title=\"Anchor for Oracle ALTER TABLE MODIFY column examples\">#<\/a><\/h2>\n\n\n\n<p>First, <a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-create-table\/\">create a new table<\/a> called<code>accounts<\/code> :<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> accounts (\n    account_id <span class=\"hljs-built_in\">NUMBER<\/span> <span class=\"hljs-keyword\">GENERATED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-keyword\">DEFAULT<\/span> <span class=\"hljs-keyword\">AS<\/span> <span class=\"hljs-keyword\">IDENTITY<\/span>,\n    first_name <span class=\"hljs-built_in\">VARCHAR2<\/span>(<span class=\"hljs-number\">25<\/span>) <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>,\n    last_name <span class=\"hljs-built_in\">VARCHAR2<\/span>(<span class=\"hljs-number\">25<\/span>) <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>,\n    email <span class=\"hljs-built_in\">VARCHAR2<\/span>(<span class=\"hljs-number\">100<\/span>),\n    phone <span class=\"hljs-built_in\">VARCHAR2<\/span>(<span class=\"hljs-number\">12<\/span>),\n    full_name <span class=\"hljs-built_in\">VARCHAR2<\/span>(<span class=\"hljs-number\">51<\/span>) <span class=\"hljs-keyword\">GENERATED<\/span> <span class=\"hljs-keyword\">ALWAYS<\/span> <span class=\"hljs-keyword\">AS<\/span>( \n            first_name || <span class=\"hljs-string\">' '<\/span> || last_name\n    ),\n    PRIMARY <span class=\"hljs-keyword\">KEY<\/span>(account_id)\n);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, <a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-insert\/\">insert some rows<\/a> into the <code>accounts<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">INSERT<\/span> <span class=\"hljs-keyword\">INTO<\/span> accounts(first_name,last_name,phone)\n<span class=\"hljs-keyword\">VALUES<\/span>(<span class=\"hljs-string\">'Trinity'<\/span>,\n       <span class=\"hljs-string\">'Knox'<\/span>,\n       <span class=\"hljs-string\">'410-555-0197'<\/span>);\n\n\n<span class=\"hljs-keyword\">INSERT<\/span> <span class=\"hljs-keyword\">INTO<\/span> accounts(first_name,last_name,phone)\n<span class=\"hljs-keyword\">VALUES<\/span>(<span class=\"hljs-string\">'Mellissa'<\/span>,\n       <span class=\"hljs-string\">'Porter'<\/span>,\n       <span class=\"hljs-string\">'410-555-0198'<\/span>);\n\n\n<span class=\"hljs-keyword\">INSERT<\/span> <span class=\"hljs-keyword\">INTO<\/span> accounts(first_name,last_name,phone)\n<span class=\"hljs-keyword\">VALUES<\/span>(<span class=\"hljs-string\">'Leeanna'<\/span>,\n       <span class=\"hljs-string\">'Bowman'<\/span>,\n       <span class=\"hljs-string\">'410-555-0199'<\/span>);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, verify the inserts by using the following <code><a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-select\/\">SELECT<\/a><\/code> statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> * <span class=\"hljs-keyword\">FROM<\/span> accounts;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"484\" height=\"82\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-example.png\" alt=\"Oracle ALTER TABLE MODIFY Column - example\" class=\"wp-image-855\" srcset=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-example.png 484w, https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-example-300x51.png 300w\" sizes=\"auto, (max-width: 484px) 100vw, 484px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='modify-the-columns-visibility'>Modify the column&#8217;s visibility <a href=\"#modify-the-columns-visibility\" class=\"anchor\" id=\"modify-the-columns-visibility\" title=\"Anchor for Modify the column&#039;s visibility\">#<\/a><\/h3>\n\n\n\n<p>Starting from Oracle 12c, you can define table columns as invisible or visible. Invisible columns are not available for the query like:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> * <span class=\"hljs-keyword\">FROM<\/span> table_name;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Or:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">DESCRIBE<\/span> table_name;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>However, you can query the invisible columns by specifying them explicitly in the query:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    invisible_column_1,\n    invisible_column_2\n<span class=\"hljs-keyword\">FROM<\/span>\n    table_name;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Table columns are visible by default. You can define an invisible column when you create the table or using <code>ALTER TABLE MODIFY<\/code> column statement.<\/p>\n\n\n\n<p>For example, the following statement makes the <code>full_name<\/code> column invisible:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> accounts \n<span class=\"hljs-keyword\">MODIFY<\/span> full_name <span class=\"hljs-keyword\">INVISIBLE<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"385\" height=\"80\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-visibility-example.png\" alt=\"Oracle ALTER TABLE MODIFY Column visibility example\" class=\"wp-image-856\" title=\"Oracle ALTER TABLE MODIFY Column visibility example\" srcset=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-visibility-example.png 385w, https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-visibility-example-300x62.png 300w\" sizes=\"auto, (max-width: 385px) 100vw, 385px\" \/><\/figure>\n\n\n\n<p>The following statement returns data from all columns of the <code>accounts<\/code> table except the <code>full_name<\/code> column:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> * <span class=\"hljs-keyword\">FROM<\/span> accounts; <\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This is because the <code>full_name<\/code> column is invisible.<\/p>\n\n\n\n<p>To change a column from invisible to visible, you use the following statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> accounts \n<span class=\"hljs-keyword\">MODIFY<\/span> full_name <span class=\"hljs-keyword\">VISIBLE<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='adding-removing-not-null-constraints'>Adding \/ removing NOT NULL constraints <a href=\"#adding-removing-not-null-constraints\" class=\"anchor\" id=\"adding-removing-not-null-constraints\" title=\"Anchor for Adding \/ removing NOT NULL constraints\">#<\/a><\/h3>\n\n\n\n<p>The following statement adds the <code>NOT NULL<\/code> constraint to the <code>email<\/code> column:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> accounts \n<span class=\"hljs-keyword\">MODIFY<\/span> email <span class=\"hljs-built_in\">VARCHAR2<\/span>( <span class=\"hljs-number\">100<\/span> ) <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>However, Oracle issued the following error:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">SQL Error: ORA-02296: cannot enable (OT.) - null <span class=\"hljs-keyword\">values<\/span> <span class=\"hljs-keyword\">found<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>When you change a column from nullable to non-nullable, you must ensure that the existing data meets the new constraint.<\/p>\n\n\n\n<p>To fix this, we update the values for the <code>email<\/code> column first:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">UPDATE<\/span> \n    accounts\n<span class=\"hljs-keyword\">SET<\/span> \n    email = <span class=\"hljs-keyword\">LOWER<\/span>(first_name || <span class=\"hljs-string\">'.'<\/span> || last_name || <span class=\"hljs-string\">'@oracletutorial.com'<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Note that the <code><a href=\"https:\/\/www.oracletutorial.com\/oracle-string-functions\/oracle-lower\/\">LOWER()<\/a><\/code> function converts a string to lowercase.<\/p>\n\n\n\n<p>And then change the column&#8217;s constraint:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> accounts \n<span class=\"hljs-keyword\">MODIFY<\/span> email <span class=\"hljs-built_in\">VARCHAR2<\/span>( <span class=\"hljs-number\">100<\/span> ) <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Now, it is working as expected.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='widen-or-shorten-the-size-of-a-column-example'>Widen or shorten the size of a column example <a href=\"#widen-or-shorten-the-size-of-a-column-example\" class=\"anchor\" id=\"widen-or-shorten-the-size-of-a-column-example\" title=\"Anchor for Widen or shorten the size of a column example\">#<\/a><\/h3>\n\n\n\n<p>Suppose you want to add international code to the phone numbers. Before doing it, you must make tthe sizze of the phone column longer:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-16\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> accounts \n<span class=\"hljs-keyword\">MODIFY<\/span> phone <span class=\"hljs-built_in\">VARCHAR2<\/span>( <span class=\"hljs-number\">15<\/span> );<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-16\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Now, you can update the phone numbers:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-17\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">UPDATE<\/span>\n    accounts\n<span class=\"hljs-keyword\">SET<\/span>\n    phone = <span class=\"hljs-string\">'+1-'<\/span> || phone;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-17\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The following statement verifies the update:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-18\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    *\n<span class=\"hljs-keyword\">FROM<\/span>\n    accounts;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-18\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"79\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-column-widen-column-size-example.png\" alt=\"Oracle ALTER TABLE MODIFY column - widen column size example\" class=\"wp-image-857\" title=\"Oracle ALTER TABLE MODIFY column - widen column size example\" srcset=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-column-widen-column-size-example.png 697w, https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-column-widen-column-size-example-300x34.png 300w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/figure>\n\n\n\n<p>To shorten the size of a column, you make sure that all data in the column fits the new size.<\/p>\n\n\n\n<p>For example, we try to shorten the size of the <code>phone<\/code> column down to 12 characters:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-19\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> accounts \n<span class=\"hljs-keyword\">MODIFY<\/span> phone <span class=\"hljs-built_in\">VARCHAR2<\/span>( <span class=\"hljs-number\">12<\/span> );<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-19\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Oracle Database issued the following error:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-20\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">SQL Error: ORA-01441: cannot decrease column length because some  value is too big<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-20\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>To fix this, first, we should remove the international code from the phone numbers:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-21\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">UPDATE<\/span>\n    accounts\n<span class=\"hljs-keyword\">SET<\/span>\n    phone = <span class=\"hljs-keyword\">REPLACE<\/span>(\n        phone,\n        <span class=\"hljs-string\">'+1-'<\/span>,\n        <span class=\"hljs-string\">''<\/span>\n    );\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-21\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code><a href=\"https:\/\/www.oracletutorial.com\/oracle-string-functions\/oracle-replace\/\">REPLACE()<\/a><\/code> function replaces a substring with a new substring. In this case, it replaces the &#8216;+1-&#8216; with an empty string.<\/p>\n\n\n\n<p>And then shorten the size of the <code>phone<\/code> column:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-22\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> accounts \n<span class=\"hljs-keyword\">MODIFY<\/span> phone <span class=\"hljs-built_in\">VARCHAR2<\/span>( <span class=\"hljs-number\">12<\/span> );<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-22\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='modifying-virtual-columns'>Modifying virtual columns <a href=\"#modifying-virtual-columns\" class=\"anchor\" id=\"modifying-virtual-columns\" title=\"Anchor for Modifying virtual columns\">#<\/a><\/h3>\n\n\n\n<p>Suppose you want the full name to be in the following format:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-23\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">last_name, first_name<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-23\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>To do this, you can change the expression of the <a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-virtual-column\/\">virtual column<\/a> <code>full_name<\/code> as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-24\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> accounts \n<span class=\"hljs-keyword\">MODIFY<\/span> full_name <span class=\"hljs-built_in\">VARCHAR2<\/span>(<span class=\"hljs-number\">52<\/span>) \n<span class=\"hljs-keyword\">GENERATED<\/span> <span class=\"hljs-keyword\">ALWAYS<\/span> <span class=\"hljs-keyword\">AS<\/span> (last_name || <span class=\"hljs-string\">', '<\/span> || first_name);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-24\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The following statement verifies the modification:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-25\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> * <span class=\"hljs-keyword\">FROM<\/span> accounts;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-25\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"83\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-modify-virtual-column-example.png\" alt=\"Oracle ALTER TABLE MODIFY Column - modify virtual column example\" class=\"wp-image-858\" title=\"Oracle ALTER TABLE MODIFY Column - modify virtual column example\" srcset=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-modify-virtual-column-example.png 678w, https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-modify-virtual-column-example-300x37.png 300w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='modify-the-default-value-of-a-column'>Modify the default value of a column <a href=\"#modify-the-default-value-of-a-column\" class=\"anchor\" id=\"modify-the-default-value-of-a-column\" title=\"Anchor for Modify the default value of a column\">#<\/a><\/h3>\n\n\n\n<p>Let&#8217;s <a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-add-column\/\">add a new column<\/a> named <code>status<\/code> to the <code>accounts<\/code> table with default value 1.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-26\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> accounts\n<span class=\"hljs-keyword\">ADD<\/span> <span class=\"hljs-keyword\">status<\/span> <span class=\"hljs-built_in\">NUMBER<\/span>( <span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">0<\/span> ) <span class=\"hljs-keyword\">DEFAULT<\/span> <span class=\"hljs-number\">1<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span> ;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-26\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"78\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-Add-status-column.png\" alt=\"Oracle ALTER TABLE MODIFY Column - Add status column\" class=\"wp-image-859\" title=\"Oracle ALTER TABLE MODIFY Column - Add status column\" srcset=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-Add-status-column.png 763w, https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-Add-status-column-300x31.png 300w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><\/figure>\n\n\n\n<p>Once you execute the statement, the values in the status column are set to 1 for all existing rows in the <code>accounts<\/code> table.<\/p>\n\n\n\n<p>To change the default value of the status column to 0, you use the following statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-27\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> accounts \n<span class=\"hljs-keyword\">MODIFY<\/span> <span class=\"hljs-keyword\">status<\/span> <span class=\"hljs-keyword\">DEFAULT<\/span> <span class=\"hljs-number\">0<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-27\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>We can add a new row to the <code>accounts<\/code> table to check whether the default value of the <code>status<\/code> column is 0 or 1:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-28\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">INSERT<\/span> <span class=\"hljs-keyword\">INTO<\/span> accounts ( first_name, last_name, email, phone )\n<span class=\"hljs-keyword\">VALUES<\/span> ( <span class=\"hljs-string\">'Julia'<\/span>,\n         <span class=\"hljs-string\">'Madden'<\/span>,\n         <span class=\"hljs-string\">'julia.madden@oracletutorial.com'<\/span>,\n         <span class=\"hljs-string\">'410-555-0200'<\/span> );<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-28\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Query data from the <code>accounts<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-29\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> * <span class=\"hljs-keyword\">FROM<\/span> accounts;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-29\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"761\" height=\"98\" src=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-change-column-default-value.png\" alt=\"Oracle ALTER TABLE MODIFY Column - change column default value\" class=\"wp-image-860\" title=\"Oracle ALTER TABLE MODIFY Column - change column default value\" srcset=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-change-column-default-value.png 761w, https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-change-column-default-value-300x39.png 300w\" sizes=\"auto, (max-width: 761px) 100vw, 761px\" \/><\/figure>\n\n\n\n<p>The value in the <code>status<\/code> column for the account with id 4 is 0.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the Oracle <code>ALTER TABLE MODIFY<\/code> column statement to change the definition of existing columns in a table.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='quiz'>Quiz <a href=\"#quiz\" class=\"anchor\" id=\"quiz\" title=\"Anchor for Quiz\">#<\/a><\/h2>\n\n\n\n<iframe loading=\"lazy\"\n  name=\"quiz\"\n  src=\"\/quiz\/?quiz=alter-table-modify-column\"\n  height=\"700\"\n  width=\"600\"\n  class=\"iframe\"\n><\/iframe>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"854\"\n\t\t\t\tdata-post-url=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/\"\n\t\t\t\tdata-post-title=\"Oracle ALTER TABLE MODIFY Column\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"854\"\n\t\t\t\tdata-post-url=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/\"\n\t\t\t\tdata-post-title=\"Oracle ALTER TABLE MODIFY Column\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows you how to use the Oracle ALTER TABLE MODIFY column statement to change the definition of existing columns in a table.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":386,"menu_order":39,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-854","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Oracle ALTER TABLE MODIFY Column<\/title>\n<meta name=\"description\" content=\"This tutorial shows you how to use the Oracle ALTER TABLE MODIFY column statement to change the definition of existing columns in a table.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Oracle ALTER TABLE MODIFY Column\" \/>\n<meta property=\"og:description\" content=\"This tutorial shows you how to use the Oracle ALTER TABLE MODIFY column statement to change the definition of existing columns in a table.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/\" \/>\n<meta property=\"og:site_name\" content=\"Oracle Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-06T02:41:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-example.png\" \/>\n\t<meta property=\"og:image:width\" content=\"484\" \/>\n\t<meta property=\"og:image:height\" content=\"82\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/oracle-basics\\\/oracle-alter-table-modify-column\\\/\",\"url\":\"https:\\\/\\\/www.oracletutorial.com\\\/oracle-basics\\\/oracle-alter-table-modify-column\\\/\",\"name\":\"Oracle ALTER TABLE MODIFY Column\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/oracle-basics\\\/oracle-alter-table-modify-column\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/oracle-basics\\\/oracle-alter-table-modify-column\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.oracletutorial.com\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/Oracle-ALTER-TABLE-MODIFY-Column-example.png\",\"datePublished\":\"2017-10-03T07:24:19+00:00\",\"dateModified\":\"2025-05-06T02:41:26+00:00\",\"description\":\"This tutorial shows you how to use the Oracle ALTER TABLE MODIFY column statement to change the definition of existing columns in a table.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/oracle-basics\\\/oracle-alter-table-modify-column\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.oracletutorial.com\\\/oracle-basics\\\/oracle-alter-table-modify-column\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/oracle-basics\\\/oracle-alter-table-modify-column\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.oracletutorial.com\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/Oracle-ALTER-TABLE-MODIFY-Column-example.png\",\"contentUrl\":\"https:\\\/\\\/www.oracletutorial.com\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/Oracle-ALTER-TABLE-MODIFY-Column-example.png\",\"width\":484,\"height\":82,\"caption\":\"Oracle ALTER TABLE MODIFY Column - example\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/oracle-basics\\\/oracle-alter-table-modify-column\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.oracletutorial.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Oracle Basics\",\"item\":\"https:\\\/\\\/www.oracletutorial.com\\\/oracle-basics\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Oracle ALTER TABLE MODIFY Column\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.oracletutorial.com\\\/#website\",\"url\":\"https:\\\/\\\/www.oracletutorial.com\\\/\",\"name\":\"Oracle Tutorial\",\"description\":\"Oracle Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.oracletutorial.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Oracle ALTER TABLE MODIFY Column","description":"This tutorial shows you how to use the Oracle ALTER TABLE MODIFY column statement to change the definition of existing columns in a table.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/","og_locale":"en_US","og_type":"article","og_title":"Oracle ALTER TABLE MODIFY Column","og_description":"This tutorial shows you how to use the Oracle ALTER TABLE MODIFY column statement to change the definition of existing columns in a table.","og_url":"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/","og_site_name":"Oracle Tutorial","article_modified_time":"2025-05-06T02:41:26+00:00","og_image":[{"width":484,"height":82,"url":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-example.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/","url":"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/","name":"Oracle ALTER TABLE MODIFY Column","isPartOf":{"@id":"https:\/\/www.oracletutorial.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/#primaryimage"},"image":{"@id":"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/#primaryimage"},"thumbnailUrl":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-example.png","datePublished":"2017-10-03T07:24:19+00:00","dateModified":"2025-05-06T02:41:26+00:00","description":"This tutorial shows you how to use the Oracle ALTER TABLE MODIFY column statement to change the definition of existing columns in a table.","breadcrumb":{"@id":"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/#primaryimage","url":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-example.png","contentUrl":"https:\/\/www.oracletutorial.com\/wp-content\/uploads\/2017\/10\/Oracle-ALTER-TABLE-MODIFY-Column-example.png","width":484,"height":82,"caption":"Oracle ALTER TABLE MODIFY Column - example"},{"@type":"BreadcrumbList","@id":"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-alter-table-modify-column\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.oracletutorial.com\/"},{"@type":"ListItem","position":2,"name":"Oracle Basics","item":"https:\/\/www.oracletutorial.com\/oracle-basics\/"},{"@type":"ListItem","position":3,"name":"Oracle ALTER TABLE MODIFY Column"}]},{"@type":"WebSite","@id":"https:\/\/www.oracletutorial.com\/#website","url":"https:\/\/www.oracletutorial.com\/","name":"Oracle Tutorial","description":"Oracle Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.oracletutorial.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages\/854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/comments?post=854"}],"version-history":[{"count":0,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages\/854\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/pages\/386"}],"wp:attachment":[{"href":"https:\/\/www.oracletutorial.com\/wp-json\/wp\/v2\/media?parent=854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}