Menu

Problems with whereClause

Help
MisterT
2005-04-25
2013-06-03
  • MisterT

    MisterT - 2005-04-25

    Hi!
    I've got a problem with whereClause / filtering.

    If I use this

    <db:dbform autoUpdate="false" followUp="/user/cto_job_details.jsp" maxRows="1" tableName="cto_jobs" whereClause="WHERE id = 4">

    the form displays ALL records of the table. That's wrong!
    If I use the same dbform tag with filter instead of whereClause

    <db:dbform autoUpdate="false" followUp="/user/cto_job_details.jsp" maxRows="1" tableName="cto_jobs" filter="id = 4">

    it works! Question: Why is the whereClause ignored?

    Thanks in advance + regards T.

     
    • MisterT

      MisterT - 2005-04-25

      Now I know what the problem is:

      If I call the jsp with the whereClause directly in the browser the whereClause works fine.

      But if I call the jsp from another jsp with

      <db:linkURL href="/user/cto_job_details.jsp" tableName="cto_jobs" position="<%= position_cto_jobs %>"/>

      it works not. The whereClause will be override by the linkURL tag and the form displays ALL records instead the whereClause selection.

      Is there anything wrong with it how I call the page with linkURL?

      regards T.

       
      • Henner Kollmann

        Henner Kollmann - 2005-04-25

        Nothing wrong, this is by design. whereClause and other filter mechanism can not work together.

        Henner

         
        • MisterT

          MisterT - 2005-04-25

          I don't want them to work together. Maybe my explanation is a little bit confusing, sorry.

          I only like to use whereClause in my jsp. The clause works fine, if I call the jsp directly from the browsers command line. But if I call the jsp from another jsp via linkURL tag, the whereClause does not work anymore.

          Hope I could explain the problem now ;-)

          regards T.

           
          • Henner Kollmann

            Henner Kollmann - 2005-04-25

            Yes, i understand. But use linkURL the internal filter system is used. This do not work together with whereClause.

            Somewhere in the docs is a hint that you can use whereClause only if you do not use dbforms filter, navigation etc.

            So you should avoid to use the whereClause.

            Henner

             
            • MisterT

              MisterT - 2005-04-25

              OK, now I know!
              Thanks for your hint, Henner.

              regards T.

               

Log in to post a comment.

MongoDB Logo MongoDB