Error: "Error in Run SQL Script.sspm_ins_aux.sql" And "java.sql.SQLException: 3 > 0" If Using Verbose Output for the Migrate.bat Utility, Table Rows Do Not Match in the Source and the Target Database Causing Constraint Violations (Doc ID 2186348.1)

Last updated on JANUARY 13, 2017

Applies to:

Primavera P6 Professional Project Management - Version 15.2.0.0 and later
Primavera P6 Enterprise Project Portfolio Management - Version 15.2.0.0 and later
Information in this document applies to any platform.

Symptoms

When attempting to migrate data from Oracle/SQL to a SQL Server target database, the following error occurs:


ERROR
-----------------------
Error in Verbose output (see cause section below for detail to configure verbose mode):
java.sql.SQLException: 3 > 0
  at com.primavera.database.common.container.SQLRowContainer.updateContainer(SQLRowContainer.java:208)
  at com.primavera.database.common.container.SQLRowContainer.doNext(SQLRowContainer.java:95)
  at com.primavera.database.common.container.SQLRowContainer.Next(SQLRowContainer.java:127)
  at com.primavera.database.tools.Dataloader.DBRowGenerator.run(DBRowGenerator.java:111)
  at com.primavera.database.tools.Dataloader.Dataloader.run(Dataloader.java:306)
  at com.primavera.database.tools.dbmt.workflow.DatapumpJob.doJob(DatapumpJob.java:74)
  at com.primavera.database.tools.dbmt.AbstractJob.execute(AbstractJob.java:64)
  at com.primavera.database.tools.dbmt.actions.BaseWizardRunner.runJob(BaseWizardRunner.java:205)
  at com.primavera.database.tools.dbmt.actions.BaseWizardRunner.commit(BaseWizardRunner.java:214)
  at com.primavera.database.tools.dbmt.actions.JobTreeTypeDef$JobRunner.run(JobTreeTypeDef.java:253)
  at java.lang.Thread.run(Unknown Source)

Error in the migrate wizard (migrate.bat) when adding constraints:
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "$CONSTRAINT_NAME". The conflict occurred in database "$DBNAME", table "dbo.$TABLENAME", column '$COLUMNNAME'

STEPS TO DUPLICATE
-----------------------
The issue can be reproduced at will with the following steps:

  1. Run validate on source database
  2. Validation report is clean
  3. Run migrate.bat
  4. Error is displayed in wizard
  5. Check orphaned records in source database on table in question
  6. No orphaned records in source database
  7. Modify migrate.bat to generate verbose output
  8. Run modified migrate.bat
  9. Error is displayed in verbose output

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms