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

  • Home
  • SEARCH
  • 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 8790183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:35:10+00:00 2026-06-13T22:35:10+00:00

How can we set default value for a number typed column has ’00’?I tried

  • 0

How can we set default value for a number typed column has ’00’?I tried this but it still saved it has ‘0’,I need to do this.

//alter table table_name add column column1 default '00';

Please suggest a way for me.

  • 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-13T22:35:11+00:00Added an answer on June 13, 2026 at 10:35 pm

    It is not possible to store numbers like that – In a format you have described (’00’). You can store numbers as numbers (as values of numeric data type of course) and use to_char function or to_char function combined with lpad function to represent numbers in a format you like. Here is an example:

    SQL> create table TB_SingleNumberColumn(
      2    col number
      3  )
      4  /
    
    Table created
    SQL> insert into TB_SingleNumberColumn(Col) values(1);
    
    1 row inserted
    
    SQL> insert into TB_SingleNumberColumn(Col) values(5);
    
    1 row inserted
    
    SQL> insert into TB_SingleNumberColumn(Col) values(11);
    
    1 row inserted
    
    SQL> insert into TB_SingleNumberColumn(Col) values(111);
    
    1 row inserted
    
    SQL> commit;
    
    Commit complete
    
    -- The values as they are
    SQL> select * from TB_SingleNumberColumn;
    
           COL
    ----------
             1
             5
            11
           111
    
    -- Values padded with zeros.
    SQL> select to_char(col, '000') res 
      2   from TB_SingleNumberColumn;
    
    RES
    ----
     001
     005
     011
     111 
    
    SQL> select lpad(to_char(col), 3, '0')
      2    from TB_SingleNumberColumn
      3  ;
    
    LPAD(TO_CHAR(COL),3,'0')
    ------------------------
    001
    005
    011
    111
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As title, how can I set a table's column to have the default value
how can i set default value in sonata admin bundle the data option is
How can I set a default value such as don't have any information instead
How can you set a default input value in a .net console app? Here
How can i set default home page in asp web.config file. i have already
I'm searching for a strategy with which I can set the default sortorder of
for String and Object type, I can set the default parameter to null to
How can we set element to some default date in mysql ? In oracle
How can i Set RadioButtonFor() as Checked By Default <%=Html.RadioButtonFor(m => m.Gender,Male)%> there is
I have read a number of posts about this but none with any solid

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.