![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 2 of 2 total |
![]() |
Sat, Mar 3 2007 8:13 AM | Permanent Link |
"Ole Willy Tuv" | create table test
( col1 integer generated by default as identity, col2 char varying(20) collate enu not null, constraint pk_test primary key (col1) ) insert into test (col2) values ('col2 rowid '||cast(col1 as char varying(5))) Error: ElevateDB Error #1004 The column col2 cannot be NULL The problem seems to be that the expression cast(col1 as char varying(5)) returns null. I'd expect the column reference "col1" in the VALUES clause to represent the actual value for col1 in the row being inserted, hence the computed insert value for col2 should be: col2 rowid 1 Ole Willy Tuv |
Mon, Mar 5 2007 8:54 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Ole,
<< The problem seems to be that the expression cast(col1 as char varying(5)) returns null. I'd expect the column reference "col1" in the VALUES clause to represent the actual value for col1 in the row being inserted, hence the computed insert value for col2 should be: >> Column expressions of this nature are evaluated prior to the identity column assignment, which happens during the actual insert operation due to locking requirements, hence the identity column at the time of the assignment is NULL. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Wednesday, July 2, 2025 at 06:46 PM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |