cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pål Wester <pal.wester.l...@florence.never.no>
Subject SV: ESQL: Sub Queries.
Date Thu, 01 Mar 2001 21:38:04 GMT
Try without another <esql:connection>, like
this:
 <esql:connection>
  <esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver> // does this
really work??
   <esql:dburl>jdbc:odbc:995</esql:dburl>
   <esql:username>jafah</esql:username>
   <esql:execute-query>
     <esql:query>select * from client
     </esql:query>
     <esql:results>
       <client>>
       <esql:row-results>
           <pk><esql:get-int column="CL_PK"/></pk>>
           <name><esql:get-string column="CL_NAME"/></name>
             <esql:execute-query>
               <esql:query>SELECT *
 	      		FROM CL_PROG
 			WHERE CL_FK =
                   <esql:parameter type="int">
                   <esql:get-int column="cl_pk" ancestor="1" />
                   </esql:parameter>
 	      </esql:query>
		<programs> // is this legal?? (donald)
               <esql:results>
 	          <esql:row-results>
 		      <prog><esql:get-string column="PROG"/></prog>
 		  </esql:row-results>
 	      </programs>
               </esql:results>
             </esql:execute-query>
         </esql:row-results>
 	</client>
     </esql:results>
   </esql:execute-query>
 </esql:connection>

mvh:
Pål Wester, programmerer
never.no as, stortingsgt 30, 0161 Oslo
direkte: 22 01 66 34, 906 900 62
tlf: 22 01 66 34, fax: 22 01 66 21
http://never.no - icq:103476059
~ innhold for internett ~

> -----Opprinnelig melding-----
> Fra: jimfah@coolmail.net [mailto:jimfah@coolmail.net]
> Sendt: 28. februar 2001 21:44
> Til: cocoon-users@xml.apache.org
> Emne: ESQL: Sub Queries.
>
>
>
> The query example using a subquery that came with Cocoon works on
> my Oracle Database but not on SQL Server.  It may be that I'm
> using the ODBC bridge.  Is this a bug or a limitation of the bridge?
>
> Here is the query:
> <esql:connection>
>   <esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver>
>   <esql:dburl>jdbc:odbc:995</esql:dburl>
>   <esql:username>jafah</esql:username>
>   <esql:execute-query>
>     <esql:query>select * from client
>     </esql:query>
>     <esql:results>
>       <client>
>       <esql:row-results>
>           <pk><esql:get-int column="CL_PK"/></pk>
>           <name><esql:get-string column="CL_NAME"/></name>
>         <esql:connection>
> 		<esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver>
>   		<esql:dburl>jdbc:odbc:995</esql:dburl>
>   		<esql:username>jafah</esql:username>
>             <esql:execute-query>
>               <esql:query>SELECT *
> 	      		FROM CL_PROG
> 			WHERE CL_FK =
>                   <esql:parameter type="int">
>                   <esql:get-int column="cl_pk" ancestor="1" />
>                   </esql:parameter>
> 	      </esql:query>
>               <esql:results>
> 	      <programs>
> 	          <esql:row-results>
> 		      <prog><esql:get-string column="PROG"/></prog>
> 		  </esql:row-results>
> 	      </programs>
>               </esql:results>
>             </esql:execute-query>
> 	 </esql:connection>
>
>         </esql:row-results>
> 	</client>
>     </esql:results>
>   </esql:execute-query>
> </esql:connection>
>
> It gives me the error:
> java.lang.RuntimeException: Error setting parameter on statement:
> SELECT * FROM CL_PROG WHERE CL_FK = ?
>
> Thanks in advance.
> Jim Fah
>
>
> ____________________________________________
> CoolMail(tm).  Hear.  There.  Everywhere.(sm)
> E-mail by phone - http://www.planetarymotion.com
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message