IMHO, do not start using sql transformer but use some jdo implementation if you 
ask me. Search for Brick cms, you will find a good starting point in there,

Regards Ard




Hi,

Does the database you are using support stored procedures (even MySql now 
does)? If so, write the complex SQL as a strored procedure and then execute the 
stored procedure from the SQLTransformer, possibly using the ancestor construct 
that the SQLTransformer has specifically to support nested Queries. 

Personally, I don't see a problem with doing some XSL transformation after one 
query before doing another based on the output DOM; this is what XML pipelines 
are all about. Perhaps you are not very familiar with XSL. Invest some time and 
you will be rewarded! 

XSL and Database Actions are deprecated so I would recommend the pipeline 
approach as you will end up with a more maintainable and extensible solution 
because you will seperate the concerns.

Regards,

Warrell


On 16/06/07, Rob Frohwein <[EMAIL PROTECTED]> wrote:

Hi,
For some project I need to make rather deeply nested database queries.
I was looking for the best stategy (I am new to cocoon)

----------------------------------------------
1 Doing all nested queries in one xsp or xml page. 
But this will be difficult to maintain and test.
----------------------------------------------
2 extending queries in one pipeline
In this strategy a resultset is extended by following steps in the pipeline. 

sitemap.xmap:
<map:pipeline>
        <map:match pattern="start">
        <map:generate type="file" src="query1.xml"/>

                <map:transform type="sql"> 
        ...

        <map:transform type="xslt" src="query2.xsl"/>

        <map:transform type="sql">
        ...

        </map:match>
</map:pipeline> 

query1.xml could do a first level query.
query2.xsl could do some processing and at some point in the tree
do a new query and append the resultset there.(sqltaglib can be used in
xslt)

But this seems not to work, because the first resultset creates 
elements like <sql:somename> the second sqltransform step will be
confused by these tags.
I could rename all <sql:somename> tags after the first sqltransform
step, but that is a bit clumsy.

So this does not work.
I also understood from the documentation that it's not possible
to use more then one xsp in a pipeline, so this approach will
also not be possible with esql?

---------------------------------------------- 
3 Call pipeline entries from an xsp/xml sql query loop:

In this case I would like something like:
query1.xsp:
<customer>
        <esql:connection>
        <esql:pool>fwstat</esql:pool> 

        <esql:execute-query >
                <esql:query>
                        select * from customers
                </esql:query>
                <esql:results>
                        <esql:row-results> 
                                Call query2.xsp(
                                        <esql:get-string column="id"/>
                                        <esql:get-string column="name"/> 
                                        )
                        </esql:row-results>
                </esql:results>
        </esql:execute-query>
        </esql:connection>
</customer> 
query2.xsp would do a new query with the supplied parameters.
query2.xsp could ofcourse do other queries.

But I could not find constructs like this.
----------------------------------------------

What is the best approach to separate the nested queries? 

Thanks.
Rob

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

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

Reply via email to