Bugs item #504625, was opened at 2002-01-16 14:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=504625&group_id=22866
Category: JBossCMP Group: v3.0 Rabbit Hole >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Basil Vandegriend (basilv) >Assigned to: Dain Sundstrom (dsundstrom) Summary: Generation of SQL for Locate() incorrect Initial Comment: The SQL generated from EJB-QL with a Locate() statement is incorrect. In particular, if the 3rd argument (start position) is not specified, JBoss supplies a default of '0'. However, I believe that a default of '1' is actually correct. While the EJB spec does not specify the behavior of the Locate() function, a footnote references Appendix A in the book "JDBC API Tutorial and Reference, 2nd edition". In this book, the behavior of Locate() is described as being based on an one-based index. As further evidence, in running the query on a Oracle 8i database, the default value of '0' for the start position did not work, while a value of '1' did work. Here are some details: EJB-QL statement: <![CDATA[SELECT OBJECT(c) FROM Customer AS c WHERE LOCATE(c.firstName, ?1) > 0]]> --> Generated SQL (from server log file) (using the Oracle8 type mapping): Executing SQL: SELECT t1_c.ID FROM ex2Customer t1_c WHERE instr(t1_c.firstName, ?, 0) > 0 Version information (from server log file): 2002-01-16 14:45:42,431 INFO [org.jboss.system.GPA] Java version: 1.3.1,Sun Microsystems Inc. 2002-01-16 14:45:42,431 INFO [org.jboss.system.GPA] Java VM: Java HotSpot(TM) Client VM 1.3.1-b24,Sun Microsystems Inc. 2002-01-16 14:45:42,441 INFO [org.jboss.system.GPA] OS-System: Windows NT 4.0,x86 2002-01-16 14:45:42,441 INFO [org.jboss.system.GPA] JBoss Version: 3.0.0alpha(200112121023) Attached is the JBoss server log showing the SQL generation resulting from attempting to execute the find method with the EJB-QL shown above. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=504625&group_id=22866 _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
