Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Joining recordsets


Message #1 by s.bussing@i... on Tue, 18 Jun 2002 09:46:03
Hi,

I was wondering if anyone has an elegant solution to the following 
problem. I've two recordsets which are the results of a stored procedure. 
Now I have to combine those recordsets into one on basis of certain 
specified fields. My thought is to make to array's, each array containing 
the results of the recordsets. Then itterate through the array and compare 
each row with the row in the second array. If the fieldvalues for certain 
fields are the same then I put the result in a thirth array. But I think 
there is a better solution. Can anyone tell me?

Thanks.

Stephan
Message #2 by "Ken Schaefer" <ken@a...> on Wed, 19 Jun 2002 12:15:39 +1000
You can't do a JOIN in your original query?

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <s.bussing@i...>
Subject: [access_asp] Joining recordsets


: I was wondering if anyone has an elegant solution to the following
: problem. I've two recordsets which are the results of a stored procedure.
: Now I have to combine those recordsets into one on basis of certain
: specified fields. My thought is to make to array's, each array containing
: the results of the recordsets. Then itterate through the array and compare
: each row with the row in the second array. If the fieldvalues for certain
: fields are the same then I put the result in a thirth array. But I think
: there is a better solution. Can anyone tell me?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #3 by s.bussing@i... on Wed, 19 Jun 2002 07:55:27
Sorry Ken, 

but join's cannot be used here. If a join is used I'll get a cartasian 
result. That, I forgot to mention. I'll try an intersect. Maybe that will 
work. But thanks anyway.

Greetzzz

> You can't do a JOIN in your original query?

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <s.bussing@i...>
Subject: [access_asp] Joining recordsets


: I was wondering if anyone has an elegant solution to the following
: problem. I've two recordsets which are the results of a stored procedure.
: Now I have to combine those recordsets into one on basis of certain
: specified fields. My thought is to make to array's, each array containing
: the results of the recordsets. Then itterate through the array and 
compare
: each row with the row in the second array. If the fieldvalues for certain
: fields are the same then I put the result in a thirth array. But I think
: there is a better solution. Can anyone tell me?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #4 by s.bussing@i... on Wed, 19 Jun 2002 12:00:08
Hi Ken,

No, in this case it's not possible to use a join. I know it's not ideal, 
but the orginial designed db isn't designed to well. If we use a join 
we'll get a chasm trap (cartasian product), this is the reason why we 
can't use a join. I have been able to solve the problem sofar, by putting 
the results of both query's into two different array's and then itterate 
throught these array's to compare them. Then I put identical rows into a 
thirth array. This works, but I wonder if this is the fastest solution. So 
if anyone has a nicer solution, please sent it.

Thx

> You can't do a JOIN in your original query?

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <s.bussing@i...>
Subject: [access_asp] Joining recordsets


: I was wondering if anyone has an elegant solution to the following
: problem. I've two recordsets which are the results of a stored procedure.
: Now I have to combine those recordsets into one on basis of certain
: specified fields. My thought is to make to array's, each array containing
: the results of the recordsets. Then itterate through the array and 
compare
: each row with the row in the second array. If the fieldvalues for certain
: fields are the same then I put the result in a thirth array. But I think
: there is a better solution. Can anyone tell me?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #5 by "Mark Anderson" <marke.anderson@b...> on Wed, 19 Jun 2002 13:39:44 +0100
Access 2000 and previous versions as well have a default query that allows
you to compare and find duplicate records between two tables! use the wizard
to create the query in access and then tweak it to your requirements.


Mark Anderson
01202 775483
07802 404838 mob
Web Development and database design
mailto:mark@a...
http://www.anderson.uk.com

-----Original Message-----
From: s.bussing@i... [mailto:s.bussing@i...]
Sent: 19 June 2002 12:00
To: Access ASP
Subject: [access_asp] Re: Joining recordsets


Hi Ken,

No, in this case it's not possible to use a join. I know it's not ideal,
but the orginial designed db isn't designed to well. If we use a join
we'll get a chasm trap (cartasian product), this is the reason why we
can't use a join. I have been able to solve the problem sofar, by putting
the results of both query's into two different array's and then itterate
throught these array's to compare them. Then I put identical rows into a
thirth array. This works, but I wonder if this is the fastest solution. So
if anyone has a nicer solution, please sent it.

Thx

> You can't do a JOIN in your original query?

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <s.bussing@i...>
Subject: [access_asp] Joining recordsets


: I was wondering if anyone has an elegant solution to the following
: problem. I've two recordsets which are the results of a stored procedure.
: Now I have to combine those recordsets into one on basis of certain
: specified fields. My thought is to make to array's, each array containing
: the results of the recordsets. Then itterate through the array and
compare
: each row with the row in the second array. If the fieldvalues for certain
: fields are the same then I put the result in a thirth array. But I think
: there is a better solution. Can anyone tell me?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Message #6 by "Serge Wagemakers" <swagemakers@d...> on Wed, 19 Jun 2002 14:53:06 +0200
Hi,

One way to get around the carthesian product is to use a UNION or UNION ALL.
The columns in all queries, joined by the UNION or UNION ALL, must be of the
same datatype though...

Just a thought...

HTH,

Serge


----- Original Message -----
From: "Mark Anderson" <marke.anderson@b...>
To: "Access ASP" <access_asp@p...>
Sent: Wednesday, June 19, 2002 2:39 PM
Subject: [access_asp] Re: Joining recordsets


> Access 2000 and previous versions as well have a default query that allows
> you to compare and find duplicate records between two tables! use the
wizard
> to create the query in access and then tweak it to your requirements.
>
>
> Mark Anderson
> 01202 775483
> 07802 404838 mob
> Web Development and database design
> mailto:mark@a...
> http://www.anderson.uk.com
>
> -----Original Message-----
> From: s.bussing@i... [mailto:s.bussing@i...]
> Sent: 19 June 2002 12:00
> To: Access ASP
> Subject: [access_asp] Re: Joining recordsets
>
>
> Hi Ken,
>
> No, in this case it's not possible to use a join. I know it's not ideal,
> but the orginial designed db isn't designed to well. If we use a join
> we'll get a chasm trap (cartasian product), this is the reason why we
> can't use a join. I have been able to solve the problem sofar, by putting
> the results of both query's into two different array's and then itterate
> throught these array's to compare them. Then I put identical rows into a
> thirth array. This works, but I wonder if this is the fastest solution. So
> if anyone has a nicer solution, please sent it.
>
> Thx
>
> > You can't do a JOIN in your original query?
>
> Cheers
> Ken
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> From: <s.bussing@i...>
> Subject: [access_asp] Joining recordsets
>
>
> : I was wondering if anyone has an elegant solution to the following
> : problem. I've two recordsets which are the results of a stored
procedure.
> : Now I have to combine those recordsets into one on basis of certain
> : specified fields. My thought is to make to array's, each array
containing
> : the results of the recordsets. Then itterate through the array and
> compare
> : each row with the row in the second array. If the fieldvalues for
certain
> : fields are the same then I put the result in a thirth array. But I think
> : there is a better solution. Can anyone tell me?
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>

Message #7 by sathish kumar <sathish297@y...> on Fri, 21 Jun 2002 19:12:51 -0700 (PDT)
--0-1678374887-1024711971=:60109
Content-Type: text/plain; charset=us-ascii


 Hi ,
Could you be more clear?
 
  Ken Schaefer <ken@a...> wrote: You can't do a JOIN in your original query?

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: 
Subject: [access_asp] Joining recordsets


: I was wondering if anyone has an elegant solution to the following
: problem. I've two recordsets which are the results of a stored procedure.
: Now I have to combine those recordsets into one on basis of certain
: specified fields. My thought is to make to array's, each array containing
: the results of the recordsets. Then itterate through the array and compare
: each row with the row in the second array. If the fieldvalues for certain
: fields are the same then I put the result in a thirth array. But I think
: there is a better solution. Can anyone tell me?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




---------------------------------
Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup

  Return to Index