473,406 Members | 2,745 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,406 software developers and data experts.

Update a table column with data from other table

1. I have three table
a. Relationship table(table A and Table b relationship)
b. Table A
c. Table B
2. Read each record in relationship table and search for combination of table A and table B data
3. Upon find the combination, update the attributes of table A with table B attribute.
May 27 '13 #1
3 3818
Rabbit
12,516 Expert Mod 8TB
What have you done so far?
May 27 '13 #2
I tried to use the following to update the matched records,

Expand|Select|Wrap|Line Numbers
  1. merge into table_A d
  2.  using (select a.toobjectnumber,a.fromobjectnumber,b.trobjectnumber,c.objectnumber,b.eexport_control from relationship_table a, table_A c , table_B b)alg
  3.     on (alg.toobjectnumber = alg.objectnumber AND alg.fromobjectnumber=alg.trobjectnumber)
  4.   when matched then
  5. update set d.export_control = alg.eexport_control;
Error report:
SQL Error: ORA-30926: unable to get a stable set of rows in the source tables
30926. 00000 - "unable to get a stable set of rows in the source tables"
*Cause: A stable set of rows could not be got because of large dml
activity or a non-deterministic where clause.
*Action: Remove any non-deterministic where clauses and reissue the dml.
May 28 '13 #3
Rabbit
12,516 Expert Mod 8TB
That phrase means that the the query inside the USING clause returns a non-unique set of rows. The returned rows can’t be matched uniquely against the target table in the ON clause. The ON clause is where the MERGE statment matches the source query’s rows against the target table’s rows.

On a possibly related note, it makes no sense that your ON clause is matching to fields solely within the source.
May 28 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: khalid sohail | last post by:
hi everybody, can anyone one help me how i can display colunm from other table in the datagrid actually i want to display the department name on the basis of department id in the employee...
3
by: Srireddy | last post by:
Hi all, I am trying to delete the data from only one column of a table. can any one help on this.......
3
by: Kam | last post by:
Hi all, I don't know if this is possible. I have a table which has a CreatedBy column, but this column can't be changed once it is set. Is there any way we can tell oracle not to allow update to...
0
by: venkatarao savadana | last post by:
Table A: tm,Mod, Dip Table B : Dip,annou,seg Table C : Dip, seg Table D: tm,Mod,annou Now i need to update A.Dip with B.Dip where A(tm,Mod) in D(tm,Mod) and B.annou=D.Annou . I am a new...
7
ak1dnar
by: ak1dnar | last post by:
There are two tables in my database 1. Table_A 2. Table_B Structure for Table_A A_ID - A_code(FK to B_ID) 1001 - Null 1002 - Null 1003 - Null
2
by: ssakhamuri | last post by:
hai guys, i want to update the date in a table like i just want to update the year of the of thie date in table for example if rows are like this, 2006-5-14 00:00:00,2005-4-14 00:00:00 then i...
0
by: cb123 | last post by:
Hello, Please bear with me I'm new to t-sql. I've had no luck trying to figure this out yet using sql code. I need to use an existing table (data dictionary) as input for creating a new table. ...
1
by: magikminox | last post by:
Hi Guys I have a table that contains codes for commodities.Some of the codes in this table have changed and some of them have not.So now i want to design a solution that enable me to map the new...
1
by: abinesh.agarwal | last post by:
Hi , I want to update the column in a table based on the updation of the other column in the same table, but not getting the desired result. DDL: CREATE TABLE .( NULL,
0
by: naveendb2dba | last post by:
while loading the PK COLUMN data into table I am getting the duplicate key in a table because of PK COLUMN having auto increment. My requirement is what ever data having the ORIGINAL TABLE that...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
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
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...
0
tracyyun
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...
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,...

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.