Hi there,
probably this explains the problem
CREATE MULTISET TABLE test.geo_dim2 ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO
(
GEO_SK BIGINT GENERATED ALWAYS AS IDENTITY
(START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 2147483647
NO CYCLE),
COUNTRY_ISO_A2 CHAR(2) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL,
CITY_TXT VARCHAR(100) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL,
ZIP_CODE VARCHAR(30) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL)
UNIQUE PRIMARY INDEX ( GEO_SK )
UNIQUE INDEX ( COUNTRY_ISO_A2 ,CITY_TXT ,ZIP_CODE );
insert into test.geo_dim2 (country_iso_a2, city_txt, zip_code) values ('GR','ΚΩΣ' ,'85300');
OK
insert into test.geo_dim2 (country_iso_a2, city_txt, zip_code) values ('GR','Κως' ,'85300');
Error: [Teradata Database] [TeraJDBC 14.00.00.30] [Error 2803] [SQLState 23000] Secondary index uniqueness violation in EP_DEV1.geo_dim2
insert into test.geo_dim2 (country_iso_a2, city_txt, zip_code) values ('BE','ΚORTRIJK' ,'8500');
OK
insert into test.geo_dim2 (country_iso_a2, city_txt, zip_code) values ('BE','Κortrijk' ,'8500');
Error: [Teradata Database] [TeraJDBC 14.00.00.30] [Error 2803] [SQLState 23000] Secondary index uniqueness violation in EP_DEV1.geo_dim2
select geo_sk, country_iso_a2, city_txt, zip_code from test.geo_dim2 GEO where GEO.COUNTRY_ISO_A2='GR' and GEO.ZIP_CODE='85300' AND GEO.CITY_TXT='ΚΩΣ'
returns 1 row
select geo_sk, country_iso_a2, city_txt, zip_code from test.geo_dim2 GEO where GEO.COUNTRY_ISO_A2='GR' and GEO.ZIP_CODE='85300' AND GEO.CITY_TXT='Κως'
returns 0 row <<<<===================
the process discussed earlier is doing an
insert into target
select from staging
where staging column part of the key not in (select column part of the key from target table)
select geo_sk, country_iso_a2, city_txt, zip_code from test.geo_dim2 GEO where GEO.COUNTRY_ISO_A2='BE' and GEO.ZIP_CODE='8500' AND GEO.CITY_TXT='ΚORTRIJK'
returns 1 row
select geo_sk, country_iso_a2, city_txt, zip_code from test.geo_dim2 GEO where GEO.COUNTRY_ISO_A2='BE' and GEO.ZIP_CODE='8500' AND GEO.CITY_TXT='Κortrijk'
returns 1 row
Nevertheless, I still do not know why tests on another Teradata box returned 1 row in all case
and 'help session' cmd on both machines return the same setup
?
rgds
JL D
Hi there,
probably this explains the problem
CREATE MULTISET TABLE test.geo_dim2 ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO
(
GEO_SK BIGINT GENERATED ALWAYS AS IDENTITY
(START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 2147483647
NO CYCLE),
COUNTRY_ISO_A2 CHAR(2) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL,
CITY_TXT VARCHAR(100) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL,
ZIP_CODE VARCHAR(30) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL)
UNIQUE PRIMARY INDEX ( GEO_SK )
UNIQUE INDEX ( COUNTRY_ISO_A2 ,CITY_TXT ,ZIP_CODE );
insert into test.geo_dim2 (country_iso_a2, city_txt, zip_code) values ('GR','ΚΩΣ' ,'85300');
OK
insert into test.geo_dim2 (country_iso_a2, city_txt, zip_code) values ('GR','Κως' ,'85300');
Error: [Teradata Database] [TeraJDBC 14.00.00.30] [Error 2803] [SQLState 23000] Secondary index uniqueness violation in EP_DEV1.geo_dim2
insert into test.geo_dim2 (country_iso_a2, city_txt, zip_code) values ('BE','ΚORTRIJK' ,'8500');
OK
insert into test.geo_dim2 (country_iso_a2, city_txt, zip_code) values ('BE','Κortrijk' ,'8500');
Error: [Teradata Database] [TeraJDBC 14.00.00.30] [Error 2803] [SQLState 23000] Secondary index uniqueness violation in EP_DEV1.geo_dim2
select geo_sk, country_iso_a2, city_txt, zip_code from test.geo_dim2 GEO where GEO.COUNTRY_ISO_A2='GR' and GEO.ZIP_CODE='85300' AND GEO.CITY_TXT='ΚΩΣ'
returns 1 row
select geo_sk, country_iso_a2, city_txt, zip_code from test.geo_dim2 GEO where GEO.COUNTRY_ISO_A2='GR' and GEO.ZIP_CODE='85300' AND GEO.CITY_TXT='Κως'
returns 0 row <<<<===================
the process discussed earlier is doing an
insert into target
select from staging
where staging column part of the key not in (select column part of the key from target table)
select geo_sk, country_iso_a2, city_txt, zip_code from test.geo_dim2 GEO where GEO.COUNTRY_ISO_A2='BE' and GEO.ZIP_CODE='8500' AND GEO.CITY_TXT='ΚORTRIJK'
returns 1 row
select geo_sk, country_iso_a2, city_txt, zip_code from test.geo_dim2 GEO where GEO.COUNTRY_ISO_A2='BE' and GEO.ZIP_CODE='8500' AND GEO.CITY_TXT='Κortrijk'
returns 1 row
Nevertheless, I still do not know why tests on another Teradata box returned 1 row in all case
and 'help session' cmd on both machines return the same setup
?
rgds
JL D