EnvironmentTS 6.5 SP1
OD / DD 6.0.2
W2K3 EE
Standalone deployment of DCR content into UDS schema
ProblemThe DD Admin manual says:Do not use the select and update elements inside a database element if the database element contains a dbschema element. On the other hand, if a database element does not contain a dbschema element, database must contain select and update elements.
However, I have a situation in which one of the non-primary keys is likely to change each time a deployment is made, and right now DD seems to be trying to insert a record after it already exists because it does a SELECT COUNT(*) WHERE ... it then specifies every column of data that is coming from the DCR for that table - as opposed to just specifying the primary keys for that table. (Actually my situation is worse right now, because I'm actually sending *identical* data for all columns and it is *still* trying to do an INSERT and failing for "Attempt to enter duplicate key row ...")
As a general question: How does one limit DD's count query to specifying just the primary keys when you do have a dbschema element in the config file?
As another general question: What would be a likely cause for DD to do an INSERT after a SELECT COUNT(*) if the data is already there? (I don't see any result of the SELECT COUNT(*) in the log file - just that, followed by an INSERT of the same data.)
Additional QuestionAs a side-question, is there a way to refer to the dbschema section of the config file as an external file reference rather than in-lining the entire dbschema section in the config file?
I see something like <eaData schemaMapFile="..."/> in the document but (a) this seems to refer to EA data or EA-and-XML data rather than [just] XML content, and (b) this seems to only exist within a dbLoader element which we aren't using for other reasons.
It just seems that it would be a nicer way to maintain the configuration file for multiple DB deployments if it weren't all monolithic...
Log SnippetDAS: DoesRowExistELECT COUNT(*) FROM MT WHERE F_00 = ? AND F_01 = ? AND F_02 = ? AND F_03 = ? AND F_04 = ? AND F_05 = ? AND F_06 = ? AND F_07 = ? AND F_08 = ? AND F_09 = ? AND F_10 = ? AND F_11 = ? AND F_12 is null AND F_13 = ? AND F_14 = ? AND F_15 = ? AND F_16 is null AND F_17 = ? AND F_18 is null AND F_19 is null AND F_20 = ? AND F_21 = ? AND F_22 = ?
DAS: Column: F_00, field: dcttype/0/A/0/F_00, Index: 1,Converting '123456' to NUMBER
DAS: Column: F_01, field: dcttype/0/A/0/F_01, Index: 2,Converting '4144878' to VARCHAR
DAS: Column: F_02, field: dcttype/0/A/0/F_02, Index: 3,Converting 'AAA' to VARCHAR
DAS: Column: F_03, field: dcttype/0/A/0/F_03, Index: 4,Converting 'BBB' to VARCHAR
DAS: Column: F_04, field: dcttype/0/A/0/F_04, Index: 5,Converting 'CCC' to VARCHAR
DAS: Column: F_05, field: dcttype/0/A/0/F_05, Index: 6,Converting 'D' to CHAR
DAS: Column: F_06, field: dcttype/0/A/0/F_06, Index: 7,Converting 'E' to CHAR
DAS: Column: F_07, field: dcttype/0/A/0/F_07, Index: 8,Converting 'FFF' to VARCHAR
DAS: Column: F_08, field: dcttype/0/A/0/F_08, Index: 9,Converting 'GGG' to VARCHAR
DAS: Column: F_09, field: dcttype/0/A/0/F_09, Index: 10,Converting '6' to INTEGER
DAS: Column: F_10, field: dcttype/0/A/0/B/0/F_10, Index: 11,Converting 'HHH' to CHAR
DAS: Column: F_11, field: dcttype/0/A/0/F_11, Index: 12,Converting 'III' to CHAR
DAS: Column: F_13, field: dcttype/0/A/0/F_13, Index: 13,Converting 'JJJ' to VARCHAR
DAS: Column: F_14, field: dcttype/0/A/0/F_14, Index: 14,Converting 'KKK' to VARCHAR
DAS: Column: F_15, field: dcttype/0/A/0/F_15, Index: 15,Converting '-1' to INTEGER
DAS: Column: F_17, field: dcttype/0/A/0/F_17, Index: 16,Converting 'LLL' to VARCHAR
DAS: Column: F_20, literal: 2005-09-08 3:17, Index: 17,Converting '2005-09-08 3:17' to TIMESTAMP
DAS: Column: F_21, literal: MMM, Index: 18,Converting 'MMM' to VARCHAR
DAS: Column: F_22, field: dcttype/0/A/0/F_22, Index: 19,Converting 'Y' to CHAR
DAS: INSERT INTO MT(F_00,F_01,F_02,F_03,F_04,F_05,F_06,F_07,F_08,F_09,F_10,F_11,F_12,F_13,F_25,F_14,F_15,F_16,F_17,F_18,F_19,F_20,F_21,F_22) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
DAS: Column: F_00, field: dcttype/0/A/0/F_00, Index: 1,Converting '123456' to NUMBER
DAS: Column: F_01, field: dcttype/0/A/0/F_01, Index: 2,Converting '4144878' to VARCHAR
DAS: Column: F_02, field: dcttype/0/A/0/F_02, Index: 3,Converting 'AAA' to VARCHAR
DAS: Column: F_03, field: dcttype/0/A/0/F_03, Index: 4,Converting 'BBB' to VARCHAR
DAS: Column: F_04, field: dcttype/0/A/0/F_04, Index: 5,Converting 'CCC' to VARCHAR
DAS: Column: F_05, field: dcttype/0/A/0/F_05, Index: 6,Converting 'D' to CHAR
DAS: Column: F_06, field: dcttype/0/A/0/F_06, Index: 7,Converting 'E' to CHAR
DAS: Column: F_07, field: dcttype/0/A/0/F_07, Index: 8,Converting 'FFF' to VARCHAR
DAS: Column: F_08, field: dcttype/0/A/0/F_08, Index: 9,Converting 'GGG' to VARCHAR
DAS: Column: F_09, field: dcttype/0/A/0/F_09, Index: 10,Converting '6' to INTEGER
DAS: Column: F_10, field: dcttype/0/A/0/B/0/F_10, Index: 11,Converting 'HHH' to CHAR
DAS: Column: F_11, field: dcttype/0/A/0/F_11, Index: 12,Converting 'III' to CHAR
DAS: Column: F_12, field: dcttype/0/A/0/F_12, Index: 13,Converting '' to NUMBER
DAS: Column: F_13, field: dcttype/0/A/0/F_13, Index: 14,Converting 'JJJ' to VARCHAR
DAS: Column: F_25, field: dcttype/0/A/0/F_25, Index: 15,Converting 'NNN' to STRING
DAS: Column: F_14, field: dcttype/0/A/0/F_14, Index: 16,Converting 'KKK' to VARCHAR
DAS: Column: F_15, field: dcttype/0/A/0/F_15, Index: 17,Converting '-1' to INTEGER
DAS: Column: F_16, field: dcttype/0/A/0/F_16, Index: 18,Converting '' to VARCHAR
DAS: Column: F_17, field: dcttype/0/A/0/F_17, Index: 19,Converting 'LLL' to VARCHAR
DAS: Column: F_18, field: dcttype/0/A/0/B/0/F_18, Index: 20,Converting '' to TIMESTAMP
DAS: Column: F_19, field: dcttype/0/A/0/B/0/F_19, Index: 21,Converting '' to TIMESTAMP
DAS: Column: F_20, literal: 2005-09-08 3:17, Index: 22,Converting '2005-09-08 3:17' to TIMESTAMP
DAS: Column: F_21, literal: MMM, Index: 23,Converting 'MMM' to VARCHAR
DAS: Column: F_22, field: dcttype/0/A/0/F_22, Index: 24,Converting 'Y' to CHAR
DAS:
DAS: *******************************************************
DAS: SQLException occured in TDbSchemaGroupCfg
DAS: Exception Message: Attempt to insert duplicate key row in object 'MT' with unique index 'PK_MT'
DAS: Vendor Error Code: 2601
DAS: SQL state: 23000
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com