Trying to update 2 tables using right join (UPDATE Registrations RIGHT JOIN Registrations2)
I am trying to update [01-POs] from [01-POs1]
They both have the same fields and both have a primary field of [PO Number]
The code below does not work:
Update [01-POs] right join [01-POs1]
On Registrations.[01-POs].[PO Number] = [01-POs].[PO Number]
SET Registrations.TEXT_REGISTRANT_ID = Registrations2.TEXT_REGISTRANT_ID,Registrations.[Name] = Registrations2.[Name]
REF: https://social.msdn.microsoft.com/Forums/office/en-US/bea031e1-46cc-41b7-a8de-8c897c52019d/update-registrations-right-join-registrations2?forum=accessdev
That is the problem, I don't understand this code at all, but I know what I hope it will do.
I have one table that pulls from an oracle database the way I want it, then uploads to the live database. At this time I delete all records from the main table, then import all new records (10,000+ each time). This causes my database to grow
in size very quickly (I have 7 of these type of tables). My hope is that this will update the existing records, and append the new ones. Bonus would be if it will delete the ones that are no longer valid (no longer on the oracle pull).
[01-POs] is the main table that I want to pull from
[01-POs1] is the live table, that I want to sync to [01-POs]
[PO Number] is the key field (not auto number)
The rest of the fields are all the same and need to be updated
I hope this explanation helps.
Note: Registrations and Registrations2 are from the original code that I didn't know how I should change.
Similar Messages
-
Update table using merge or Update statement
Hi All,
We have oracle 10G R2 On windows...
We have tables BROK_DEALER_MAP and DTRMIS_REPORT.
create table BROK_DEALER_MAP
SL_NO NUMBER,
BROK_DLR_CODE VARCHAR2(30),
EMP_TAG VARCHAR2(30),
REMARKS VARCHAR2(60),
CONS_CODE VARCHAR2(30),
BROK_DLR_NAME VARCHAR2(50),
BROKER_TYPE VARCHAR2(30),
BROK_DLR_0 VARCHAR2(30),
CATG_DESC VARCHAR2(60),
Category VARCHAR2(30));
desc DTRMIS_REPORT
SL_NO
POSTED_DATE
ZONE
AMC_REGION
CITY
BROK_DLR_CODE
BROK_DLR_NAME
SUB_BROKER
B_TYPE
FOLIO_NO
INVESTOR_NAME
TAX_NO
INV_TAG
SCHEME_CODE
SCHEME_NAME
SCH_CLASS
TRXN_MODE
CHN_TAG
FP_COUNT
FP_AMOUNT
AP_COUNT
AP_AMOUNT
PUR_COUNT
PUR_AMOUNT
SIP_COUNT
SIP_AMOUNT
SI_COUNT
SI_AMOUNT
RED_COUNT
RED_AMOUNT
SO_COUNT
SO_AMOUNT
DR_COUNT
DR_AMOUNT
STP_COUNT
STP_AMOUNT
NET_SALES
DISTRIBUTOR_TYPE
SCHEME_TYPE
FOCUS_PRODUCT
RM_CODE
RM_NAMEtable BROK_DEALER_MAP doesn't have any duplicate records.
table DTRMIS_REPORT have more than 2 lacks duplicate records.
Now i want to update table DTRMIS_REPORT (DISTRIBUTOR_TYPY COLUMN) With the values of BROK_DEALER_MAP (CATEGORY COLUMN).
For that i have written merge statement like below
merge into dtrmis_report a
using brok_dealer_map b
on (a.brok_dlr_code=b.cons_code)
when matched then
update set a.Distributor_type=b.category
where a.brok_dlr_code=b.cons_code;IT's giving error saying ORA-30926: unable to get a stable set of rows in the source tables.
How to update the table.
Please help.Chanchal Wankhade wrote:
IT's giving error saying ORA-30926: unable to get a stable set of rows in the source tables.That means there are duplicate records in your source table.
Please post the output of the below
select cons_code
from brok_dealer_map
group by cons_code
having count(*) > 1;In case of duplicate CONS_CODE, you need to decide with which the target table should get updated
And are you seriously giving a where condition in merge like you posted..?
Edited by: jeneesh on Dec 19, 2012 9:56 AM -
Update table using analytic function
I have a table similar to this:
create table fred (test varchar2(50), seq_no number(18,0));
insert into fred (test) values ('A');
insert into fred (test) values ('A');
insert into fred (test) values ('A');
insert into fred (test) values ('B');
insert into fred (test) values ('C');
insert into fred (test) values ('D');
insert into fred (test) values ('D');
insert into fred (test) values ('D');
insert into fred (test) values ('D');
insert into fred (test) values ('E');
insert into fred (test) values ('E');
insert into fred (test) values ('E');I want a single insert statement that will update seq_no with a unique number for each value of test into seq_no
for example like this:
SQL 001> select test, row_number() over (partition by test order by test) from fred
2 /
TEST ROW_NUMBER()OVER(PARTITIONBYTESTORDERBYTEST)
A 1
A 2
A 3
B 1
C 1
D 1
D 2
D 3
D 4
E 1
E 2
E 3I'm certain this should be an easy thing but for the life of me I can't figure out how to do it in one statement. I should know this ... hangs head in shamewith update also you can
SQL> update fred
2 set seq_no = (select sno
3 from (select rowid rid, row_number() over (partition by test order by test) sno
4 from fred) fred1
5 where fred.rowid = fred1.rid)
6 /
12 rows updated.
SQL> select * from fred
2 /
TEST SEQ_NO
A 1
A 2
A 3
B 1
C 1
D 1
D 4
D 3
D 2
E 1
E 2
TEST SEQ_NO
E 3
12 rows selected.but merge is much faster -
Unable to update features using the NWDS Update Manager
I'm updating the NWDS and selecting the features to install from https://nwds.sap.com/swdc/downloads/updates/netweaver/nwds/ce/710
It hung midway while downloading:: plugins/com.sap.engine.clientapis_2.0.0.101103141034.jar (9928K of 10560K bytes)
I had to force kill the NWDS and when I restarted it and tried to update the features again, it doesn't try to download the clientapis jar that failed to download before. I don't find this jar in the eclipse\plugins folder either, so why does it skip this jar?
By the way, the features to install automatically listed were as below:
- https://nwds.sap.com/swdc/downloads/updates/netweaver/nwds/ce/710
- SAP NetWeaver Developer Studio CE 7.1 SP11 PAT000
- SAP Netweaver Developer Studio Java EE 8.0.110000.101103141042
- SAP Netweaver Developer Studio Development Infrastructure Client 8.0.110000.101103141042
- SAP Netweaver Developer Studio Web Dynpro User Interfaces 8.0.110000.101103141042
- SAP Netweaver Developer Studio Composition Tools 8.0.110000.101103141042
Now it gets repeatedly hung while downloading the jar file
plugins/com.sap.devmanual.doc.user_1.1....818085804.jar everytime I kill and restart and try to update.
The way I update is from the Help menu->Install/Update->Search for new features to install.
In the "Product Configuration" I see the below
- SAP NetWeaver Developer Studio
- E:\Program Files\SAP\IDE\CE\eclipse
- SAP NetWeaver Developer Studio Platform 8.0.110000.101103141042
-Eclipse Platform 3.3.0.v20070612-_19UEkLEzwdF0jSqQ-G
- Eclipse RCP 3.3.0.v20070607-8y8eE8NEbsN3X_fjWS8HPNG
- SAP NetWeaver Developer Studio Composition Environment 7.1.7.1.0.101103141042
Can someone please help understand what is happening and how to get the update manager working, before I get fired from my job for showing no productivity since 2 days? If it is a matter of the mirror being down, can you tell how I can choose a different mirror for a site in the Eclipse Update Manager?
Edited by: convicted on May 6, 2011 1:58 PM
Edited by: convicted on May 6, 2011 2:04 PMIs there any issue with connection to the network(internet) fromt he NWDS?
Usually, NWDS is unable to connect to network due to incorrect Network Connection parameters.
As a workaround, try to locate an existign installation of the NWDS with all the plugins. Ontain those files and save it in your NWDS folder.
Regards,
Sharath -
Trying to create table using Union All Clause with multiple Select stmts
The purpose of the query is to get the Substring from the value for eg.
if the value is *2 ASA* then it should come as ASA
where as if the value is *1.5 TST* the it sholud come as TST like wise for others too.
I am trying to execute the below written SQL stmt but getting error as:
*"ORA-00998 must name this expression with the column alias 00998.00000 - Must name this expression with the column alias"*
CREATE TABLE TEST_CARE AS
SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl
WHERE LENGTH(old_care_lvl) =5
UNION ALL
SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl
WHERE LENGTH(old_care_lvl) =7
UNION ALL
SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl
WHERE LENGTH(old_care_lvl) =14
UNION ALL
SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3),LEN FROM test_care_lvl
WHERE LENGTH(old_care_lvl) =7 AND old_care_lvl ='Regular'
I want to create the table using the above given multiple select using the Union ALL clause but when trying to create run the query getting error as "ORA-00998 must name this expression with the column alias 00998.00000 - Must name this expression with the column alias"
Please guide me how to approach to resolve this problem.
Thanks in advance.When you create a table using a SELECT statement the column names are derived from the SELECT list.
Your problem is that one of your columns is an expression that does not work as a column name SUBSTR(old_care_lvl,3)What you need to do is alias this expression and the CREATE will pick up the alias as the column name, like this:
CREATE TABLE TEST_CARE AS
SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3) column3, len FROM test_care_lvl
WHERE LENGTH(old_care_lvl) =5
UNION ALL
SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl
WHERE LENGTH(old_care_lvl) =7
UNION ALL
SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl
WHERE LENGTH(old_care_lvl) =14
UNION ALL
SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3),LEN FROM test_care_lvl
WHERE LENGTH(old_care_lvl) =7 AND old_care_lvl ='Regular'
);You may not like the name "column3" so use something appropriate. -
Reading Text file & Updating table using PL SQL Procedure
Guys, I am trying to read data from a large text file which
contains tab delimited data. Based on success of validations, I
have to insert/update data in to table(s). Does any one has any
sample procedure to read data (tab delimted/comma seperated)
from a text file and write to database table? Your help is
greatly appreciated!Is there any particular reason why you're not using SQL*Loader
for this? Otherwise you would seem to be re-inventing the wheel.
rgds, APC -
Updating Table using the data from a flat file
Hi,
I have a table called emp;
Name,
empno,
accountno,
amount.
This table is filled with values of name and empno.
The columns accountno and amount are empty.
I have a flat file created in some folder.
Contents of the flat file can be like this:
mani | 23 | 123 | 1000
spr | 22 | 342 | 2133
asjf | 54 | 432 | 2345
I need to access the file in the specified location, read all the records one after the other in the flat file and update the table "emp" with the values in the flat file.
Row after row all the records in the file should be updated to the table.
I found out some way to do this - its sqlloader - But it loads the data from a file to the table - i dont need that - i need to update the table.
Let me know how this can be solved ?????????
Thanks in advance.......Just to clarify Andrew's point, you can use external tables as the source table for an UPDATE statement. You cannot use them as a target for an UPDATE statement (i.e. you can't update the text file from an Oracle table).
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Error while trying to access table using DB Link
Hi All,
I had to access a table in another instance using a DB link. As there was no DB link, I was asked to create one and then access the table.
The below query was used to create DB link on my current instance FDEV:
CREATE PUBLIC DATABASE LINK to_link CONNECT TO apps IDENTIFIED BY appsdev USING 'ABCD';
The DB link gets created successfully and when I query select * from all_db_links on my current instance FDEV, I see the DB link name.
However, when I try to access the table, select * from x_stg@to_link on my current instance FDEV, this is resulting in an error as shown below:
ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from TO_LINK
The TNS entry looks something like this:
ABCD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = abc.xx.com)(PORT = 1234))
(ADDRESS = (PROTOCOL = TCP)(HOST = abc.xyz.com)(PORT = 1234))
(CONNECT_DATA =
(SID = ABCD)
Can someone help me in this regard?
Thanks in Advance!!
Regards,
ABYou are trying to get 2 databases connected... so, you need to insure that FDEV can find and connect to ABCD.
So, from your FDEV database server, you can do 2 things (from command prompt):
1* tnsping ABCD (this will validate that the entry exists in your tnsnames.ora on your FDEV server, and that a valid listener can be found on remote server)
when above command succeeds:
2* sqlplus apps/appsdev@ABCD;
when you have established the connection, then you are SURE that your can connect ABCD database from FDEV database server. It will also validate the username / password combination, create session privilige, account not locked, etc.....
Please check the above, and post here the results.
HTH,
Thierry -
Getting Error while trying to create table using entity beans
This is the output on console.
javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; neste
d exception is: javax.ejb.EJBException: nested exception is: java.sql.SQLExcepti
on: [Oracle][ODBC][Ora]ORA-00942: table or view does not exist
javax.ejb.EJBException: nested exception is: java.sql.SQLException: [Oracle][ODB
C][Ora]ORA-00942: table or view does not exist
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-00942: table or view does not exis
t
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7036)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3104)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedState
ment.java:214)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(JdbcOdbcPrepared
Statement.java:89)
at com.sun.ejb.persistence.PersistenceManagerImpl.primaryKeyExists(Persi
stenceManagerImpl.java:289)
at com.sun.ejb.persistence.PartitionImpl.afterEjbCreate(PartitionImpl.ja
va:640)
at CallerBean_PM.ejbCreate(CallerBean_PM.java:96)This is the output on console.
javax.ejb.TransactionRolledbackLocalException:
Exception thrown from bean; neste
d exception is: javax.ejb.EJBException: nested
exception is: java.sql.SQLExcepti
on: [Oracle][ODBC][Ora]ORA-00942: table or view does
not exist
javax.ejb.EJBException: nested exception is:Look at what the bolded text is telling you. This could be because:
1. The table/view actually does not exist in the oracle instance that you've connected to
2. OR, the user id that you used to connect to the db does not have the right permissions granted to it. -
Error when trying to create tables using "asant create-db_common"
Hi,
I'm attempting to run asant create-db_common to use a .sql file to create a table in Pointbase. However I keep getting this error:
Buildfile: build.xml
init:
create-db_common:
[java] java.lang.NoClassDefFoundError: com/pointbase/tools/toolsCommander
[java] Exception in thread "main"
BUILD SUCCESSFUL
Total time: 1 secondWhich means I need to include the classpath, I presume! But I don't know what file to add it to or where to begin.
Can anyone help?
Thanks.Still haven't solved this problem.
Can anyone guide me at all?
Many thanks. -
Unable to insert the record to table using pre-insert & pre-update trigger
Hi All,
I have tried to insert and update the backend table using the pre-update and pre-insert triggers. But its not working for me. Please find below the code which i have used in the triggers.
Pre-insert trigger:
DECLARE
v_cust_num_cnt NUMBER;
BEGIN
SELECT COUNT(customer_number)
INTO v_cust_num_cnt
FROM cmw_bc_mobile_number
WHERE substr(customer_number,1,15)=substr(:BLOCKNAME.CUSTOMER_NUMBER,1,15);
IF v_cust_num_cnt = 0 THEN
INSERT INTO cmw_bc_mobile_number (CUSTOMER_NUMBER
,MOBILE_NUMBER
,CREATION_DATE
VALUES
(substr(:BLOCKNAME.CUSTOMER_NUMBER,1,15)
,:BLOCKNAME.MOBILE_NUMBER
,SYSDATE
COMMIT;
END IF;
END;
PRE_UPDATE TRIGGER:
BEGIN
IF :SYSTEM.RECORD_STATUS = 'CHANGED' THEN
UPDATE apps.cmw_bc_mobile_number
SET mobile_number = :BLOCKNAME.MOBILE_NUMBER,
creation_date = SYSDATE
WHERE customer_number=substr(:BLOCKNAME.CUSTOMER_NUMBER,1,15);
COMMIT;
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
Please let someone assist in gettting it resolved.
Regards,
Raj.Just use MESSAGE (we don't know what fnd_message is, that is some custom code):
message('v_cust_num_cnt='||v_cust_num_cnt);
IF v_cust_num_cnt = 0 THEN
message('Now inserting...');
INSERT INTO cmw_bc_mobile_number (CUSTOMER_NUMBER...
else
message('Nothing to insert');
end if; -
Use of update table in Unserialised V3?
HI Pioneers,
Can any one let me know the advantage of Update table in Unserialised V3 update mode?
Thanks,Jameshi,
Update table is to store the posted records(V3 update), so the the collective run can pick uprecords from there.
Unserialized V3 update is not used now a days.
Only queued Delta is used
Regards,
Ramesh -
Hi,
I am using oracle 11g db.
Trying to update one of my table using following query :
UPDATE EMPLOYEE_HISTORY_ALL_T TMDC
SET LAST_UPDATE_DATE = '01-apr-1901'
WHERE EXISTS
(SELECT 1
FROM PROJECT_T TMP
WHERE TMP.PROJECT_ID = TMDC.PROJECT_ID
AND NVL(TMP.COL_CHG_DATE, TO_DATE('01-apr-1901', 'dd-mon-yyyy')) >= '01-apr-1901')
AND FIRST_PROCESS_DATE >= '01-apr-1901';
Error comes like "Table or view doesn't exist". Table is in the same schema in which I am trying this update stmt.
Also when I do Select * from this table data is coming.
In the all_objects I can see there is public synonym also with the same name. I think while updating it is refering to that synonym instead of table , so error is coming.
please tell me how can I refer to table in this case and not the synonym.For table EMPLOYEE_HISTORY_ALL_T
OWNER OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS TEMPORARY GENERATED SECONDARY NAMESPACE EDITION_NAME
PUBLIC EMPLOYEE_HISTORY_ALL_T 726992 SYNONYM 11/15/2011 6:17:37 PM 11/15/2011 6:17:37 PM 2011-11-15:18:17:37 VALID N N N 1
MIS EMPLOYEE_HISTORY_ALL_T 726988 1752101 TABLE 2/23/2007 10:18:18 PM 11/15/2011 6:19:44 PM 2011-11-15:18:19:44 VALID N N N 1
For table PROJECT_T
OWNER OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS TEMPORARY GENERATED SECONDARY NAMESPACE EDITION_NAME
PUBLIC PROJECT_T 35158 SYNONYM 3/1/2006 3:33:23 PM 11/14/2009 4:00:21 PM 2009-11-14:16:00:21 VALID N N N 1
BSC PROJECT_T 35250 SYNONYM 2/25/2006 3:49:46 AM 11/15/2009 1:15:35 PM 2009-11-15:13:15:35 VALID N N N 1
CDWSTG PROJECT_T 37350 SYNONYM 2/25/2006 5:32:32 AM 11/15/2009 11:01:34 AM 2009-11-15:11:01:34 VALID N N N 1
CDWPROD PROJECT_T 40102 SYNONYM 2/25/2006 11:46:03 AM 1/1/2010 3:42:17 PM 2010-01-01:15:42:17 VALID N N N 1
MIS PROJECT_T 810675 7360542 TABLE 4/2/2007 3:30:07 PM 11/11/2011 5:23:55 PM 2009-11-14:15:28:15 VALID N N N 1
DEL25PROD PROJECT_T 645792 1237989 TABLE 1/9/2007 6:28:08 PM 9/6/2009 8:18:13 PM 2007-01-09:18:28:08 VALID N N N 1
DELSTG PROJECT_T 1271755 SYNONYM 11/1/2007 1:54:32 PM 1/1/2010 3:42:17 PM 2010-01-01:15:42:17 VALID N N N 1
I am logging through MIS schema. In this schema only I am running the update query. -
Hi,
What is the difference between the setup table and update table? Kindly clarify.
I really appreciate all your help. Thanks.
Regards,
Jon.Hi
<b>Update Tables :</b>
Update tables are the intermediate tables which store data read from document tables. The V3 runs collects deltas in form of LUWs from these update tables and populates the delta queues.
Update tables are use in V3 update scenario . It acts as staging before loading the delta queue . You can thought it as buffer , it continously refreshed , each time the v3 update takes place .Update table is used when u r loading the data through V3 update method . In this scenario it acts as a buffer between the r/3 and delta queue .. Everytime the v3 update takes place this tableis continuously refreshed ...
Document tables are the actual application tables where the data is posted when you post a document in R/3.
Examples can be MSEG, VBRK etc.
Document tables MKPF/MSEG
Update tables - VBHDR then V3 Update . -
I have problem updating table using OCI. Would anyone provide a sample c program using OCI to update a tbale?
Thanks,
LuckThe $OH/rdbms/demo directory contains many sample OCI programs that perform SQL updates.
-
How to update table
i have to update one column in a table
it has the value 'E' , i have to update that value to 'L'
it has 300,000 rows.
what is the syntax for that
Thanks in advanceHello
If the column just contains a single character, use...
UPDATE
table
SET
column = 'L'
WHERE
column = 'E';
Maybe you are looking for
-
How to calculate the OPEN QUANTITY in delivery Duelist Report
Hi Everybody, I have a query for finding out the OPEN QUANTITY for schedulines for a delivery. If for example the report is run for 2nd of February, it is necessary to determine whether there are delivery relevant schedule lines before the 2nd. If
-
PPR error with sql with where clause
dear pakar, why my PPR report error using this query Select process_id, to_char(start_date, 'Dy DD-Mon-YYYY HH24:MI:SS') start_date, to_char(finish_date, 'Dy DD-Mon-YYYY HH24:MI:SS') finish_date, to_char(sysdate, 'Dy DD-Mon-YYYY HH24:MI:SS') timestam
-
When I'm working on my laptop downstairs (or at a local coffeeshop, or when traveling), I'd love to be able to grab files that are on my iMac back home. (without relying on using Dropbox or similar...) Thanks!
-
Report from multiple tables - two tired
Hi, I am trying to create a report with data coming from two tables in Apex, similar to one with a header record followed by detail records. The output would be similar to the output that would be generated from the statement below. Do you know if th
-
How do I join up my small video clips?in simple terms please!
HOw do I join up my small video clips? In simple terms please!