Update woes in Oracle 8.1.6.3.0

I'm trying to update one column in table A with a new value that lives in table B.
Both tables share the same primary keys but table B has considerably less rows (about 1000 rows) than the million rows that exist in Table A.
I tried this:
UPDATE TABLE_A A
SET a.COLUMN_TO_UPDATE= (SELECT b.COLUMN_TO_UPDATE
          FROM TABLE_B B
          WHERE a.KEY1=b.KEY1
AND a.KEY2=b.KEY2
AND a.KEY3=b.KEY3
AND a.KEY4=b.KEY4
     AND b.FLAG='A')
After I ran it, I realized it would probably update the entire table, it did. :(
What's the most efficient way to run this update?
Are there any threads that already identify the correct syntax for this situation?
Best Regards,
SETH

A simple solution is...
UPDATE table_a a
   SET a.column_to_update =
         (SELECT b.column_to_update
            FROM table_b b
           WHERE a.key1 = b.key1
             AND a.key2 = b.key2
             AND a.key3 = b.key3
             AND a.key4 = b.key4
             AND b.flag = 'A')
WHERE EXISTS
         (SELECT b.column_to_update
            FROM table_b b
           WHERE a.key1 = b.key1
             AND a.key2 = b.key2
             AND a.key3 = b.key3
             AND a.key4 = b.key4
             AND b.flag = 'A');

Similar Messages

  • Not able to see ikm oracle incremental update and ikm oracle slowly changing dimensions under PHYSCIAL tab in odi 12c

    not able to see ikm oracle incremental update and ikm oracle slowly changing dimensions under PHYSCIAL tab in odi 12c
    But i'm able to see other IKM's please help me, how can i see them

    Nope, It has not been altered.
    COMPONENT NAME: LKM Oracle to Oracle (datapump)
    COMPONENT VERSION: 11.1.2.3
    AUTHOR: Oracle
    COMPATIBILITY: ODI 11.1.2 and above
    Description:
    - Loading Knowledge Module
    - Loads data from an Oracle Server to an Oracle Server using external tables in the datapump format.
    - This module is recommended when developing interfaces between two Oracle servers when DBLINK is not an option.
    - An External table definition is created on the source and target servers.
    - When using this module on a journalized source table, the Journaling table is first updated to flag the records consumed and then cleaned from these records at the end of the interface.

  • Difference in select for update of - in Oracle Database 10g and 11g

    Hi, I found out that Oracle Database 10g and 11g treat the following PL/SQL block differently (I am using scott schema for convenience):
    DECLARE
      v_ename bonus.ename%TYPE;
    BEGIN
      SELECT b.ename
        INTO v_ename
        FROM bonus b
        JOIN emp e ON b.ename = e.ename
        JOIN dept d ON d.deptno = e.deptno
       WHERE b.ename = 'Scott'
         FOR UPDATE OF b.ename;
    END;
    /While in 10g (10.2) this code ends successfully (well NO_DATA_FOUND exception is raised but that is expected), in 11g (11.2) it raises exception "column ambiguously defined". And that is definitely not expected. It seems like it does not take into account table alias because I found out that when I change the column in FOR UPDATE OF e.empno (also does not work) to e.mgr (which is unique) it starts working. So is this some error in 11g? Any thoughts?
    Edited by: Libor Nenadál on 29.4.2010 21:46
    It seems that my question was answered here - http://stackoverflow.com/questions/2736426/difference-in-select-for-update-of-in-oracle-database-10g-and-11g

    The behaviour seems like it really is a bug and can be avoided using non-ANSI syntax. (It makes me wonder why Oracle maintains two query languages while dumb me thinks that this is just a preprocessor matter and query engine could be the same).

  • Which is better: Oracle incremental update (merge) or Oracle incremental update

    Hi All,
    We have big data load happening from Oracle RDBMS(source) to Oracle RDBMS(target). The data is huge (in billions) and new insertions, updates will happen. I would like to understand which among
    Oracle incremental update (merge) or Oracle incremental update is better and faster -  for first load and subsequent incremental updates, deletes? I request you all to provide valid reasons since I need to present the same to my client
    If at all Oracle incremental update (merge) is better, then why ODI needs to have Oracle incremental update IKM.
    I have seen some discussions on the same topic but I have not yet got a proper response with reasons and that is why I am posting the question again
    Thanks & Regards,
    Sijee Sadasivan

    Hi Sijee Sadasivan,
    IKM SQL Control Append could be faster for the initial load. You will therefore need another interface for the initial load.
    From my experience IKM Oracle Incremental Update (Merge) is faster than IKM Oracle Incremental Update for the incremental load, but I think the best thing to do is to try it on your environment. Nothing is better than a benchmark .
    IKM Oracle Incremental Update is useful for Oracle RDBMS < 9i, before this syntax was introduced.
    Regards,
    JeromeFr

  • Writing an update statement in oracle forms 9i

    Hi ,
    I have a problem situation in which
    I am fetching values from a cursor and a recod group into two data block items text box and combo box respectively .
    Both the data is fetched from different tables .
    Now based on the selection from combo box I have to update the selected value in another table by writing an update statemet .
    I have created a button and on the trigger event of when button pressed I wrote a simple update statement but it's not working that way .
    Kindly help me how to write manual update statements in oracle forms 9i
    I can't used the update buil in of forms as I want to update in a table which is not mentioned in the property pallete of data block
    please help

    I just wrote a procedure
    PROCEDURE update_current IS
    BEGIN
    update table abc set xculumn= :block_name.item_name2 where ycolumn = :block_name.item_name1 ;
    commit;
    and I called the procedure from a when button pressed trigger
    it gave an error invalid identifier abc ( which is table name)
    pls help
    I am trying to do it with form_ddl(update_query)
    but here I am facing another problem
    I have update_query = 'update table abc set xculumn= ' || :block_name.item_name2 || 'where ycolumn = '||:block_name.item_name1
    now since xculumn and y column are varchar type so I suppose while preparing the query I have to concatenate single quotes ( ' ) at the start and end
    but i am facing problems in doing so
    please tell me an alternative way or how to concatenate single quotes in the above update_query variable

  • How to update column in Oracle SQL Developer?

    Hi everybody,
    How can I update table in Oracle SQL Developer like in PL/SQL Developer use:
    Select * from table for update;
    Thank you~

    Do you mean you want to edit the result grid?
    You can't edit the result grid of a query, but you can edit the data tab of a table.
    Click on the table in the object browser
    Click on the data tab
    Optionally filter the results using the filter field at the top
    Type into the data cells.
    Click on the commit button

  • To update my remote oracle server through e mail

    hai,
    i want to update my remote oracle server through e mail which should run automatically for every 3 hours(for example)
    both(remote and local) are oracle 8.1.7 running in windows 2000 server
    Please let me know how to go about....
    help me in this context...
    urs
    srini

    Sri
    you can do with some SMTP programming like that one available in VisuaBasic. you can read the mail from an inbox
    from a mail account of an SMTP SERVER. Then you may try to update the remote database.
    Well i have mentioned VB as i heard it long back from my GURUJI that it is possible thru SMTP programming in VB
    using the socket controls etc,.
    Please check it out in some visuabasic forum sites and ask some VB Gurus.
    Thanks
    Prakash
    [email protected]

  • Using eclipse Web services to retrieve and update data to Oracle DB

    Hi,
    Can I have a sample about to use eclipse to retrieve/update data from Oracle DB by using axis web services?
    thank you

    Hi,
    If you have a sheet in Excel with data from a SharePoint Online list you can switch to the PowerPivot ribbon and ask to add it to the model. This will allow you to reference this table when you create a PowerView report.
    This workbook, with the Odata feed can then be refreshed via the scheduled refresh feature of Power BI Site.
    Insert the data using the Odata feed
    The Odata URL will be something like:
    https://MyCompany.sharepoint.com/MySite/MySubSite/_vti_bin/listdata.svc/MyList
    If you are not sure what is the list name, you can drop just browse to
    https://MyCompany.sharepoint.com/MySite/MySubSite/_vti_bin/listdata.svc and this will provide a list of all the lists in that site/sub-site.
    Once you have those in the model and you setup scheduled refresh, it will refresh the lists directly from SPO (using the owner identity)
    Hope this helps.
    Guy
    GALROY

  • Problem installing Oracle Linux Release 5 Update 2 from Oracle e-Delivery

    Hello
    I have been trying to install Oracle Linux Release 5 Update 2 from Oracle e-Delivery so that I can install Oracle 11g express edition beta.
    Here are the steps that I took and the problem that I am having:
    1. I downloaded the file, unzipped the file twice, which gave me 3,042 files and 13 folders with the total size = 3.07 GB.
    2. I put in the DVD and restarted my PC hoping that my PC will boot from the DVD, but instead Window started.
    I reported this issue to tech support from e-Delivery, but they referred me to contact you. Please assist.
    Julia

    3,042 files and 13 folders with the total size = 3.07 GBWhich download .zip did you choose from edelivery? Under linux-x64 I peeked "Oracle Linux Release 5 Update 2 for x86_64 (64 Bit) - DVD" file V15099-01.zip downloaded, it has just the one .iso file. You'll need to burn that to DVD, but with burn s/w that handles ISO files.
    Also keep in mind you'll need 64 bit hardware (amd/intel 64? itanium? those are different), the only *nix platform I've got handy to try it out is -x86 :(                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Oracle VM Manager 3.1.1: Applying Updates/Patches to Oracle VM Servers?

    I've added the OVM 3.1.1 update repositories and the Oracle RPM-GPG key to OVMM...
    Tools and Resources -> Server Update Management...but when viewing the status of the OVM 3.1.1 servers in "MyPool":
    Servers and VM's -> Server Pools -> MyPool -> MyServer...OVMM 3.1.1 indicates that the server is up-to-date even though there are ~500 packages in the repository!
    Have I missed a step?
    Eric Pretorious
    Truckee, CA
    http://public-yum.oracle.com/repo/OracleVM/OVM3/latest/x86_64/
    http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5

    From the Oracle VM User's Guide for Release 3.1.1:
    Chapter 6.9.11, Updating and Upgrading Oracle VM Servers
    When an Oracle VM Server update is available, an event is posted to the Oracle VM Server and displayed in the Update Required column in the Servers perspective in the management pane. The YUM repository is checked for updates every 6 hours, so there may be a delay between the YUM repository being updated and the notification being displayed in Oracle VM Manager.
    Eric Pretorious
    Truckee, CA
    REFERENCE
    http://docs.oracle.com/cd/E27300_01/E27309/html/vmusg-servers-manage.html#vmusg-servers-yum

  • Oracle Linux Patching/Updates Impact on Oracle Database

    I have several questions regarding Oracle Linux patching and its impact on Oracle Database.
    3 node Cluster
    Operating System: Oracle Linux Release 5 update 2
    Kernel: 2.6.18-92.1.22.0.1.el5 x86_64 GNU/Linux
    Grid Infrastructure: Oracle Grid Infrastructure 11g Release 2 (11.2.0.2)
    Database: Oracle Database 11g Release 2 Enterprise Edition (11.2.0.2) with RAC option
    ASM with ASMLib is being used for Data and FRA.
    *1)* Given your at Oracle Linux Release 5 update 2, will applying only Security Patches require any changes to ASMLib, Oracle Grid Infrastructure and/or Oracle Database (software binaries, configuration etc.)?
    *2)* Given your at Oracle Linux Release 5 update 2, will applying Bug Fixes and Security Patches to Oracle Linux 5 update 2 require any changes to ASMLib, Oracle Grid Infrastructure and/or Oracle Database (software binaries, configuration etc.)?
    *3)* Given your updating from Oracle Linux Release 5 update 2 to Oracle Linux Release 5 update 8, will this require any changes to ASMLib, Oracle Grid Infrastructure and/or Oracle Database (software binaries, configuration etc.)?
    I would most whole heartedly appreciate if someone could answer the specific questions asked, inline if possible. Our System Administrator is preparing to perform some patching and as the DBA I'd like to be certain what changes I need to prepare for? I also have a single instance database setup with Oracle Restart. I don't know if this impacts the answers above.
    Thanks in advance.

    How do you plan to apply Oracle Linux security patches? As far as I'm aware the yum security plug-in does not work with the Oracle public yum repository and there is no really feasible way to automate and determine security related patches only, unless you setup Oracle Enterprise Manager Grid Control (11g) or Cloud (12c)  and have a subscription to Oracle ULN.
    If you upgrade your Oracle Linux to the latest available version using the public yum repository, all patches, including errata will be applied. You cannot apply patches and stay on a specific release version unless you have a subscription and appropriate yum repository access.
    As far as I'm aware there are no changes required to your Oracle database or ASM setup and configuration when updating the OS, provided the version of the Oracle database is supported for the specific OS version (ASM features like ADVM/ACFS are kernel version depending). Upgrading from one major release to another, such as upgrading Oracle Linux 5 to Oracle Linux 6 is not supported and will require upgrading the Oracle Database to 11.2.0.3. You can check the Oracle database certification matrix to determine which Oracle database release version is required for which OS version http://docs.oracle.com/cd/E11882_01/relnotes.112/e23558/toc.htm
    The relinking of Oracle Database binaries is a common practice when updating the OS. I do not think it is necessary under Linux. Oracle binaries are typically standalone applications, or use Oracle provided libraries, or in some cases use OS shared libraries, which does not require relinking of Oracle binaries. Upgrading the Oracle database software of course requires relinking.
    Edited by: Dude on Dec 4, 2012 2:09 PM

  • Data updation  b/w oracle 9i and oracle 11 g R2

    hi all.
    I have a master database in oracle 9i. Another clone database in oracle 11 g R2 (with an oracle apex application on it) is running on separate servers. I need to refresh data from master database (in 9i) in to Oracle 11 gR2 but my requirement is i need to update tables. how can i go by this?

    using database link u can access tables,views etc.., in another database.
    use can also perform any kind of operations like ( select, delete, update etc..) on a remote database.
    write the following in the database where u need to connect with remote database !!
    CREATE DATABASE LINK link1 CONNECT TO remote_user_name IDENTIFIED BY remote_user_password using 'orcl'
    note : orcl = sid
    now,
    select * from tablespace_name.table_name@ link1;
    note :
    tablespace_name.table_name : is a remote database table and it is identified by its tablespace.
    a similar operation can be performed for updation !!
    regards,
    razz

  • Query Updation recovery in Oracle

    Is there any way I can track changes made to the database timewise.
    I modified a column value from front end by mistake. It actually toggles the column value in the table from 'Y' to 'N' or vice versa upon clicking it. Im not sure how many times I toggled.
    I do see the value in the database with a modification timestamp which is captured in the same table with my userid.
    I want to revert back the particular column value with original data. Is the updation values done in oracle database stored somewhere timewise?
    Please let me know.

    Thanks for the reply!!!
    I tried DBLogminer in my test database by following the below url
    http://www.oracle.com/technology/oramag/oracle/05-jul/o45dba.html
    and Im able to see the past transactions...
    I believe as per help docs the moment I end the session the turning on DBLogminer goes off...
    What overhead it has on the database when turned on... Since we are kind of loading huge files from hard disk , is it a problem if we try to load very huge files...
    will it leave a trace somewhere else that this kind of activity heppenned....
    Please confirm...
    PS: In my case the actual Oracle Server is in some other box...Still can I do the Logminer activity from a remote connection !!!

  • How to use the update function using oracle eway

    Hi All,
    I have to update one column in the table i.e table1 using the oracle eway otd for which I have written the code like below.
    otdRISKBLOCKVALUES.getRISKBLOCKVALUES().setBALANCE_AMOUNT( bd );
    otdRISKBLOCKVALUES.getRISKBLOCKVALUES().update( sUpdate );
    As show above Iam setting the value to the setbalance_amount method and later calling the update method passing the where condition through the string sUpdate.
    But Iam getting an error as shown below.
    [#|2008-03-12T12:04:42.389+0530|SEVERE|IS5.1.3|STC.eWay.DB.Oracle.com.stc.connector.oracleadapter.base.ResultSetAgentImpl|_ThreadID=17; ThreadName=Worker: 5; Context=project=prjDataXform,deployment=dpDataXform,collab=svcRisk,external=eaFileIn;|updateBigDecimal() failed - No current row|#]
    [#|2008-03-12T12:04:42.389+0530|SEVERE|IS5.1.3|STC.eWay.DB.Oracle.com.stc.connector.oracleadapter.OracleSession|_ThreadID=17; ThreadName=Worker: 5; Context=project=prjDataXform,deployment=dpDataXform,collab=svcRisk,external=eaFileIn;|ErrorCode=17082, SQLState=null, Message=No current row|#]
    could any one Pl.thow some input on this.
    Thanks & regards in Advance
    Srikanth

    Hi,
    You need to specify the row you want to update first.
    The following code is taken from an example in the Oracle eway user guide:
    otdOracle_1.getDb_employee().update( "WHERECLAUSE" );
    while (otdOracle_1.getDb_employee().next()) {
       otdOracle_1.getDb_employee().setLAST_NAME( "Krishna" );
       otdOracle_1.getDb_employee().setFIRST_NAME( "Kishore" );
       otdOracle_1.getDb_employee().updateRow();
    }Replace WHERECLAUSE with the desired condition.
    Hope it helps
    Gustavo

  • How to right an update query in oracle using two tables?

    Table1
    ID     Dept
    1     A
    2     B
    3     A
    4     B
    5     C
    6     A
    7     D
    Table2
    ID     Dept
    1     A
    2     B
    3     A
    4     B
    5     C
    6     A
    7     D
    How to update id in Table1 from Table2 on joining condition Table1.dept=Table2.dept
    in Oracle

    869357 wrote:
    No it's not running, giving some error.That is because SQL server construct is different than that of Oracle.
    Try with
    update table1 a set a.id = (select min(b.id) from table2 b where a.dept = b.dept);
    However, due the repeated department values will not give you the desired output.

Maybe you are looking for

  • Help with getting the most recent transaction

    I have a system that keeps track of part repairs. Unfortunately a part my come in for repair multiple times. I want my query to pull back the most recent time/ request id that a part came in. This is my basic query, but it pulls back multiple records

  • Finance on a new Intel Mac mini

    Hi, My mac min has just died and i was wondering if i should get the new Intel 1, after just claiming on insurance for my powerbook it seems abit dodgy to claim again, how old in the UK do you have to be to take out finance, as a 15 year old, i havnt

  • Error after trying to upgrade an iphone 4 to iOS 6

    Tried to upgrade an iphone 4 to iOS 6, but was asked to connect to itunes. This attempted a restore (several times) but now phone is totally unusable. Can't switch it off and PC does not recognise it as a device. Can anyone help?

  • Problem with creating JAVA Source. please help

    Dear all how are you. In fact I have made a simple java class that return a string which represents the screen size . for example 800/600 or 1024/768 or others but I face error ORA-29541 class string.string could not be resolved This what i made firs

  • IPhoto card incomplete - missing items on back of card??

    Hi, I've been trying to make a Christmas Card on iPhoto - like I've done before - without problems. But this time, I can't order it. It gives me a series of warnings... that standard text not filled in (it is!) - text too long to fit (no warning 'tri