| Author |
Topic  |
|
|
ersantosh1
Starting Member
India
6 Posts |
Posted - 04/20/2012 : 10:38:20
|
Hi, i got resultstring like lsresult=107,108,109,110 those are template ids
whose names i have to get in following fashion...
lsnames = GEN,VEN,TEN,SEN
i have query like
select TEM_NAME FROM MST_TEMPLATE WHERE TEM_ID IN (107,108,109,110);
SHOULD I GET RESULT IN THIS FASHION lsTempName=GEN,VEN,TEN,SEN
becauese i have to use that variable on my Jsp page like <%=lsTempName%>
Plz help
Thanks santosh
srahangdale |
|
|
sunitabeck
Flowing Fount of Yak Knowledge
5152 Posts |
Posted - 04/20/2012 : 11:49:36
|
quote: SHOULD I GET RESULT IN THIS FASHION lsTempName=GEN,VEN,TEN,SEN
Are you asking whether that would be the format output of the select statement? If so, it won't be. The result will be four rows of data, rather than comma-separated result.
If you do want to make it comma-separated, you can use the xml path approach. For example, see this thread: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=173794 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47023 Posts |
Posted - 04/20/2012 : 15:32:18
|
quote: Originally posted by ersantosh1
Hi, i got resultstring like lsresult=107,108,109,110 those are template ids
whose names i have to get in following fashion...
lsnames = GEN,VEN,TEN,SEN
i have query like
select TEM_NAME FROM MST_TEMPLATE WHERE TEM_ID IN (107,108,109,110);
SHOULD I GET RESULT IN THIS FASHION lsTempName=GEN,VEN,TEN,SEN
becauese i have to use that variable on my Jsp page like <%=lsTempName%>
Plz help
Thanks santosh
srahangdale
why bnot bring them as a resultset from sql and then generate comma seperated list from front end? If not you've use UDF or use XML blaclbox method for generating csv ------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
Edited by - visakh16 on 04/20/2012 15:33:47 |
 |
|
| |
Topic  |
|
|
|