Comments - Too many key parts specified; max 16 parts allowed

1 month, 2 weeks ago Ian Gilfillan

The error is fairly self-explanatory - there are too many key parts specified. So it would help if you gave some more detail. Share line 129, how was the sql generated before, from what version to what version, etc.

 
1 month, 2 weeks ago John Kimathi

The snipette is part of dump file that I generated while converting MsSQL to MySQL using MySQL Workbench.

Line 129 is highlighted in bold below.

-- ----------------------------------------------------------------------------
-- Table KIMATHI.OpportunityBase
-- ----------------------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `KIMATHI`.`OpportunityBase` (
  `OpportunityId` VARCHAR(64) NOT NULL,
  `PriceLevelId` VARCHAR(64) NULL,
  `OpportunityRatingCode` INT NULL,
  `PriorityCode` INT NULL,
  `Name` VARCHAR(300) CHARACTER SET 'utf8mb4' NULL,
  `StepId` VARCHAR(64) NULL,
  `Description` LONGTEXT CHARACTER SET 'utf8mb4' NULL,
  `EstimatedValue` DECIMAL(19,4) NULL,
  `StepName` VARCHAR(200) CHARACTER SET 'utf8mb4' NULL,
  `SalesStageCode` INT NULL,
  `ParticipatesInWorkflow` TINYINT(1) NULL DEFAULT 0,
  `PricingErrorCode` INT NULL,
  `EstimatedCloseDate` DATETIME(6) NULL,
  `CloseProbability` INT NULL,
  `ActualValue` DECIMAL(19,4) NULL,
  `ActualCloseDate` DATETIME(6) NULL,
  `OwningBusinessUnit` VARCHAR(64) NULL,
  `OriginatingLeadId` VARCHAR(64) NULL,
  `CreatedOn` DATETIME(6) NULL,
  `IsPrivate` TINYINT(1) NULL DEFAULT 0,
  `CreatedBy` VARCHAR(64) NULL,
  `ModifiedOn` DATETIME(6) NULL,
  `ModifiedBy` VARCHAR(64) NULL,
  `VersionNumber` VARBINARY(8) NULL,
  `StateCode` INT NOT NULL,
  `StatusCode` INT NULL,
  `IsRevenueSystemCalculated` TINYINT(1) NULL DEFAULT 0,
  `CampaignId` VARCHAR(64) NULL,
  `TransactionCurrencyId` VARCHAR(64) NULL,
  `ExchangeRate` DECIMAL(23,10) NULL,
  `ImportSequenceNumber` INT NULL,
  `UTCConversionTimeZoneCode` INT NULL,
  `TimeZoneRuleVersionNumber` INT NULL,
  `OverriddenCreatedOn` DATETIME(6) NULL,
  `ActualValue_Base` DECIMAL(19,4) NULL,
  `EstimatedValue_Base` DECIMAL(19,4) NULL,
  `TotalDiscountAmount` DECIMAL(19,4) NULL,
  `ModifiedOnBehalfBy` VARCHAR(64) NULL,
  `TotalAmount` DECIMAL(19,4) NULL,
  `CreatedOnBehalfBy` VARCHAR(64) NULL,
  `TotalAmountLessFreight` DECIMAL(19,4) NULL,
  `TotalLineItemDiscountAmount` DECIMAL(19,4) NULL,
  `CustomerId` VARCHAR(64) NULL,
  `DiscountAmount` DECIMAL(19,4) NULL,
  `OwnerId` VARCHAR(64) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `FreightAmount` DECIMAL(19,4) NULL,
  `TotalTax` DECIMAL(19,4) NULL,
  `DiscountPercentage` DECIMAL(23,10) NULL,
  `TotalLineItemAmount` DECIMAL(19,4) NULL,
  `CustomerIdName` VARCHAR(4000) CHARACTER SET 'utf8mb4' NULL,
  `CustomerIdType` INT NULL,
  `OwnerIdType` INT NOT NULL DEFAULT 8,
  `TotalDiscountAmount_Base` DECIMAL(19,4) NULL,
  `FreightAmount_Base` DECIMAL(19,4) NULL,
  `TotalLineItemAmount_Base` DECIMAL(19,4) NULL,
  `TotalTax_Base` DECIMAL(19,4) NULL,
  `TotalLineItemDiscountAmount_Base` DECIMAL(19,4) NULL,
  `TotalAmount_Base` DECIMAL(19,4) NULL,
  `DiscountAmount_Base` DECIMAL(19,4) NULL,
  `TotalAmountLessFreight_Base` DECIMAL(19,4) NULL,
  `CustomerIdYomiName` VARCHAR(4000) CHARACTER SET 'utf8mb4' NULL,
  `FileDebrief` TINYINT(1) NULL,
  `BudgetStatus` INT NULL,
  `PresentProposal` TINYINT(1) NULL,
  `SendThankYouNote` TINYINT(1) NULL,
  `EvaluateFit` TINYINT(1) NULL,
  `FinalDecisionDate` DATETIME(6) NULL,
  `ConfirmInterest` TINYINT(1) NULL,
  `CompleteInternalReview` TINYINT(1) NULL,
  `TimeLine` INT NULL,
  `CustomerPainPoints` LONGTEXT CHARACTER SET 'utf8mb4' NULL,
  `ResolveFeedback` TINYINT(1) NULL,
  `PurchaseProcess` INT NULL,
  `CaptureProposalFeedback` TINYINT(1) NULL,
  `IdentifyCustomerContacts` TINYINT(1) NULL,
  `CompleteFinalProposal` TINYINT(1) NULL,
  `QuoteComments` LONGTEXT CHARACTER SET 'utf8mb4' NULL,
  `BudgetAmount` DECIMAL(19,4) NULL,
  `ScheduleFollowup_Qualify` DATETIME(6) NULL,
  `Need` INT NULL,
  `PursuitDecision` TINYINT(1) NULL,
  `ParentAccountId` VARCHAR(64) NULL,
  `ScheduleProposalMeeting` DATETIME(6) NULL,
  `QualificationComments` LONGTEXT CHARACTER SET 'utf8mb4' NULL,
  `SalesStage` INT NULL,
  `ParentContactId` VARCHAR(64) NULL,
  `InitialCommunication` INT NULL,
  `IdentifyPursuitTeam` TINYINT(1) NULL,
  `ScheduleFollowup_Prospect` DATETIME(6) NULL,
  `PurchaseTimeframe` INT NULL,
  `IdentifyCompetitors` TINYINT(1) NULL,
  `DecisionMaker` TINYINT(1) NULL,
  `CurrentSituation` LONGTEXT CHARACTER SET 'utf8mb4' NULL,
  `CustomerNeed` LONGTEXT CHARACTER SET 'utf8mb4' NULL,
  `ProposedSolution` LONGTEXT CHARACTER SET 'utf8mb4' NULL,
  `PresentFinalProposal` TINYINT(1) NULL,
  `DevelopProposal` TINYINT(1) NULL,
  `BudgetAmount_Base` DECIMAL(19,4) NULL,
  `ProcessId` VARCHAR(64) NULL,
  `StageId` VARCHAR(64) NULL,
  `new_fkContactId` VARCHAR(64) NULL,
  `new_fkSalesStageId` VARCHAR(64) NULL,
  `TraversedPath` VARCHAR(1250) CHARACTER SET 'utf8mb4' NULL,
  PRIMARY KEY (`OpportunityId`),
  INDEX `fndx_for_cascaderelationship_business_unit_opportunities` (`OwningBusinessUnit` ASC) VISIBLE,
  INDEX `fndx_for_cascaderelationship_campaign_opportunities` (`CampaignId` ASC) VISIBLE,
  INDEX `fndx_for_cascaderelationship_opportunity_originating_lead` (`OriginatingLeadId` ASC) VISIBLE,
  UNIQUE INDEX `fndx_Sync_VersionNumber` (`VersionNumber`(8) ASC) VISIBLE,
  INDEX `ndx_for_cascaderelationship_opportunity_customer_accounts` (`CustomerId` ASC, `CustomerIdType` ASC) VISIBLE,
  INDEX `ndx_CreatedOn` (`CreatedOn` ASC, `ActualCloseDate` ASC, `ActualValue_Base` ASC, `EstimatedValue_Base` ASC, `OwnerId` ASC) VISIBLE,
  INDEX `ndx_FiscalYear` (`ActualCloseDate` ASC, `StateCode` ASC, `ActualValue_Base` ASC, `EstimatedValue_Base` ASC, `OwnerId` ASC) VISIBLE,
  INDEX `ndx_OpenOpportunities` (`StateCode` ASC, `Name`(255) ASC, `OpportunityId` ASC, `OpportunityRatingCode` ASC, `EstimatedValue` ASC, `EstimatedCloseDate` ASC, `CloseProbability` ASC, `TransactionCurrencyId` ASC, `CustomerId` ASC, `CustomerIdName`(255) ASC, `CustomerIdType` ASC, `CustomerIdYomiName`(255) ASC, `ActualValue_Base` ASC, `EstimatedValue_Base` ASC, `CampaignId` ASC, `OwnerId` ASC, `StepName` ASC) VISIBLE,
  INDEX `ndx_Core` (`StateCode` ASC, `StatusCode` ASC) VISIBLE,
  INDEX `fndx_Opportunity_Name` (`Name`(255) ASC) VISIBLE,
  INDEX `ndx_Security` (`OwnerId` ASC, `StateCode` ASC) VISIBLE,
  INDEX `fndx_Opportunity_EstimatedCloseDate` (`EstimatedCloseDate` ASC) VISIBLE,
  INDEX `fndx_for_cascaderelationship_opportunity_parent_account` (`ParentAccountId` ASC) VISIBLE,
  INDEX `fndx_for_cascaderelationship_opportunity_parent_contact` (`ParentContactId` ASC) VISIBLE,
  CONSTRAINT `owner_opportunitys`
    FOREIGN KEY (`OwnerId`)
    REFERENCES `KIMATHI`.`OwnerBase` (`OwnerId`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `transactioncurrency_opportunity`
    FOREIGN KEY (`TransactionCurrencyId`)
    REFERENCES `KIMATHI`.`TransactionCurrencyBase` (`TransactionCurrencyId`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `opportunity_originating_lead`
    FOREIGN KEY (`OriginatingLeadId`)
    REFERENCES `KIMATHI`.`LeadBase` (`LeadId`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `opportunity_parent_contact`
    FOREIGN KEY (`ParentContactId`)
    REFERENCES `KIMATHI`.`ContactBase` (`ContactId`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `new_salesstage_opportunity`
    FOREIGN KEY (`new_fkSalesStageId`)
    REFERENCES `KIMATHI`.`new_salesstageBase` (`new_salesstageId`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `price_level_opportunties`
    FOREIGN KEY (`PriceLevelId`)
    REFERENCES `KIMATHI`.`PriceLevelBase` (`PriceLevelId`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `new_contact_opportunity`
    FOREIGN KEY (`new_fkContactId`)
    REFERENCES `KIMATHI`.`ContactBase` (`ContactId`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `opportunity_parent_account`
    FOREIGN KEY (`ParentAccountId`)
    REFERENCES `KIMATHI`.`AccountBase` (`AccountId`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `business_unit_opportunities`
    FOREIGN KEY (`OwningBusinessUnit`)
    REFERENCES `KIMATHI`.`BusinessUnitBase` (`BusinessUnitId`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `campaign_opportunities`
    FOREIGN KEY (`CampaignId`)
    REFERENCES `KIMATHI`.`CampaignBase` (`CampaignId`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION);
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.