Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bhargavkumar-65 opened this issue Nov 8, 2024 · 1 comment
Open

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

bhargavkumar-65 opened this issue Nov 8, 2024 · 1 comment
Labels

Comments

@bhargavkumar-65
Copy link

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>
@VanRoy
Copy link
Member

VanRoy commented Nov 14, 2024

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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants