Hi,

I have found a bug where if a querydef is defined with a "where clause" and the 
querydef is also defined as a child form then the resultant SQL does not AND 
the querydef "where clause" and the child form "where clause" causing a syntax 
error to occur.

I have made a fix and here it is

org.dbforms.config.Query:getSelectQuery
...

      s = getQueryWhere(fvHaving, fvOrder, compareMode);

      if (!Util.isNull(s)) {
         if (!Util.isNull(groupBy)) {
            buf.append(" HAVING ( ");
            hatSchonHaving = true;
         } else if (!hatSchonWhere) {
            buf.append(" WHERE ( ");
         } else {
            // Line in Error change to if (!Util.isNull(where) && 
!hatSchonFollowAfterWhere) {
           if (!Util.isNull(where) && !hatSchonFollowAfterWhere && 
followAfterWhere != null && followAfterWhere.length() > 0) {
               buf.append(" ");
               buf.append(followAfterWhere);
               buf.append(" (");
            } else {
               buf.append(" AND (");
            }
         }
....


I do not know the process to get these things integrated into the next release. 
I am quite happy to add the changes myself if given access.

Regards,

Jeremy Chilvers


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to