Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9200273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:43:45+00:00 2026-06-17T22:43:45+00:00

I have researched how to alter table data types and I understand how to

  • 0

I have researched how to alter table data types and I understand how to do it but I cannot get it to work. I am trying to update my table Person within APP using the following command:

ALTER TABLE APP.PERSON ALTER uName varchar;

What I have tried so far:

  • using Modify but realised that, after I received errors, this should indeed be ALTER.
  • changing uName to UNAME.
  • changing it to a data type of varchar2.
  • adding in the size of the data type ‘(20)’ and ‘NOT NULL’ at the end.

Where am I going wrong? I am using Netbeans 7.3 Beta 2 running on Mac OS X, this is all being done within the SQL Commands section of Netbeans, using Java-DB as my database if any of that matters.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:43:46+00:00Added an answer on June 17, 2026 at 10:43 pm

    It has already been answered here on SO. You basically need to create new column with desired datatype and delete the old one. However, if you take a look into Apache Derby doc, there is a SET DATA TYPE command, so try something like

    ALTER TABLE APP.PERSON ALTER UNAME SET DATA TYPE VARCHAR(30)
    

    EDIT

    If code above doesn’t work, then you just have to recreate the column as I suggested before.

    ALTER TABLE APP.PERSON ADD COLUMN UNAME_NEW VARCHAR(30);
    UPDATE APP.PERSON SET UNAME_NEW = UNAME;
    ALTER TABLE APP.PERSON DROP COLUMN UNAME;
    RENAME COLUMN APP.PERSON.UNAME_NEW TO UNAME;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have researched and researched and I am trying to use jquery to refresh
I researched over the internet, but could not find anything... I have a mysql
I have a code. But, due to my limited knowledge. i researched and realised
I have a column called DayShift in a table which is of Yes/No data
We have an application which stores its data in SQL Server. Each table has
I've spent the last two days trying to get some bloody data to export
I have a Table already written in PHP that echos out data called from
I am experimenting with MySQL enum data type. I have a table 15 columns
I have researched this for a few hours and I am kind of frustrated.
I have researched enough on this topic sans any luck :-( My requirement is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.