Forum Moderators: coopster & phranque

Message Too Old, No Replies

Multiple recordsets

Accessing information from more than one recordset

         

Sandi_W

6:22 pm on May 14, 2002 (gmt 0)



I have a page that requires me to create several recordsets and loop through them attempting to match elements and generate statistics. Is there a way to "link" multiple recordsets together?

txbakers

6:35 pm on May 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sure can. Just assign a value from a previous recordset to a variable, and use that variable as a parameter in the Query of the second recordset.

Just be sure to assign the variable a value in the while loop of the first recordset.

I can send you an example if you want.

Sandi_W

6:44 pm on May 14, 2002 (gmt 0)



An example would be awesome!! Thanks

bmcgee

12:04 am on May 15, 2002 (gmt 0)

10+ Year Member



If you are using ADO, you can use the SHAPE command. This will let you structure your SQL so that a "field" in a record can actually be another recordset itself.

This is very useful for queries that bring back hierachical data.

You could also just write your SQL so that it joins as needed and then parse one big recordset. This saves a lot of overhead of having the server compile many, many queries.

txbakers

3:05 am on May 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That SHAPE command is very cool. I'm just learning about it with XML.

The idea of making joins is a good one, if you can.

Morrison

12:54 pm on May 16, 2002 (gmt 0)

10+ Year Member



If what your talking about is that you need information from more then one table in you DB, i think the right way to do it is with the command "Inner Join".
if that's want you want to do give me more information and i'll give you an example.

Sandi_W

5:06 pm on May 17, 2002 (gmt 0)



Thanks, but I know how to do inner joins. I am working with Oracle and get timeouts. I found a great (and fast) way around the problem using data shaping.