Validate data in the database
No edit summary
No edit summary
Line 13: Line 13:


You will get an error report and an SQL statement to run to see the problem data;
You will get an error report and an SQL statement to run to see the problem data;
  Single link dupes(38146711), execute select PublisherAgreementPeriodID,Count(PublisherAgreementPeriodID) from AgreementImport where not PublisherAgreementPeriodID is null group by PublisherAgreementPeriodID having Count(PublisherAgreementPeriodID)>1
  Single link dupes(38146711), execute  
select PublisherAgreementPeriodID,Count(PublisherAgreementPeriodID) from AgreementImport where not PublisherAgreementPeriodID is null group by PublisherAgreementPeriodID having Count(PublisherAgreementPeriodID)>1
Copy the SQL command to your SQL server query interface, find the offending object and decide what to do.
 
Most likely you want to delete the row, but you then also have to manually remove all references to that row, otherwise you will create new problems, so using SQL to delete things can be tricky.
 
We suggest that you set the link attribute creating the problem to null (thus removing the duplicate problem) and then use the Ocl debugger to delete the object. In the debugger you use Ocl or OclPS to find the (now disconnected) object and delete it. It will then correctly delete any linked aggregate objects, links from other objects to it and link objects.

Revision as of 22:20, 20 February 2023

The MDrivenServer has a built in feature to check for database consistency.

  • Log in to the MDrivenServer
  • Goto Settings->Admin

There are two buttons there;

  1. Validate Admin DB Data
  2. Validate A0DB Data

Admin DB is the database internal the the MDrivenServer containing model information

A0DB is the internal or external database containing the application data.

Click to run a check on all the tables in the databases.

You will get an error report and an SQL statement to run to see the problem data;

Single link dupes(38146711), execute 
select PublisherAgreementPeriodID,Count(PublisherAgreementPeriodID) from AgreementImport where not PublisherAgreementPeriodID is null group by PublisherAgreementPeriodID having Count(PublisherAgreementPeriodID)>1

Copy the SQL command to your SQL server query interface, find the offending object and decide what to do.

Most likely you want to delete the row, but you then also have to manually remove all references to that row, otherwise you will create new problems, so using SQL to delete things can be tricky.

We suggest that you set the link attribute creating the problem to null (thus removing the duplicate problem) and then use the Ocl debugger to delete the object. In the debugger you use Ocl or OclPS to find the (now disconnected) object and delete it. It will then correctly delete any linked aggregate objects, links from other objects to it and link objects.

This page was edited 84 days ago on 02/10/2024. What links here