Table definition:
CREATE TABLE "SCHEMA1 "."X2" (
"C1" CHAR(20) NOT NULL ,
"C2" CHAR(10) NOT NULL ,
"C3" CHAR(30) NOT NULL GENERATED ALWAYS AS (C1||
C2) )
IN "USERSPACE1 " ;
-- DDL Statements for primary key on Table "SCHEMA1 "."X2"
ALTER TABLE "SCHEMA1 "."X2"
ADD CONSTRAINT "P1" PRIMARY KEY
("C1",
"C2");
IBM Data Studio Version 1.1.1.
Try edit data , insert row. Will fail.
The editor has problems with the generated columns.
I would say: great.
The generated columns capability breaks the relational model. What is
a column in a base table that is not a column?
It has been discussed already several times in the past, but one usage
of generated columns in DB2 LUW is due to the the lack of (SQL92!)
support of row value constructor in the where clause (and to close the
circle, in the cursor positioning clause as extension to SQL92 but
compatible with it in it's simple format) and corresponding optimizer
support.
Quo usque ...
Bernard Dhooghe
CREATE TABLE "SCHEMA1 "."X2" (
"C1" CHAR(20) NOT NULL ,
"C2" CHAR(10) NOT NULL ,
"C3" CHAR(30) NOT NULL GENERATED ALWAYS AS (C1||
C2) )
IN "USERSPACE1 " ;
-- DDL Statements for primary key on Table "SCHEMA1 "."X2"
ALTER TABLE "SCHEMA1 "."X2"
ADD CONSTRAINT "P1" PRIMARY KEY
("C1",
"C2");
IBM Data Studio Version 1.1.1.
Try edit data , insert row. Will fail.
The editor has problems with the generated columns.
I would say: great.
The generated columns capability breaks the relational model. What is
a column in a base table that is not a column?
It has been discussed already several times in the past, but one usage
of generated columns in DB2 LUW is due to the the lack of (SQL92!)
support of row value constructor in the where clause (and to close the
circle, in the cursor positioning clause as extension to SQL92 but
compatible with it in it's simple format) and corresponding optimizer
support.
Quo usque ...
Bernard Dhooghe
Comment