Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you join two client datasets?

Status
Not open for further replies.

jimtci

Programmer
Oct 16, 2002
4
US
Can you join two client datasets? I would like to keep this in memory instead of creating a temp database table.
 
What language/platform are you using?
What database?

Do you want to combine data on the client, or data coming from a database that will be stored on the client?

D
 
What language/platform are you using? Delphi/Win2000
What database? MS SQL

I have two client datasets that are each the result of a multiple table query. I want to create a third client dataset that is a combined query using parts from each of the previous two.
 
As this is the object-oriented analysis and design forum, you might just encapsulate the two datasets in a collection and generate the third one from that collection ;-)
 
Another option would be:

Create a view on sql server that is the third look that you want (the combination of the two original datasets), then run your queries for the two seperate datasets from that view.

D
 
Don, I'm still a little green with OOP so encapsulating the two datasets in a collection and generating the third one from that collection, is easier said than done. Most of my experience is from Procedural Programming using Pascal. I've only been coding in Delphi using OOP for about 6 mo.

JFrost, when you say create a view on SQL Server, are you saying to make a temp table on SQL? That is what I am trying to avoid. If possible I want to do this without writting to the database and then running another query.

Thanks
 
No, not a temp table, but a VIEW.

A view is a custom table that holds data based on a query, but its not temp, its permanent, and it also continually updates itself as data is changed within the original tables.

The idea is that your data lives at the table layer, but for certain things (like reports for instance), it may be easier to get the data from a View.

i.e. instead of having multiple sessions running a query like
Select a.ID, a.Name, b.OtherID, b.Name
From sometable a RightJoin othertable b
Where a.OtherID = b.OtherID

you could just run the query off of the view like this:
Select * From someview
Where ID = @SomeNumber

Think of it as another layer above the database tables themselves: the tables hold the raw data, a view can hold a cusomized look of that data, which can have queries run against it.

D
 
Sounds interesting. I'll check with our other programers and architects to see if we are or can doing anything like that. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top