User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 391,706 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,321 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

using asp array to store db information

Join Date: Oct 2004
Posts: 7
Reputation: jwstickley is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
jwstickley jwstickley is offline Offline
Newbie Poster

Re: using asp array to store db information

  #2  
Oct 26th, 2004
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.

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
Reply With Quote  
All times are GMT -4. The time now is 2:55 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC