Menu

#1 validate fails when using Subqueries

sqlbuilder-2.0.0
closed
sqlbuilder (11)
5
2012-09-29
2008-04-15
No

When calling validate() on a SelectQuery that includes a Subquery as part of a condition, validation fails.

Example:

SelectQuery innerSelect = new SelectQuery()
.addCustomColumns(_defTable2_col_id);
SelectQuery outerSelect = new SelectQuery()
.addCustomColumns(_table1_col1, _table1_col2)
.addJoin(JoinType.INNER, _table1, _defTable1, _table1_col1, _defTable1_col_id)
.addCondition(new InCondition(_table1_col1, new Subquery(innerSelect)));
outerSelect.validate();

Discussion

  • James Ahlborn

    James Ahlborn - 2008-04-18

    Logged In: YES
    user_id=1032055
    Originator: NO

    ooo, that's nasty. i've been thinking about how validation should proceed for nested queries. it's not an easy problem.

     
  • James Ahlborn

    James Ahlborn - 2008-04-26

    Logged In: YES
    user_id=1032055
    Originator: NO

    fixed. will be in the 2.0.2 release.

     

Log in to post a comment.