Re: Substr gives incorrect results when start_position is a negative number

2012-03-14 Thread Thomas Mueller
Hi, Thanks! This is now implemented in the trunk and will be included in the next version of H2 (released in about a week). Regards, Thomas On Saturday, March 10, 2012, Vinod wrote: > Following is the custom implementation I added: > - >publi

Re: Substr gives incorrect results when start_position is a negative number

2012-03-09 Thread Vinod
Following is the custom implementation I added: - public static String customSubStrXX(String...str) throws SQLException { // In Oracle/PLSQL, the substr functions allows you to extract a substring from a string. // The syntax for the sub

Re: Substr gives incorrect results when start_position is a negative number

2012-03-07 Thread Vinod
Thanks, fixing substr will be a good idea. Also negative number in substr works with Oracle. On Mar 6, 3:00 pm, Thomas Mueller wrote: > Hi, > > Is there a way to register the new implementation with the same name > > > substr ? > > No. I think it would be a source of trouble if we would allow to

Re: Substr gives incorrect results when start_position is a negative number

2012-03-06 Thread Thomas Mueller
Hi, Is there a way to register the new implementation with the same name > substr ? > No. I think it would be a source of trouble if we would allow to overwrite library methods. Instead, SUBSTR should be fixed if there is a bug. It seems only MySQL returns "Net" (the end of the input string) whe

Substr gives incorrect results when start_position is a negative number

2012-02-27 Thread Vinod
Query: select substr('TechOnTheNet', -3, 3) from dual Expected Output: Net Actual Output: Tec To make this work, I 1. implemented my own function, registered it(create alias substrXX.) with name substrXX 2. Then before executing a query, replaced all the substr with substrXX Had to register i