Issue Details (XML | Word | Printable)

Key: OPENJPA-269
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Michael Dick
Reporter: Michael Dick
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenJPA

Informix doesn't support subselects or using table aliases in a delete statement.

Created: 27/Jun/07 06:26 PM   Updated: 24/Sep/07 03:59 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.0

Time Tracking:
Not Specified

Resolution Date: 27/Jun/07 06:39 PM


 Description  « Hide
Informix doesn't support using table aliases in a delete statement if you have an index on the table. For example if we issue the SQL statement :
"delete from quoteejb t0" a Syntax error will be thrown by the Informix JDBC driver. Whereas "delete from quoteejb" would work.

This problem seems to be fixed by setting allowAliasInBulkClause to false in InformixDBDictionary. Another possibility is to check whether there is an index on the table, if no index is present we should be able to use the alias. I haven't verified whether that approach works though.

A second problem occurred when we tried to issue the following statement :
DELETE FROM holdingejb WHERE holdingID IN (SELECT DISTINCT t0.holdingID FROM holdingejb t0 WHERE (t0.ACCOUNT_ACCOUNTID IS NULL))

The second problem was resolved by setting supportsSubselect to false in InformixDBDictionary.

In the current implementation when supportsSubselect is false we never check allowAliasInBulkClause so the first change might not be necessary. If the implementation changes we might run into the problem again, so I'd prefer to change both variables.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #551263 Wed Jun 27 18:36:38 UTC 2007 mikedd OPENJPA-269 Updating InformixDBDictionary
Files Changed
MODIFY /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java