On Jan 18, 2017, at 11:17 AM, Gerhard S (JIRA) <trac...@firebirdsql.org> wrote:
> 
> Insert NULL into identity column with auth generated value
> ----------------------------------------------------------
> 
>                 Key: CORE-5460
>                 URL: http://tracker.firebirdsql.org/browse/CORE-5460
>             Project: Firebird Core
>          Issue Type: Improvement
>    Affects Versions: 3.0.0
>         Environment: Windows 10 64bit, LibreOffice 5.3.0RC1
>            Reporter: Gerhard S
> 
> 
> Could you support inserting rows where the value for the identity column is 
> passed as NULL in order to increment the value automatically?.
> 
> Example:
> create table testtbl (
> id integer generated by default as identity (START WITH 0) NOT NULL primary 
> key,
> name varchar(15)
> );
> 
> insert into testtbl values (NULL, 'name1');
> 
> This only makes sense, if the column is NOT NULL, I guess. Other database 
> systems such as MySQL, HSQLDB, MariaDB allow that.


In what universe does that make sense?  The field is NOT NULL.  You're storing 
NULL in it.  That's an error.  Not an error only if there's no default value, 
not an error only if there's not a sequence.  It's an ERROR.  And quite typical 
of MySQL which tries to make life easier for developers by not giving an error 
if you store 100000 in a 16 bit integer field - it stores 32767. -- you know, 
best try.  Like 0-FEB-2017 matches any day in February.  

Maybe if you assign 'ABC' to integer it should store 123?  Or the RAD50 values?


Death to cute hacks!

Good luck,

Ann
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to