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_PartnerProd uct, NamePartnerProd uct, ...)
table Partner2Partner Product: (Id, Id_Partner, Id_PartnerProdu ct)
Partner to PartnerProduct ist n:m relation (thats why i need
Partner2Partner Product)
and the temporary table
TempPartner: (Id_Partner, NamePartnerProd ucts)
whereas NamePartnerProd ucts 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 Partner2Partner Product 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 1 3573
"Hans Bampel" <we**********@g mx.de> wrote in message
news:73******** *************** ***@posting.goo gle.com... 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_PartnerProd uct, NamePartnerProd uct, ...) table Partner2Partner Product: (Id, Id_Partner, Id_PartnerProdu ct)
Partner to PartnerProduct ist n:m relation (thats why i need Partner2Partner Product)
and the temporary table TempPartner: (Id_Partner, NamePartnerProd ucts) whereas NamePartnerProd ucts 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 Partner2Partner Product 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 stored procedures. So far ive been
able to move the functions relatively easily but im unsure about how to
output multiple values from an sql stored procedure. By this i mean for
example one of the stored procedures may take your username and return...
|
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 with extra fields).
A book has a title has chapters.
A chapter has a title and has pages.
A page has a title has pictures.
A picture has a title.
My application will show a book, a chapter, a page, or a picture at any
|
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 temporary tables.
Question: Is it possible to
a) Pass a pointer to the temporary table from one procedure and have
it filled out in the other procedure, then return controll to the
caller ?
|
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 them all
listed on one row per company_id. Right now it looks like this:
Company_ID Person Title
12345 Bob Smith VP
12345 Pam Rollins President
|
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
session identifier, the application - as opposed to database - username
and so on) that is local to each database session. It needs to be
visible from within plpgsql trigger functions and will be used
on a large fraction of updates.
I can see a...
| |
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 VBA code that wrote the
results of that away to the db, either creating new records or updating
existing records, whichever was relevant. This may also include deleting
records.
Now I generally do this by opening a recordset on the source data...
|
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 occurred this month
Month_Income - SUM(amount)
Today_Sales -- # of sales that have occurred today
Today_Icome - SUM(amount)
|
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.
I'm using ASP .NET, framework version 1 and SQL Server 2000.
I have an ASPX page with a form for customers to register. When they click
on the "Proceed" button, they are shown a preview page of the data that they
|
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)
Constraint pk_table1 Primary Key,
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |