Skip to content

Changes: The statement did not return a result set. #292

Open

Description

@bhargavkumar-65

I am trying to update a table in my ms sqlserver db, below is my code.

	Source source = new Source("//SourceConnectionString");
	Changes change = new Changes();
	change.setRequest(new Request(source, "UPDATE CM_GENERATOR SET GEN_VALUE='3'"));

when i execute above code, i am getting below error

org.assertj.db.exception.AssertJDBException: com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.

at org.assertj.db.type.AbstractDbData.load(AbstractDbData.java:136)
at org.assertj.db.type.AbstractDbData.getPksNameList(AbstractDbData.java:255)
at org.assertj.db.type.Changes.getDuplicatedRequest(Changes.java:244)
at org.assertj.db.type.Changes.setRequest(Changes.java:159)


    <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-db</artifactId>
        <version>2.0.2</version>
    </dependency>

Activity

  1. VanRoy commented on Nov 14, 2024

    @VanRoy
    Member

    Hi @bhargavkumar-65 , Indeed the request should be a SELECT and return result to be compared between setStartPointNow() and setEndPointNow().

    A full examples :

    Source source = new Source("//SourceConnectionString");
    Changes change = new Changes();
    change.setRequest(new Request(source, "SELECT * FROM xxx;"));
    change.setStartPointNow();
    update("update test set c1 = 1;");
    changes.setEndPointNow();
    assertThat(changes).hasNumberOfChanges(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions