1 2 Previous Next 15 Replies Latest reply: Nov 16, 2012 2:32 PM by bip_monkey Go to original post RSS
      • 15. Re: Another dynamic where clause question
        bip_monkey
        ok...finally was able to figure it out. My assumption was when the "executeQuery()" is called, it would run the sql statement that is present in the VO of page2 (also assumed that the where clause would be appended to the sql statement with the "setWhereClause("PRIMARYKEY = :1");").

        For what ever reason, that does not seems to happen. Hence had to explicitly call the setQuery() with the same sql statement in the VO of page2.

        Final code looks like:
                    setFullSqlMode(FULLSQL_MODE_AUGMENTATION);
                    setQuery("SELECT * FROM <my table> where PRIMARYKEY = :1 ");
        
                    //setWhereClause("PRIMARYKEY = :1");            
                    setWhereClauseParams(null); // Always reset
                    setWhereClauseParam(0, primarykeyval);
                    System.out.println("Query Executed 1" + getQuery());
                    executeQuery();  
        Page2 is now rendering and shows me what I need.

        Thank you for all for taking time to try and solve my issue.

        Thanks,
        1 2 Previous Next