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

Support for ExecuteNonQuery please #23

Open
NickSandelRWH opened this issue Oct 18, 2023 · 0 comments
Open

Support for ExecuteNonQuery please #23

NickSandelRWH opened this issue Oct 18, 2023 · 0 comments

Comments

@NickSandelRWH
Copy link

Hello, when I try and execute an xmla command in my case to run a backup of a model I get the error:

The result set returned by the server is not a rowset.

The command worked fine but as it uses ExecuteReader as the only option for execute it expects a rowset returned. Is there support for ExecuteNonQuery (https://learn.microsoft.com/en-us/dotnet/api/microsoft.analysisservices.adomdclient.adomdcommand.executenonquery?view=analysisservices-dotnet#microsoft-analysisservices-adomdclient-adomdcommand-executenonquery) somewhere I haven't found yet or can it be added?

I did a brief hack of adding a method to see if it can work and this seems to work:

def executenonquery(self, query:str) -> Cursor:
    """
    Executes a non query against the data source, output is number of rows affected

    :params [query]: The query to be executed
    """
    self._cmd = AdomdCommand(query, self._conn)
    self._row_count = self._cmd.ExecuteNonQuery()      

    return self
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant