473,789 Members | 2,925 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to update txn table into master table ?

Hi all,

I am using DB2 in AIX.

I have a master table
and a txn table.

The master table has many many records.
Each month, there is a new txn table.

I have to update a column of a txn table into the master table.

Is there any simply SQL can do so ?

Seems that DB2 cannot use inner join to update a txn table into the
master table.
Alvin SIU

May 14 '07 #1
3 2120
Create TRIGGER on Transaction Table.

May 14 '07 #2
Alvin SIU wrote:
Hi all,

I am using DB2 in AIX.

I have a master table
and a txn table.

The master table has many many records.
Each month, there is a new txn table.

I have to update a column of a txn table into the master table.

Is there any simply SQL can do so ?

Seems that DB2 cannot use inner join to update a txn table into the
master table.
MERGE INTO master USING txn
ON master.pk = txn.pk
WHEN MATCHED THEN UPDATE SET c1 = txn.c1, c2 = txn.c2

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
May 14 '07 #3
Hi Serge Rielau,

It works.
Many thanks.

Cheers.
Alvin SIU

May 15 '07 #4

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

Similar topics

2
8425
by: PawelR | last post by:
Hello Group, In my apps I fill DataSet from MSAcces (file db1.mdb) oleDbDataAdapter1.Fill(fromAccessDS,"MyTable") MyTable heve 4 columns, I change in dataGrid (dataGrid.DataSource=fromAccessDS.Tables) value in this table. My question: How update Table in file db1.mdb), save my change in this table?
4
7651
by: Igor Kryltsov | last post by:
Hi, If you can help me to correct my mistake. To simplify my question: I have table: create table test ( name varchar(10),
3
3545
by: jpr | last post by:
Hello, I know that this is not the rule but need some help. My datbase has three tables: MASTER TEMPLATES FORMS I have a form which is based on a table named MASTER. I have a primary key set to autonumber and a field SSN which I would
3
2340
by: Roy | last post by:
Hi Access gurus, I have a A2K application.The data in the database is updated daily by a excel download.I have a master n related tables keyed in by a OrderID.I have a problem in updating data.If it is a one to one update,i face no problem as I update every fields.But let's say if there is a master record with ID and three corresponding related entries for this on day 1.But on the next day,there was a change on related records 2 & 3 but...
3
2823
by: hharriel | last post by:
Hi All, I have created an update query related to high school course information (name of course; credit hour; course description, etc.) I am updating a master course information table. I am updating two fields in the master table; course name and credit hour. When I run a test, the course name updates fine. However, I have three different values that can be in the credit hour files: .05, 1, and 2 (also there are some records that don't...
9
4397
by: P3Eddie | last post by:
Hello all! I don't know if this can even be done, but I'm sure you will either help or suggest another avenue to accomplish the same. My problem may be a simple find duplicates / do something with only one of the duplicates issue, but I got to the point where an update query with a nested select subquery would work wonderfully, if only it would work! I have several fields in a master Access 2000 table, some of which are id, fname,...
2
3013
by: Kevin | last post by:
I am having difficulty updating a variable page-time-stamp in the following snippit. The variable time-stamp is initialized from the attribute time-stamp from the log element. Some of the page elements (children of log) in my XML source have a time-stamp attribute, so I want to use the time-stamp from the page for the page-time-stamp value. I use an xsl:choose/xsl:when/xsl:otherwise combination to setup an if/else statement to select the...
2
3067
by: Presto | last post by:
I am making a front end mdb so users can enter new members data. I can then import this into the master database on the backend and erase the existing info on the front end to keep the data reasonably secure. ( I borrowed the code from http://www.databasedev.co.uk/unbound-forms-add-data.html example) I have 4 tables that will be updated from this form: Members ContactInfo Payments
1
1152
by: Sharma Neha | last post by:
I hav a problem in sql query.I m using C#.net and working on window form,Database is SqlSever. There is a table tracking which has key_no,status as its field. There is another table master which has slno,key_no,etc as its field. In my form i hav a textbox in which one enters slno,so using this slno i want to get key_no from master table using Select query and then use this key_no to update the status in tracking table. I have used the...
0
9666
marktang
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...
0
10410
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, 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...
0
9020
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
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
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.