ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hilde.DE-GRA...@ext.cec.eu.int
Subject RE: List of data as input
Date Thu, 16 Feb 2006 14:44:02 GMT

You can do this using a dynamic select :

<isNotNull property="titleList">
<iterate prepend="AND" property="titleList" conjunction="OR">


-----Original Message-----
From: John Chien [mailto:john.chien@ncmail.net] 
Sent: Thursday, February 16, 2006 3:38 PM
To: user-java@ibatis.apache.org
Subject: Re: List of data as input


I am not quite sure if I can find the solution in the tutorial because 
the input data is any array or list.

I have to write something like:

FROM Employee
WHER title in (.....)

where (.....) is the list of titles. 
Since I do not know the size of list of titles before hand, I do not quite
know how to write the SQL statement.


John Chien

James, Steven wrote:

>Hi John,
>If you download the ibatis quick start guide
.pdf you will find this out i no time.
>Good luck you already have way there....
>From: John Chien [mailto:john.chien@ncmail.net]
>Sent: Thu 16/02/2006 14:13
>To: user-java@ibatis.apache.org
>Subject: List of data as input
>Dear Sir:
>Suppose that I have a table called Employee which has the folloing fields:
>I want to write a SQL query using ibatis SQLMAP which will return a list
>of names which have the matching titles
>The matching titles are containend in an array or list. The number of
>the element in the array or list may vary.
>How can I write a SQL to do the job ?
>SELECT name
>FROM Employee
>WHER title = ????
>John Chien
>This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.

View raw message