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
Hello,

You can do this using a dynamic select :


<isNotNull property="titleList">
<iterate prepend="AND" property="titleList" conjunction="OR">
title=#titleList[]#
</iterate>
</isNotNull>


Hilde

-----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


James:

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:

SELECT name
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.

Thanks,

John Chien





James, Steven wrote:

>Hi John,
> 
>If you download the ibatis quick start guide
http://cvs.apache.org/dist/ibatis/ibatis.java/docs/iBATIS-SqlMaps-2-Tutorial
.pdf you will find this out i no time.
> 
>Good luck you already have way there....
> 
>Steve..
>
>________________________________
>
>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:
>
>name,
>date-of-birth,
>title,
>phone_number
>
>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 = ????
>
>
>Thanks,
>
>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.
>  
>

Mime
View raw message