You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Schmitt, Christian" <Ch...@Dresdner-Bank.com> on 2000/07/14 10:11:34 UTC

Multiple queries using SQL Taglib

Hi,
in trying to move my XML documents from the SQL Processor to XSP w. SQL
taglib I'm struggeling with multiple queries in one single XML document.

Here's what my XML looks like:
<!-- cut here -->
<?cocoon-process type="xsp"?>
<xsp:page
	language="java"
	xmlns:xsp="http://www.apache.org/1999/XSP/Core"
	xmlns:sql="http://www.apache.org/1999/SQL"
>
<page>	
<sql:execute-query>
	<sql:driver>com.informix.jdbc.IfxDriver</sql:driver>
	
<sql:dburl>jdbc:informix-sqli://dbhostname:1530/mydatabase:informixserver=db
hostname</sql:dburl>
	<sql:username>user</sql:username>
	<sql:password>password</sql:password>
	<sql:row-element>row</sql:row-element>
	<sql:query>
		SELECT tabname, owner FROM SYSTABLES WHERE tabname =
'syscolumns'
	</sql:query>	
	<sql:query>
		SELECT tabname, owner FROM SYSTABLES WHERE tabname =
'systables'
	</sql:query>
</sql:execute-query>
</page>		
</xsp:page>
<!-- cut here -->

But I only get the results for the first query. I tried putting tags around
the <sql:query> tags but the I don't get anything but an SQL exception
(empty statement).
If someone has a small, working example I'd appreciate it.

Thanks in advance,
Christian Schmitt

Re: Multiple queries using SQL Taglib

Posted by Donald Ball <ba...@webslingerZ.com>.
On Fri, 14 Jul 2000, Schmitt, Christian wrote:

> Hi,
> in trying to move my XML documents from the SQL Processor to XSP w. SQL
> taglib I'm struggeling with multiple queries in one single XML document.
> 
> Here's what my XML looks like:
> <!-- cut here -->
> <?cocoon-process type="xsp"?>
> <xsp:page
> 	language="java"
> 	xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> 	xmlns:sql="http://www.apache.org/1999/SQL"
> >
> <page>	
> <sql:execute-query>
> 	<sql:driver>com.informix.jdbc.IfxDriver</sql:driver>
> 	
> <sql:dburl>jdbc:informix-sqli://dbhostname:1530/mydatabase:informixserver=db
> hostname</sql:dburl>
> 	<sql:username>user</sql:username>
> 	<sql:password>password</sql:password>
> 	<sql:row-element>row</sql:row-element>
> 	<sql:query>
> 		SELECT tabname, owner FROM SYSTABLES WHERE tabname =
> 'syscolumns'
> 	</sql:query>	
> 	<sql:query>
> 		SELECT tabname, owner FROM SYSTABLES WHERE tabname =
> 'systables'
> 	</sql:query>
> </sql:execute-query>
> </page>		
> </xsp:page>
> <!-- cut here -->
> 
> But I only get the results for the first query. I tried putting tags around
> the <sql:query> tags but the I don't get anything but an SQL exception
> (empty statement).

you have to have two execute-query blocks. might be convinced to change
that behavior though.

- donald