web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Result value of executeUpdate() method never set?

(0) ShareShare
ReportReport
Posted on by 3,905

Hi all,

I'm not able to get an result value except 0 using the executeUpdate() method on the statement class.

According to documentation https://msdn.microsoft.com/en-us/library/statement.executeupdate.aspx

the method should deliver the updated row count. I've tried a lot of DML commands (insert, delete and for sure update) but never getting any result value except 0. The statements did affect records in all cases.

 any clues how to overcome this problem?

 

I've tried created statements from both Connection and UserConnection class with a lot of kernels.

 

Does anyone has a solution for that? As workaround I'm using a select @@ROWCOUNT right after the update or delete statement, but I'm not sure if this is the correct way in all cases.

 

There is a annotation within the description related to stored procedures (SET NOCOUNT ON OFF)

 

regards

Douglas

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Brandon Wiese Profile Picture
    17,788 on at

    I do quite a lot with Connection and UserConnection, and I've also found the return value on executeUpdate to not work reliably, and so I also use SELECT @@ROWCOUNT and it gets the job done every time.

  • Douglas Noel Profile Picture
    3,905 on at

    Hi Brandon,

    thanks for your confirmation. I alrready thought I'm crackbrained.

    Will this EVER work reliaby?

    I remember a request for Ax30 with the answer. "Will be corrected in one of the next versions".

    So the explicit select of @@ROWCOUNT right after the DML seems to be the only chance.

    regards

    Douglas

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans