> [EMAIL PROTECTED] napisa�(a):
> > I need to determine the program flow depending on the result of a DB query: 
> > if the query returns zero reselts execute this pipeline or else execute 
> > that pipeline.
> >
> > It might trivial but I can't find an example anywhere :(
> 
> The best way is to use flowscript. How do you query your DB?



Grzegorz I do it through the SQL transformer:


###### map ######
<map:pipeline>
        <map:match pattern="checkParameters">
  <map:generate src="sql/checkParameters.xml"/>
        <map:transform type="sql">
        <map:parameter name="rid" value="{request-param:rid}"/>
        </map:transform>
        <map:serialize type="xml"/>
        </map:match>
</map:pipeline>

###### query ######
<document xmlns:sql="http://apache.org/cocoon/SQL/2.0";>
 <sql:execute-query>
  <sql:use-connection>datamed</sql:use-connection>
  <sql:query>
  SELECT * FROM report_parameter_map WHERE  report_id = '<sql:substitute-value 
name="rid"/>'
  </sql:query>
</sql:execute-query>
</document>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to