Skip to content

Issue with multiple sql queries in single change #297

@SagarShivgan

Description

@SagarShivgan

The problem is in trying to run multiple sql queries in single change. If some of them run successfully and one fails, OBEVO throws an exception and fails to mark the change in the deployment table.
In the second attempt to deploy, when I correct the failed sql query and try to deploy the change again, I get an exception resulting from prior successfully run queries.

Steps to reproduce the issue -

  1. Let us understand by below example. Here I have 2 sql queries in single change. 'Person' table has PK constraint on 'id' column. When I deploy this change then first query runs successfully and it will create entry in Person table. But second query failed due to violation of primary key constraint results in exception and the change not get marked in ARTIFACTDEPLOYMENT table.

    //// CHANGE name="add people"
    INSERT INTO Person (id, firstName, lastName, addressCountryName)
    VALUES (1, 'F1', 'L1', 'Japan')
    GO
    INSERT INTO Person (id, firstName, lastName, addressCountryName)
    VALUES (1, 'F2', 'L2', 'United Kingdom')
    GO

  2. Then I have corrected my mistake as shown below and try to deploy this change again. But this time also it throws exception due to violation of primary key constraint.

    //// CHANGE name="add people"
    INSERT INTO Person (id, firstName, lastName, addressCountryName)
    VALUES (1, 'F1', 'L1', 'Japan')
    GO
    INSERT INTO Person (id, firstName, lastName, addressCountryName)
    VALUES (2, 'F2', 'L2', 'United Kingdom')
    GO

I am unable to deploy my valid change.
Please help me.

Obevo version - 8.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions