How to upgrade several records or table using single update statement.

Hello friends,

I'm going to abc and xyz table.

ABC: columns
Ein, equipementid
1-99999
2 99999
3 99999

total records 1000

columns of XYZ:
Ein, equipementid
1 1234
2 3456
2 4567
4 4567

total records 10000000

I want equipmentid update table abc with equipmentid table xyz for ein game (like abc.ein = xyz.ein) and then had to delete record from table xyz corresponds to ein and equipentid who has updated the record in abc.

Note: If you see xyz for ein table 2 we have two different equipmentid, we update with any value and only the record of xyz must be deleted once updated.

A single declaration for the update and only statement needing to remove.

Appreciate your help.



Thank you / kumar

Published by: kumar73 on August 2, 2012 13:02

Maybe

merge into abc
using (select ein,max(equipmentid) equipmentid
         from xyz
        group by ein
      ) x
   on abc.ein = x.ein
 when matched
 then update
         set abc.equipmentid = x.equipmentid

delete from xyz
 where exists(select null
                from abc
               where ein = xyz.ein
                 and equipmentid = xyz.equipmentid
             )

Concerning

Etbin

Tags: Database

Similar Questions

  • It is possible to add records to tables using Enterprise Manager?

    Can we add records to tables using Oracle Enterprise Manager web interface instead of the sqlplus commands? If not, is there an easy way to insert data into the table using a GUI?

    Yes, you can use the most common and free GUI tools like SQL Developer
    You can find more information about this
    http://www.Oracle.com/technology/products/database/sql_developer/index.html

    Francis

  • How to combine several pdf files into a single pdf file of document

    How to combine several pdf files into a single pdf file of the document?

    IF you use a Mac Version (I guess that even for the PC version) you and use the new handset functionality.

    1. To use Acrobat open without opening a PDF and go to file menu choose combine PDF.
    2. A small window opens
    3. Look for the files to combine
    4. Drag the window and gout.
    5. Search for the following file and repeat
    6. Drag the files to correct the order.
    7. Rename and save the PDF

    Its actually easier than using insert pages.

  • How to add data to the table using Manager POST for restful Apex application

    Hi all

    I managed to create a service application web Manager restful using GET for the Restful service module. I am able to get the data in row on the presentation of a table row id in the application. But I can't find an appropriate example, how the new data in the table can be posted or deleted. I created a POST handler for a URI scheme and look forward on how to proceed. Any help would be really appreciated.

    Source for the POST Manager:

    Start

    insert into ALL_BOOKS values(:id,:book);

    end;

    Also created 2 parameters id and the book.

    Hi jerry2134,

    jerry2134 wrote:

    I managed to create a service application web Manager restful using GET for the Restful service module. I am able to get the data in row on the presentation of a table row id in the application. But I can't find an appropriate example, how the new data in the table can be posted or deleted. I created a POST handler for a URI scheme and look forward on how to proceed. Any help would be really appreciated.

    Source for the POST Manager:

    Start

    insert into ALL_BOOKS values(:id,:book);

    end;

    Also created 2 parameters id and the book.

    Check out the following tutorials OBE, that explains the creation of GET and POST RESTful Web Services and how to use them in the APEX.

    Also what yo mean "looking forward on how to proceed? Do you want to or created for use/consume in your Oracle APEX application hosted RESTful web services?

    If Yes, in your Application, you must create a RESTful Web Service reference -> shared components. Then, create a form/report based on Web Service reference.

    Kind regards

    Kiran

  • insertion of a comma in the records by using the update statement

    Hello
    I have a table with an address field LOCATIONS, and there are several files that contain Box or post office box before the street number, IE. "Box, 25 993 stone Ave", "1 194 John St box". What I would do, is add a comma between the box number and the street number for all records that start with "Box", IE 'box 25, Ave Pierre 993'. I have over 1000 addresses with a box number, an update statement would be more effective.

    I created a display to select addresses that have a number of box with 1 digit (only addresses such as 'Box 1 194 St John'). I don't know how to write a statement that inserts a comma in the 6th space to create ' box 1, 194 John St.

    Any ideas?

    You can use regular expressions

    update place set address = regexp_replace(address, 'Box ([[:digit:]]+)', 'Box \1,')
    
  • How to pass parameter in the function using the select statement?

    Hello

    I had a problem. I can't pass as parameter to the function by using the select statement. But it can pass as a parameter using the "code". How can I solve this problem?

    For example,.
    Select * from table (SplitFunction ('HS750020, HS750021')) < < < this work.

    but

    Select * from table (SplitFunction (select LOT_NO in the TRACER_SEARCH_SCHEDULE where JOB_ID = '36')) < < < do not work.

    Thank you for trying to help him. Thank you.

    Select * from table (SplitFunction (select LOT_NO in the TRACER_SEARCH_SCHEDULE where JOB_ID = '36'))< do="" not="">

    Try like this

    select * from table(select splitfunction(lot_no) from tracer_search_schedule where job_id='36')
    

    Just make sure that your subquery returns only 1 row.

  • How to send several PO details in a single 850 EDI X 12 TP file?

    Hello

    We're working on sending EDI PO(EDI-X12-4010-850) file to one of our trading partners, say, TP123.

    The flow rate is: EBS-(Custom XML that contains more than 850 DATA)-> SOA-(Transaction - 850 - adapter B2B XML Format)-> B2B-> TP123.

    We send details several PO supported XML SOA Composite process.

    The SOA composite process translated by EBS Custom XML Format Format of XML of Transaction-850 (generated from 850 .ecs file) and send to B2B with B2B adapter.

    Our requirement is to send the details of multiple (received from EBS) PO in a single EDI X 12 850 file to TP123.

    When we tried with .ecs converted file 850 schema file (.xsd), we receive details IN. single file EDI 850.

    All entries on the way to send several PO details in a single X EDI file 12 850 SOA for B2B?

    Any help in this regard is highly appreciated.

    Thank you

    Nanan

    Hey Chick,

    You can use the feature of Oracle B2B EDI batch-

    http://docs.Oracle.com/CD/E28280_01/user.1111/e10229/b2b_batch.htm#XBBUG1381

    You should send individual messages EDI XML to the B2B and it can group them and send in the form of lots (depending on configuration)

    Kind regards

    Anuj

  • Multiple selection of records in table advanced to update in the Search Page.

    Hi all

    I write the code below, to select multiple records in table advanced for the update after clicking on the button update in the Search Page.
    I write this code in Processform request, but I got the exception when I run the code below.


    If (PageContext.GetParameter ("UpdateOnSeaBtn")! = null)
    {
    Am = (XxSupppacklistAMImpl) pageContext.getApplicationModule (webBean) XxSupppacklistAMImpl;
    am.saveRollback ();
    OAViewObjectImpl upDtVO = (OAViewObjectImpl) am.findViewObject ("PackingListSeaVO");
    PackingListSeaVORowImpl line;

    HashMap vParm = new HashMap();

    Row [] rows = upDtVO.getFilteredRows ("SingleSelection", "Y");
    int fetCount = upDtVO.getRowCount ();
    System.out.println ("Teh recovered rowcount is:," + fetCount);

    RowSetIterator multiIter;
    multiIter = upDtVO.createRowSetIterator ("multiIter");
    multiIter.setRangeStart (0);
    multiIter.setRangeSize (fetCount);


    for (int i = 0; i < fetCount; i ++)
    {
    Row = (PackingListSeaVORowImpl) multiIter.getRowAtRangeIndex (i);
    If (Row.GetAttribute ("SingleSelection")! = null)
    {
    If (Row.GetAttribute ("ItemNumber")! = null)
    {
    Object vitemNum = row.getAttribute ("ItemNumber");
    System.out.println ("The selected element Num is:," + vitemNum);
    vParm.put ("ItemNumber", vitemNum);

    pageContext.setForwardURL ("OA.jsp?page=/xxfls/oracle/apps/po/packlist/webui/XxSuppalistcrealistPG", / / here, I got the exception below)
    NULL,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    NULL,
    vParm,
    false, / / RetainAM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
    OAWebBeanConstants.IGNORE_MESSAGES);
    }
    }
    }

    multiIter.closeRowSetIterator ();

    }
    }
    }

    could you, please, can someone help on this.


    I got below exception to the side server when it is run the code above.
    Error (125,48): method setForwardURL (java.lang.String, null, null, byte, java.util.HashMap, boolean, java.lang.String, byte) is not not in the interface oracle.apps.fnd.framework.webui.OAPageContext

    Kind regards

    Hello

    832859 wrote:

    for (int i = 0; i)<>
    {
    Row = (PackingListSeaVORowImpl) multiIter.getRowAtRangeIndex (i);
    If (Row.GetAttribute ("SingleSelection")! = null)
    {
    If (Row.GetAttribute ("ItemNumber")! = null)
    {
    Object vitemNum = row.getAttribute ("ItemNumber");
    System.out.println ("The selected element Num is:," + vitemNum);
    vParm.put ("ItemNumber", vitemNum);

    > pageContext.setForwardURL"OA.jsp.page=/xxfls/oracle/apps/po/packlist/webui/XxSuppalistcrealistPG",//here I got below exception

    NULL,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    NULL,
    vParm,
    false, / / RetainAM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
    OAWebBeanConstants.IGNORE_MESSAGES);
    }
    }
    }

    -Here is you call pageContext.setForwardURL loop.
    >

    I got below exception to the side server when it is run the code above.
    Error (125,48): method setForwardURL (java.lang.String, null, null, byte, java.util.HashMap, boolean, java.lang.String, byte) is not not in the interface oracle.apps.fnd.framework.webui.OAPageContext

    -check 5th param should nt be vParm if it is null

    Finally... After the for loop ends call... y bcz assume this page grouped 10 rows can he navigate both on the next page...:

    pageContext.setForwardURL ("OA.jsp?page=/xxfls/oracle/apps/po/packlist/webui/XxSuppalistcrealistPG",
    NULL,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    NULL,
    NULL,
    false, / / RetainAM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
    OAWebBeanConstants.IGNORE_MESSAGES);
    }

    Concerning
    Meher Irk

    Published by: Meher Irk on March 31, 2011 19:54

  • How to load several files DBF table 1 target using only 1 interface?

    Hello, I am a beginner in ODI and I have a problem.

    I have several DBF / Foxpro files that is stored in a directory like this:
    2010_10/account.dbf
    2010_11/account.dbf

    All DBF files have the same structure, but stored in a different folder (the folder name is < year > _ < month >)

    I managed to create an interface to load a DBF unique for the target table and the source table is hardcoded in the interface. Ideally, the interface will take place once a month.

    How can I use the same interface to load other DBF files?

    I know, if the data source is a text file, you can link the resource name to a variable, and the variable can be set to a file name. But I can't do since I use a JDBC driver to connect to the DBF file.

    Any help will be appreciated

    Hello

    I have no idea on the DBF files, yet...

    What is create a variable to build the 'months' and then pass this variable to OdiFileCopy, move this file to a specific directory. Then run your interface to load this file into your database. Once the work is successful, you can delete the file using OdiFileDelete (optional)

    Thank you
    Fati

  • How to record on several records by simply using the save after I'm done editing command?

    I want by default save, for example a word document, on my hard drive and the network using simply save it command.  Is it possible to save in several folders in several destinations by simply hitting the recording of order instead of having to manually we "save under" and goes to each destination individually?

    Hello

    Welcome to the Microsoft Community and forums thanks for posting the question.

    The description, it looks like you need to save the files in mulitple locations by clicking on save button. By design, Windows can point to one place at a time. In several places, you can choose the option "record under.

    Hope this information helps. Get back to us if you wondering more about Windows.

  • How to copy a record in table with the database Access using VB

    I have a file DBTEST.accdb and table 4 in
    With the help of VS 2013 Express

    In my project VS.

    Form1 have two DataGridView, store and display data of table1 and table2 in DBTEST.accdb
    The column is the same in table1 and table2
    The column is the value yes/no (check box) in DBTEST.accdb

    Now, I would like to determine the weather, the check box is selected.
    Copy the entire line selected in table2 from table1, and then delete from table1.
    And I want that the task is performed by a single button.

    Thank you very much.

    You can visit Microsoft Support Page, click here

  • How to publish data from a table using the form

    Oracle forms6i

    Hai All

    I have download the data to the table of forms...

    My table T1 columns are in, out, intrinsically, introut, empname, empno


    and another table T2 consist of three columns is empno, date, time

    In table T2 time fields consist of symbol I, o... I mean IN, O OUT

    My Question is when an employee consist of 3 I - the three IN the time


    0815 I, 1200 I, 1415 I and OUT 3 times O 1245, 1445 O, O 1715 and empno is 001

    If there is no record for empno 001 then insert first 0815 I in table T1 in column IN time then

    to update 1200 intrinsically and 1245 update to Introut and 1415 up-to-date addin and 1445 to update addout


    Finally in 1715 to outtime

    If it is possible to do without Hardcoding the moment Pls tell with some good example


    Thanks in advance

    Srikkanth.M

    There now things are clear... whenever I have free I'll post the code u how to do this...

    for now, a few tips can help u

    -create the table to store operations travel so then u can't fix your code

    -Create the cursor on the T1 line through all the records.

    -Control what empno and action i.e. the current cursor (I or O) exists on the same date in T2 or not

    -otherwise exists insert a new record check also the SHIFT is coming in time IF is between MAJ 0815 and 1645 and action is 'I' then insert record and column values accordingly

    s ' there is, then update the record of the place where empno = cur.empno and attendance_date = mydate;

    It may be useful

    Baig,
    [My Oracle Blog | http://baigsorcl.blogspot.com/]

  • How to upgrade telepresence endpoints in bulk using TMS v14.6?

    Hello world

    I'm working on a TMS 14.6.2, v I a task of upgrade on a 100 Tandberg profile C20 endpoints to a TC7.3.5 version.

    You can Guys tell me how to perform an upgrade loose on these Tandberg profile 42 C20 using TMS?

    Thank you, guys, in advance.

    Amine

    On the upgrade of the system page, you have the ability to sort by types of specific endpoint or versions of software among various other filters, which are expected to update the specific end points you want easily.

  • How to retrieve multiple records in XML using PL/SQL with XE 10 g

    Hi all

    I need your advice, if you please.
    I have an object CLOB as a result of a Web Service, I need to analyze. I use the XE version, XQuery is not for me, I get SYS. Exception DBMS_XQUERYINT.

    I tried to use the snippet, but it looks like I'm doing something wrong there. Please tell me what should I change?

    (1) I have a temporary table with id and xmltype
    (2) I have tested that the example data in the table
    (3) I get nothing no matter if I use,'/ modifyPlannedItemStatus/days [1] / day_of_week_order "or simply,'/ modifyPlannedItemStatus/days [1] / day_of_week_order'."

    Thanks in advance


    DECLARE
    my_xml XMLTYPE.
    my_clob CLOB: =' <? XML version = "1.0" encoding = "UTF-8" standalone = 'no '? >
    < mgns1:modifyPlannedItemStatus xmlns:mgns1 = "http://www.mart-sw.co.uk/library" >
    < days >
    A < day_of_week_code > < / day_of_week_code >
    < day_of_week_order > 1 < / day_of_week_order >
    Monday < day_of_week_name > < / day_of_week_name >
    < / days >
    < days >
    < day_of_week_code > B < / day_of_week_code >
    < day_of_week_order > 2 < / day_of_week_order >
    Tuesday < day_of_week_name > < / day_of_week_name >
    < / days >
    < / mgns1:modifyPlannedItemStatus > ';

    I INTEGER: = 1;

    my_varchar VARCHAR2 (3000);
    BEGIN

    insert into session_temp_xml values (i, xmltype.createxml (my_clob));

    SELECT to_clob(extract(s.xml_data,'/modifyPlannedItemStatus/days[1]/day_of_week_order')) IN the s session_temp_xml my_varchar;


    dbms_output.put_line (' result ' |) RTrim (my_varchar));


    END;

    Hello

    'Re missing you the declaration of the namespace of the root node.

    extract( s.xml_data
           , '/mgns1:modifyPlannedItemStatus/days[1]/day_of_week_order'
           , 'xmlns:mgns1="http://www.mart-sw.co.uk/library"' )
    

    This will give you an instance of XMLType:

    1
    

    To convert it to CLOB or VARCHAR2 (i.e. to serialize the XML content in a character stream) use one of the getter methods getClobVal or getStringVal.
    If you want to retrieve the scalar value of the element (text node), use extractValue in place of the extract function.

    Here is an example on how to extract some repetitive elements in your version:

    SQL> create table session_temp_xml (
      2   id number,
      3   xml_data xmltype
      4  );
    
    Table created
    
    SQL> insert into session_temp_xml values (1, xmltype(
      2  '
      3  
      4  
      5   A
      6   1
      7   Monday
      8  
      9  
     10   B
     11   2
     12   Tuesday
     13  
     14  ')
     15  );
    
    1 row inserted
    
    SQL>
    SQL> SELECT extractValue(x.column_value, '/days/day_of_week_code') as day_of_week_code
      2       , extractValue(x.column_value, '/days/day_of_week_order') as day_of_week_order
      3       , extractValue(x.column_value, '/days/day_of_week_name') as day_of_week_name
      4  FROM session_temp_xml s
      5     , TABLE(
      6         XMLSequence(
      7           extract(
      8             s.xml_data
      9           , '/mgns1:modifyPlannedItemStatus/days'
     10           , 'xmlns:mgns1="http://www.mart-sw.co.uk/library"'
     11           )
     12         )
     13       ) x
     14  ;
    
    DAY_OF_WEEK_CODE      DAY_OF_WEEK_ORDER      DAY_OF_WEEK_NAME
    --------------------- ---------------------- ---------------------
    A                                          1 Monday
    B                                          2 Tuesday
     
    

    Hope that helps.

  • How to load several books in planning using FDM ERPI?

    Hello

    I use FDM and ERPI 11.1.2 to load data from Oracle GL R12 to Hyperion Planning 11.1.2.

    In Oracle GL, I have several books: one for each accounting entities.

    In ERPI:
    -an import format is associated with a single entity accouting
    -a location is associated with an import format, then with a reporting entity
    -a rule of data loading is associated with a place, then with a reporting entity

    In FDM, when configuring the ERPI adapter, you must enter the data load rule name that you want to use.

    So: How to load data from several reporting entities (= books) in planning through FDM/ERPI?

    Thank you in advance for your help!

    Fanny

    Fanny,

    You have no need to fill the data rule option - load adapter. By the documentation, you can also fill the places metadata integration Option n ° 1 with load rule name. This lets you use an adapter in the application of FDM; but the pull of several great books.

    Of course, each book would be a separate location of the FDM.

    Thank you

Maybe you are looking for

  • Where is the

    Where is the button 'Search' on Thunderbird 3? I need to revisit several old emails and can not find them, and there is no search box on my version of Thunderbird.

  • Mail question - how to remove something in the right click options

    I find that I sometimes wrongly empty my deleted folder.  I got in the mail list and think I select "delete spam" when in fact I chose "delete deleted items".  Is there a way to delete 'Clear cut' in the right click menu in the mail.  I searched the

  • How windows media to play .dss files?

    I can't open the .dss files, but I know that other computers with windows MediaPlayer can...

  • USB connection times

    Given that some Windows 7 updates in may, my USB connections took awhile to start when plugged in (e.g. flash drive) or exploited (e.g. printer). The delay is not long (about 20 seconds) and after the first operation, I have instant access again. It

  • Error of Service of blackBerry Smartphones

    My blackberry curve 8520 shows additional service error,If I try to check the balance or make a call but I am able to access the help internate.please wat can I do {Edited topic}