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 6475489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:42:38+00:00 2026-05-25T06:42:38+00:00

Well, I’m a bit puzzeled here, yet it seems to be a really dumb

  • 0

Well, I’m a bit puzzeled here, yet it seems to be a really dumb question.

I’m trying to create a table that has a double column that is null by default. What i get is a table with a double column that is 0 by default, and I have no idea why.

The relevant part of the code:

CREATE_TABLE_STATEMENT = "create table " + TABLE_NAME + " 
(id int not null generated always as identity constraint pk primary key, 
 parentid int default null, title varchar(50), minimum double default null,
 maximum double default null, timeUnit double default null, 
 comment varchar(150) default null)";

And the corresponding “insert”:

"insert into " + TABLE_NAME + " " + "(parentid, title) values (1, 'first')"
  • 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-05-25T06:42:39+00:00Added an answer on May 25, 2026 at 6:42 am

    Seems to work fine on my copy of Derby (see below).

    What makes you think the default of null isn’t working properly?

    ij> create table xxx (id int not null generated always as identity constraint pk primary key, 
     parentid int default null, title varchar(50), minimum double default null,
     maximum double default null, timeUnit double default null, 
     comment varchar(150) default null) ;
    0 rows inserted/updated/deleted
    ij> describe xxx;
    COLUMN_NAME         |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
    ------------------------------------------------------------------------------
    ID                  |INTEGER  |0   |10  |10    |AUTOINCRE&|NULL      |NO      
    PARENTID            |INTEGER  |0   |10  |10    |NULL      |NULL      |YES     
    TITLE               |VARCHAR  |NULL|NULL|50    |NULL      |100       |YES     
    MINIMUM             |DOUBLE   |NULL|2   |52    |NULL      |NULL      |YES     
    MAXIMUM             |DOUBLE   |NULL|2   |52    |NULL      |NULL      |YES     
    TIMEUNIT            |DOUBLE   |NULL|2   |52    |NULL      |NULL      |YES     
    COMMENT             |VARCHAR  |NULL|NULL|150   |NULL      |300       |YES     
    
    7 rows selected
    ij> insert into xxx (parentid, title) values (1, 'first');
    1 row inserted/updated/deleted
    ij> select * from xxx;
    ID         |PARENTID   |TITLE                                             |MINIMUM               |MAXIMUM               |TIMEUNIT              |COMMENT                                                                                                                         
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    1          |1          |first                                             |NULL                  |NULL                  |NULL                  |NULL                                                                                                                            
    
    1 row selected
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well, I have to revive a question that was answered here before. I've made
Well, this is my first post here and really enjoying the site. I have
Well, i have the following need: create 3 dropdownlist with dependencies. My table in
Well im here because i have a problem. i have code that was created
well I'm trying to create a great playlist of music, only using a sigle
Well, I have this bit of code that is slowing down the program hugely
Well the subject is the question basically. Are there any version control systems out
Well... simple question, right? But with no so simple answers. In firefox i use
Well, it seems simple enough, but I can't find a way to add a
Well this is incredibly frustrating. After being nagged by Rails that I need to

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.