You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by John Chien <jo...@ncmail.net> on 2006/02/16 15:13:05 UTC

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


Re: List of data as input

Posted by John Chien <jo...@ncmail.net>.
Thanks,

James, Steven wrote:

>try this guide http://cvs.apache.org/dist/ibatis/ibatis.java/docs/iBATIS-SqlMaps-2.pdf
>page 39...
> 
>The <iterate> tag will work fine to create and IN list..
> 
>steve.
>
>________________________________
>
>From: John Chien [mailto:john.chien@ncmail.net]
>Sent: Thu 16/02/2006 14:37
>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.
>>
>>
>>    
>>
>
>
>  
>

RE: List of data as input

Posted by "James, Steven" <st...@logicacmg.com>.
try this guide http://cvs.apache.org/dist/ibatis/ibatis.java/docs/iBATIS-SqlMaps-2.pdf
page 39...
 
The <iterate> tag will work fine to create and IN list..
 
steve.

________________________________

From: John Chien [mailto:john.chien@ncmail.net]
Sent: Thu 16/02/2006 14:37
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.
> 
>



Re: List of data as input

Posted by John Chien <jo...@ncmail.net>.
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.
>  
>

RE: List of data as input

Posted by "James, Steven" <st...@logicacmg.com>.
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.