473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

denormalize data in a temporary table

hello group,

i want to denormalize data in a temporary table for a second
business-system which cant read related datas

what i have:
table Partner: (Id_Partner, NamePartner, ...)
table PartnerProduct: (Id_PartnerProduct, NamePartnerProduct, ...)
table Partner2PartnerProduct: (Id, Id_Partner, Id_PartnerProduct)

Partner to PartnerProduct ist n:m relation (thats why i need
Partner2PartnerProduct)

and the temporary table
TempPartner: (Id_Partner, NamePartnerProducts)
whereas NamePartnerProducts should contains a comma separated list of
the PartnerProduct-Names

what i need:
a trigger or combination of trigger and SP which
operate like the following:
if on Partner2PartnerProduct is a Insert or Update made, then Delete
the row in TempPartner which has the Id of the Partner, and then
create a new row which contains all n:m joined PartnerProduct-Names in
it.

i hope the intention and problem are clear.

thanx for answers,
hans
Jul 20 '05 #1
1 3553

"Hans Bampel" <we**********@gmx.de> wrote in message
news:73**************************@posting.google.c om...
hello group,

i want to denormalize data in a temporary table for a second
business-system which cant read related datas

what i have:
table Partner: (Id_Partner, NamePartner, ...)
table PartnerProduct: (Id_PartnerProduct, NamePartnerProduct, ...)
table Partner2PartnerProduct: (Id, Id_Partner, Id_PartnerProduct)

Partner to PartnerProduct ist n:m relation (thats why i need
Partner2PartnerProduct)

and the temporary table
TempPartner: (Id_Partner, NamePartnerProducts)
whereas NamePartnerProducts should contains a comma separated list of
the PartnerProduct-Names

what i need:
a trigger or combination of trigger and SP which
operate like the following:
if on Partner2PartnerProduct is a Insert or Update made, then Delete
the row in TempPartner which has the Id of the Partner, and then
create a new row which contains all n:m joined PartnerProduct-Names in
it.

i hope the intention and problem are clear.

thanx for answers,
hans


The usual answer is that you should handle this in a client tool, rather
than in the database itself. There are ways to do it, but the only really
reliable way is a cursor (and if you need the comma-separated list in an
order, it's probably the only way), and cursors are slow:

http://www.aspfaq.com/show.asp?id=2279

Simon
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Jarrod Morrison | last post by:
Hi All Im generally a vb programmer and am used to referencing multiple records returned from a query performed on an sql database and im trying to move some functions of my software into sql...
4
by: Josh | last post by:
I have a database design question and wanted to see if folks could lend some advice. For simplicity sake, I'll illustrate using a book (but the hierarchy is the same in the real application - just...
1
by: Roman Prigozhin | last post by:
Hi all, I have one stored procedure where I defined 3 temporary tables, which i return back to java. I want to have 3 separate sub procedures which would go after the data and fill out these...
1
by: Farina | last post by:
Hello, I have a table that contains contact names, their titles, and company_IDs that are used as the Primary Key. There are multiple contact names and titles per each company_ID. I need to have...
8
by: Steve Atkins | last post by:
I have an application where each user session opens and maintains a long-lived connection to the postgresql backend database. I need to keep a small amount of information (things like a unique...
34
by: Jeff | last post by:
For years I have been using VBA extensively for updating data to tables after processing. By this I mean if I had to do some intensive processing that resulted in data in temp tables, I would have...
4
by: crane.jake | last post by:
Hi, I'm trying to find the following information from the table found bellow. Year_Sales - # of sales that have occurred this year Year_Income - SUM(amount) Month_Sales - # of sales that have...
3
by: Chris | last post by:
All I am cross-posting, as I'm not sure if this is an issue for the data layer or the application layer. If this is unacceptable, can someone let me know so that I don't do this in future. ...
6
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.