DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCRDBMS-641
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Ivan
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Error bulk Update with SQL Server

Created: 04/Feb/13 01:58 PM   Updated: 12/Feb/13 05:13 PM   Resolved: 05/Feb/13 10:13 AM
Component/s: Queries
Affects Version/s: 3.2.0.m3
Fix Version/s: 3.2.0.m4

File Attachments: 1. Zip Archive NUCRDBMS-641.zip (18 kB)


Datastore: Microsoft SQL Server


 Description  « Hide
A bulk update with SQL Server is getting a Incorrect Syntax error.

The JDOQL query is:

UPDATE test.Product set sold=true where paramIds.contains(id)

The SQL statement generated is:

UPDATE TEST.PRODUCT A0 SET A0.SOLD = 1 WHERE A0.ID IN(1);

But this update statement is not correct due to the aliases. The correct statement would be:

UPDATE A0 SET A0.SOLD = 1 FROM TEST.PRODUCT A0 WHERE A0.ID IN(1);


Andy Jefferson added a comment - 04/Feb/13 05:22 PM
No testcase as per the front page of JIRA or the docs

Andy Jefferson made changes - 04/Feb/13 05:22 PM
Field Original Value New Value
Priority Major [ 3 ] Incomplete [ 6 ]
Ivan added a comment - 04/Feb/13 06:14 PM - edited
JDO Testcase attached

Ivan made changes - 04/Feb/13 06:14 PM
Attachment NUCRDBMS-641.zip [ 11880 ]
Andy Jefferson added a comment - 05/Feb/13 10:13 AM
Give SVN trunk a try. It has some changes that may take into account the weirdness that SQLServer (and Sybase) expect for SQL UPDATE statements.

Andy Jefferson made changes - 05/Feb/13 10:13 AM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.2.0.m4 [ 11883 ]
Resolution Fixed [ 1 ]
Andy Jefferson added a comment - 12/Feb/13 05:13 PM
No feedback on whether this works, so closing

Andy Jefferson made changes - 12/Feb/13 05:13 PM
Status Resolved [ 5 ] Closed [ 6 ]