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-410
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

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

Support JDOQL StringExpression.indexOf(str, pos) with Postgresql

Created: 09/Jun/10 09:46 AM   Updated: 11/Jun/10 01:38 PM   Resolved: 09/Jun/10 10:23 AM
Component/s: Queries
Affects Version/s: None
Fix Version/s: 2.1.0.release


 Description  « Hide
While PostgreSQL doesn't have a single function that will achieve it, what you could do is

CASE WHEN (STRPOS(SUBSTR(STR_FIELD, START_POS)) > 0)
    THEN (STRPOS(SUBSTR(STR_FIELD, START_POS), STR) -1 + START_POS)
ELSE
    -1

Andy Jefferson made changes - 09/Jun/10 10:23 AM
Field Original Value New Value
Fix Version/s 2.1.0.release [ 10832 ]
Description While PostgreSQL doesn't have a single function that will achieve it, what you could do is

STRPOS(SUBSTR(STR_FIELD, START_POS), STR)
While PostgreSQL doesn't have a single function that will achieve it, what you could do is

CASE WHEN (STRPOS(SUBSTR(STR_FIELD, START_POS)) > 0)
    THEN (STRPOS(SUBSTR(STR_FIELD, START_POS), STR) -1 + START_POS)
ELSE
    -1
Andy Jefferson added a comment - 09/Jun/10 10:23 AM
SVN trunk implements this now, and the JDOQLBasicTest passes

Andy Jefferson made changes - 09/Jun/10 10:23 AM
Status Open [ 1 ] Resolved [ 5 ]
Assignee Andy Jefferson [ andy ]
Fix Version/s 2.1.0.release [ 10832 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 11/Jun/10 01:38 PM
Status Resolved [ 5 ] Closed [ 6 ]