Support DEFAULT context value in insert, update, merge, etc
-----------------------------------------------------------

                 Key: CORE-5449
                 URL: http://tracker.firebirdsql.org/browse/CORE-5449
             Project: Firebird Core
          Issue Type: New Feature
          Components: Engine
            Reporter: Mark Rotteveel


Please add support for the SQL standard DEFAULT context value, which means use 
the default value of the column assigned (insert, update, merge, etc), or NULL 
if there is no default. This is defined in (SQL:2011): 6.5 <contextually typed 
value specification>, with explicit instructions for insert, update, merge, 
etc. This is already supported by for example PostgreSQL.

This feature should allow for example:

insert into sometable (id, column1) values (default, 'name')

If id is an identity column this will cause the identity value to be generated.

Note that this should also be supported when including other generated/computed 
columns in the insert (or update, merge, etc) statement:

insert into sometable (column1, column2, somecomputedcolumn) values ('value', 
'othervalue', default)

Other examples:

update sometable set column1 = 'a', column2 = default

(similar for merge)

The currently supported "insert into sometable default values" is actually a 
special case where all columns have default (see 14.11 <insert statement>: "An 
<insert columns and source> that specifies DEFAULT VALUES is implicitly 
replaced by an <insert columns and source> that specifies a <contextually typed 
table value constructor> of the form VALUES (DEFAULT, DEFAULT, ..., DEFAULT) 
where the number of instances of "DEFAULT" equal to the number of columns of 
T.")

This ticket should replace CORE-1311 which requests this behavior when using 
NULL, which is not correct behavior.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to