•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 401,676 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,466 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 14760 | Replies: 1
![]() |
| |
•
•
Join Date: Aug 2004
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
undefinedhi,
I am new to asp and trying to get information from a table and make an array of it using an asp variable and then use it for further processing .
The problem is the my sql query returns data this way
Id
16
27
95
97
90,89,65,45,44
78
87
93
I need to get all these values(which includes all the comma separated .I need to use this information in another sql query which then returns me more info
is this possible?
The next table has more information on this column with which i can eliminate the duplicate and extra values.
Thanks,
arthi
I am new to asp and trying to get information from a table and make an array of it using an asp variable and then use it for further processing .
The problem is the my sql query returns data this way
Id
16
27
95
97
90,89,65,45,44
78
87
93
I need to get all these values(which includes all the comma separated .I need to use this information in another sql query which then returns me more info
is this possible?
The next table has more information on this column with which i can eliminate the duplicate and extra values.
Thanks,
arthi
•
•
Join Date: Oct 2004
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 1
If you collect the result set from your first query into a coma separated string as follows:
16,27,95,97,90,89,65,45,44,78,87,93
then, you can then embed this string in the second query as follows:
select * from your_second_table where id in ( 16,27,95,97,90,89,65,45,44,78,87,93)
The only problem with this is that the second query will fail if you have too many items in the list (Max number depends on your DB). The better solution would be to design the tables so you could join the two tables in a single query. The only problem I see for you is you have a column that has multiple values in it (poor design).
If you provide more details on the layout of the tables and the queries you are running, I might be able to give you more specific advice.
16,27,95,97,90,89,65,45,44,78,87,93
then, you can then embed this string in the second query as follows:
select * from your_second_table where id in ( 16,27,95,97,90,89,65,45,44,78,87,93)
The only problem with this is that the second query will fail if you have too many items in the list (Max number depends on your DB). The better solution would be to design the tables so you could join the two tables in a single query. The only problem I see for you is you have a column that has multiple values in it (poor design).
If you provide more details on the layout of the tables and the queries you are running, I might be able to give you more specific advice.
•
•
•
•
Originally Posted by arthi
undefinedhi,
I am new to asp and trying to get information from a table and make an array of it using an asp variable and then use it for further processing .
The problem is the my sql query returns data this way
Id
16
27
95
97
90,89,65,45,44
78
87
93
I need to get all these values(which includes all the comma separated .I need to use this information in another sql query which then returns me more info
is this possible?
The next table has more information on this column with which i can eliminate the duplicate and extra values.
Thanks,
arthi
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- How is 3Tier architecture implemented in ASP.NET (ASP.NET)
- First Attempt at Arrays (Java)
- How to load a JPEG image file, store it in array and then save it (Visual Basic 4 / 5 / 6)
- do u advice me to do my online store using ASP or PHP (IT Technologies and Trends)
- Collecting Statistics from fields (Visual Basic 4 / 5 / 6)
- Need help with calculation (VB.NET)
- Inserting array into cookie (PHP)
- URGENT - Reading from txt file into a 2 dimension array (Java)
Other Threads in the ASP Forum
- Previous Thread: new and in need
- Next Thread: How do I get the Description attribute in Windows Media Player using ASP?


Hybrid Mode