Hi,

I'm afraid you need to use
MERGE INTO VERSION_NUM (LOCK, VERSION, LOADED_FLAG) VALUES('X', 123,TRUE);

> I am using version: 1.3.173

Actually, according to the error code (90081-166) you are using version
1.3.166.

Regards,
Thomas



On Tuesday, July 29, 2014, Dani Fernandez <boad...@gmail.com> wrote:

> Hi all,
>
> I have this table definition:
>
> CREATE TABLE IF NOT EXISTS VERSION_NUM (
>                         LOCK char(1) DEFAULT 'X'  not null PRIMARY KEY,
>                         VERSION BIGINT,
>                         LOADED_FLAG boolean,
>                         constraint CK_T1_Locked CHECK (LOCK='X'))
>
> I am trying to insert a record like:
>
> MERGE INTO VERSION_NUM (VERSION, LOADED_FLAG) VALUES(123,TRUE);
>
> But this is not possible as I am getting this exception:
>
> Column "LOCK" contains null values; SQL statement:
> MERGE INTO VERSION_NUM (VERSION, LOADED_FLAG) VALUES(123,TRUE) [90081-166]
> 90081/90081 (Help)
>
> The idea is to have a table with only one row, so the 'MERGE' changes or
> inserts (if it is the first record) only the single record.
>
> Am I doing something wrong? In my opinion the merge should work even there
> is no value in the table because of the 'default 'x' definition for the
> column lock.
>
> Any ideas?
>
> I am using version: 1.3.173
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to h2-database+unsubscr...@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','h2-database%2bunsubscr...@googlegroups.com');>
> .
> To post to this group, send email to h2-database@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','h2-database@googlegroups.com');>.
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to