Oracle - table

oracle Sweden
  • 13 years ago

    Best programmer,

    I have a Oracle database with a table. This table have a column (char, size 16). I have many rows in this table and my question is if I with no problem can change size to 14. All data is maximum 14 so I don't see any problem. I don't want to loose data or make it all crappy! ;-)

    What do you think?

  • 13 years ago

    Hi,

    You can create a temp table and make the changes to the temp table and see is the changes affect the data.

    Example:

    CREATE TABLE temp_table AS SELECT * FROM original_table:

    INSERT INTO temp_table SELECT * FROM original_table;

    ALTER TABLE original_table MODIFY (column_name CHAR(14));

  • 13 years ago

    This will probably be the solution since I can't find any other information.

    Thanks for your reply!

     

    Regards,

    Magnus Flisberg

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Some people, when confronted with a problem, think "I know, I’ll use regular expressions." Now they have two problems.” - Jamie Zawinski