Derby's handling of NULL values

前端 未结 4 499
深忆病人
深忆病人 2020-12-19 18:08

I am new to Derby and I noticed that I face similar problems as when using the DB2 RDBMS as far as null values are concerned. The Derby documentation states, th

4条回答
  •  梦毁少年i
    2020-12-19 18:45

    Maybe this solution helps you:

    insert into T_AUTHOR (
        ID, 
        FIRST_NAME, 
        LAST_NAME, 
        DATE_OF_BIRTH, 
        YEAR_OF_BIRTH, 
        ADDRESS
    ) select 
        1000, 
        'Lukas', 
        'Eder', 
        '1981-07-10', 
        (select YEAR_OF_BIRTH from T_AUTHOR where true = false), 
        (select ADDRESS from T_AUTHOR where true = false) 
    from SYSIBM.SYSDUMMY1
    

    This method does not require explicit cast of null, because inner select will return null with required type.

提交回复
热议问题