result-set inside a no-results

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

result-set inside a no-results

Jay Klehr
Hello again,
 
Curious if this particular way of doing things is supported.
 
I'm doing a query in an XPL file, in the <result-set> I'm building an XML file, however, in the <no-results> I'm doing another <execute> that runs another <query> which builds a similar XML file in its own <result-set>.
 
I thought it was working ok, but turns out it isn't.  If I send it data that causes it to go into the <no-results> everything seems fine.  But when I send it data that shouldn't go into the no-results block, it still seems to be executing that query and adding the second XML file to the first (giving me two root elements).
 
Why is Orbeon executing queries in the <no-results> block if there were results from the previous <result-set>?
 
Removing the <no-results> block entirely works, and removing the <result-set> from the <no-results> also works (but I'm assuming that the SQL in the <no-results> is still being run.
 
Here's an example of my SQL XPL file:
 
<p:processor name="oxf:sql">
  <p:output name="data" id="data" />
  <p:input name="data" href="#instance"/>
  <p:input name="datasource" href="/external/datasource-sql.xml" />
  <p:input name="config">
   <sql:config>
    <sql:connection>
     <sql:execute>
      <sql:query>
QUERY 1
      </sql:query>
      <sql:result-set>
       <root>
        <sql:row-iterator>
         <item>
          <column1><sql:get-column-value type="xs:string" column="col1"/></column1>
          <column2><sql:get-column-value type="xs:string" column="col2"/></column2>
         </item>
        </sql:row-iterator>
       </root>
      </sql:result-set>
      <sql:no-results>
       <sql:execute>
        <sql:query>
QUERY 2 ONLY RUN WHEN NO RESULTS FROM ABOVE
        </sql:query>
        <sql:result-set>
         <root>
          <sql:row-iterator>
           <item>
            <column1><sql:get-column-value type="xs:string" column="col1"/></column1>
            <column2><sql:get-column-value type="xs:string" column="col2"/></column2>
           </item>
          </sql:row-iterator>
         </root>
        </sql:result-set>
       </sql:execute>
      </sql:no-results>
     </sql:execute>
    </sql:connection>
   </sql:config>
  </p:input>
 </p:processor>
 
Appreciate any insight,
 
Jay


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: result-set inside a no-results

Erik Bruchez
Administrator
Jay,

You probably just hit a bug. I just entered it:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=305817&group_id=168&atid=350207

Can you find a workaround?

-Erik

Jay Klehr wrote:

> Hello again,
>  
> Curious if this particular way of doing things is supported.
>  
> I'm doing a query in an XPL file, in the <result-set> I'm building an
> XML file, however, in the <no-results> I'm doing another <execute> that
> runs another <query> which builds a similar XML file in its own
> <result-set>.
>  
> I thought it was working ok, but turns out it isn't.  If I send it data
> that causes it to go into the <no-results> everything seems fine.  But
> when I send it data that shouldn't go into the no-results block, it
> still seems to be executing that query and adding the second XML file to
> the first (giving me two root elements).
>  
> Why is Orbeon executing queries in the <no-results> block if there were
> results from the previous <result-set>?
>  
> Removing the <no-results> block entirely works, and removing the
> <result-set> from the <no-results> also works (but I'm assuming that the
> SQL in the <no-results> is still being run.
>  
> Here's an example of my SQL XPL file:
>  
> <p:processor name="oxf:sql">
>   <p:output name="data" id="data" />
>   <p:input name="data" href="#instance"/>
>   <p:input name="datasource" href="/external/datasource-sql.xml" />
>   <p:input name="config">
>    <sql:config>
>     <sql:connection>
>      <sql:execute>
>       <sql:query>
> QUERY 1
>       </sql:query>
>       <sql:result-set>
>        <root>
>         <sql:row-iterator>
>          <item>
>           <column1><sql:get-column-value type="xs:string"
> column="col1"/></column1>
>           <column2><sql:get-column-value type="xs:string"
> column="col2"/></column2>
>          </item>
>         </sql:row-iterator>
>        </root>
>       </sql:result-set>
>       <sql:no-results>
>        <sql:execute>
>         <sql:query>
> QUERY 2 ONLY RUN WHEN NO RESULTS FROM ABOVE
>         </sql:query>
>         <sql:result-set>
>          <root>
>           <sql:row-iterator>
>            <item>
>             <column1><sql:get-column-value type="xs:string"
> column="col1"/></column1>
>             <column2><sql:get-column-value type="xs:string"
> column="col2"/></column2>
>            </item>
>           </sql:row-iterator>
>          </root>
>         </sql:result-set>
>        </sql:execute>
>       </sql:no-results>
>      </sql:execute>
>     </sql:connection>
>    </sql:config>
>   </p:input>
>  </p:processor>
>  
> Appreciate any insight,
>  
> Jay
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: result-set inside a no-results

Jay Klehr
Erik,
 
Thanks for the reply, I'll keep an eye on the bug report.  For now I was able to take my logic into the DB Server in a stored procedure.
 
Thanks,
 
Jay

________________________________

From: Erik Bruchez on behalf of Erik Bruchez
Sent: Tue 7/25/2006 4:49 AM
To: [hidden email]
Subject: Re: [ops-users] result-set inside a no-results



Jay,

You probably just hit a bug. I just entered it:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=305817&group_id=168&atid=350207

Can you find a workaround?

-Erik

Jay Klehr wrote:

> Hello again,
>
> Curious if this particular way of doing things is supported.
>
> I'm doing a query in an XPL file, in the <result-set> I'm building an
> XML file, however, in the <no-results> I'm doing another <execute> that
> runs another <query> which builds a similar XML file in its own
> <result-set>.
>
> I thought it was working ok, but turns out it isn't.  If I send it data
> that causes it to go into the <no-results> everything seems fine.  But
> when I send it data that shouldn't go into the no-results block, it
> still seems to be executing that query and adding the second XML file to
> the first (giving me two root elements).
>
> Why is Orbeon executing queries in the <no-results> block if there were
> results from the previous <result-set>?
>
> Removing the <no-results> block entirely works, and removing the
> <result-set> from the <no-results> also works (but I'm assuming that the
> SQL in the <no-results> is still being run.
>
> Here's an example of my SQL XPL file:
>
> <p:processor name="oxf:sql">
>   <p:output name="data" id="data" />
>   <p:input name="data" href="#instance"/>
>   <p:input name="datasource" href="/external/datasource-sql.xml" />
>   <p:input name="config">
>    <sql:config>
>     <sql:connection>
>      <sql:execute>
>       <sql:query>
> QUERY 1
>       </sql:query>
>       <sql:result-set>
>        <root>
>         <sql:row-iterator>
>          <item>
>           <column1><sql:get-column-value type="xs:string"
> column="col1"/></column1>
>           <column2><sql:get-column-value type="xs:string"
> column="col2"/></column2>
>          </item>
>         </sql:row-iterator>
>        </root>
>       </sql:result-set>
>       <sql:no-results>
>        <sql:execute>
>         <sql:query>
> QUERY 2 ONLY RUN WHEN NO RESULTS FROM ABOVE
>         </sql:query>
>         <sql:result-set>
>          <root>
>           <sql:row-iterator>
>            <item>
>             <column1><sql:get-column-value type="xs:string"
> column="col1"/></column1>
>             <column2><sql:get-column-value type="xs:string"
> column="col2"/></column2>
>            </item>
>           </sql:row-iterator>
>          </root>
>         </sql:result-set>
>        </sql:execute>
>       </sql:no-results>
>      </sql:execute>
>     </sql:connection>
>    </sql:config>
>   </p:input>
>  </p:processor>
>
> Appreciate any insight,
>
> Jay
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

winmail.dat (11K) Download Attachment