Data comparison and update/insert between two schemas in same database

Hi all,
I have requirement like this. In one database, i am having two users, user1 and user2. Both users is having same tables and structure wise also same. In user1, data will be populated by job.
Now, what i want to do is, i have to find out difference between user1 and user2 data and the Difference data will be updated/inserted into the user2.
Any ideas please...
Thanks in advance,
Pal

Will trigger help you ... ie. for every update/insert on user1 will do on user2-- it is heavy to do for all table...
--svmg                                                                                                                                                                                                                                                                   

Similar Messages

  • How to check relation between two tables in same database

    How to check relation between two tables in same database using Oracle SQL developer. Version 2.1.1.64

    Hi,
    Try this,
    SELECT   cons.owner AS child_owner, cons.table_name AS child_table,
             cons.constraint_name constaint_name,
             cons.constraint_type constraint_type, col.owner parent_owner,
             col.table_name parent_table, col.column_name column_name
        FROM dba_cons_columns col, dba_constraints cons
       WHERE cons.r_owner = col.owner
         AND cons.r_constraint_name = col.constraint_name
         AND col.owner = 'MY_USER'
    ORDER BY child_table;Thanks,
    Shankar

  • Which one is faster loading type between Insert/Update and Update/Insert?

    Hi Gurus,
    Could anyone tell me which loading type faster between Insert/Update and Update/Insert?Any resolution and document reference would be grateful.
    Regards,
    Joni

    910575 wrote:
    Thanks Purvesh for your quick response..
    Yes you are right, we have to prefer sql rather than plsql. But if i have 1 lakh records to be inserted then my insert into select will do insert one by one that mean context switching is more to server i.e 1 lakh.
    If i use BULK COLLECT+ FORALL then in a single switch the lakh records will be inserted right?
    I agree that when we have less number of records to insert we can prefer insert into select, if we have huge data then why not FORALL ?
    You have just tested for 107 records, but in huge data it is different right?
    Thanks,
    VinodYou've misunderstood how it works, I think. When you do the "insert into ... select", Oracle works out what rows need to be inserted and does them in one fell swoop. That's 2 context switches only, with the bulk of the work being done by the SQL engine.
    When you do the BULK COLLECT + FORALL, you're telling Oracle to first identify the rows (that's two context switches straight off; one from PL/SQL to SQL and then back to PL/SQL again), load them into a collection, then loop through the collection and insert the records X rows at a time (which could be all records or whatever you set as the LIMIT on the FORALL) (again, with the context switching between PL/SQL and SQL and back again through each loop).
    Which one sounds like it does the least amount of work? Not the BULK COLLECT, right?

  • Different ways to copy data between two schemas in one instance

    Hi there,
    I am searching a good way to copy data between two schemas in the same instance.
    Both schemas have an identical structure such as triggers, tables, views and so on. The only difference is the purpose: one is the productivity system and one is for development.
    I looked at datapump but I do not explicit want to export / import. I want to keep the data in the productivity schema as well as copy it to the other schema. Any ideas? I found out there is a copy statement but I dont't know how that works.
    Thank you so far,
    Jörn

    Thank you for your replies!
    I also thought of creating a second instance for development and move the dev - schema to it. I just don't know whether our server can handle both (performance?). Anyway the idea is to have a possibility to quickly rebuild the data inside a schema without indixes or triggers, just pure data. I thought the easiest way would be to copy the data between the schemas as they are exactly the same. However if you tell me DataPunp is the best solution i won't deny using it :).
    When you export data a file is created. does that also mean that the exported data is deleted inside the schema?
    best regards
    Jörn
    Ps: Guido, you are following me, aren' t you? ;-)

  • Difference between MERGE and Update/Insert

    Can anybody pls tell me what is the difference between MERGE and Update/Insert statements.

    hi vivek,
    merge is totally different than normal update and insert.Merge is a combination of update+inserrt.
    Merge statment first checks the data in your table, if data is already exists then it will try to update the data otherwise it will go for insertion.In case of normal update/insert it will not check the data directly it does the specified operation.
    So based on your requirement you have to select the best option.
    Thanks.

  • In jdbc adapter what is the difference between insert and update insert

    in jdbc adapter what is the difference between insert and update insert
    Edited by: katru vijay on Mar 22, 2010 7:43 AM

    Please refer to this Link [Document Formats for the Receiver JDBC Adapter|http://help.sap.com/saphelp_nw04/Helpdata/EN/22/b4d13b633f7748b4d34f3191529946/frameset.htm]
    Hope this helps.
    Regards,
    Chandravadan

  • RE : Drag and Drop operations between two outlinefields

    Hi,
    Has any one tried the drag and drop operations between two Outline widgets ina
    window.Any help appreciated.
    Thanks
    balsubHi Balsub,
    Here are some lines which can help you :
    First of all, your 2 OutLineFields must be in a draggable state.
    In the event loop of your window, you have to listen to the event
    ObjectDrop
    on the 2 OutLineFields :
    When Self.<MyOutLine1>.ObjectDrop(SourceX = SourceX,
    SourceY = SourceY,
    SourceField = SourceField,
    TargetX = TargetX,
    TargetY = TargetY,
    TargetField = TargetField) do
    When Self.<MyOutLine2>.ObjectDrop(SourceX = SourceX,
    SourceY = SourceY,
    SourceField = SourceField,
    TargetX = TargetX,
    TargetY = TargetY,
    TargetField = TargetField) do
    Then, when you receive this event, the LocateNode() method will give you
    the DisplayNode which is beeing dragged :
    (assume that your OutLineFields are mapped to the class named :
    ClassOutLine,
    and Col is an Integer which is not important here)
    TheSourceLine : ClassOutLine;
    Col : Integer;
    TheSourceLine = (ClassOutLine)((OutLineField)(SourceField).LocateNode(X
    = SourceX,
    Y = SourceY,
    Column = Col));
    If you want to remove this line from the Source OutLineField :
    TheSourceLine.Parent = Nil;
    TheSourceLine.UpdateFieldFromData();
    If you want to insert this line at the end of the Target OutLineField :
    TheSourceLine.Parent = (OutLineField)(TargetField);
    TheSourceLine.UpdateFieldFromData();
    And if you want to insert this line before or after the Target line of
    the Target OutLineField :
    TheTargetLine : ClassOutLine;
    TheTargetLine = (ClassOutLine)((OutLineField)(TargetField).LocateNode(X
    = TargetX,
    Y = TargetY,
    Column = Col));
    TheTargetLine.PrevSibling = TheSourceLine; // Insert the source line
    before the target line
    or
    TheTargetLine.NextSibling = TheSourceLine; // Insert the source line
    after the target line
    TheTargetLine.UpdateFieldFromData();
    I hope this help you !
    - Manuel -
    Manuel Deveaux
    Forte Developer
    Mutuelle Pr&eacute;viade
    FRANCE
    E-Mail : [email protected]
    -----------------------------------------

    There is no configuration for it. It should work.
    Can you try it in a different user account. If it works in a different account, then it is likely something in your current user account that is messed up. If it doesn't work in another user account, then it is likely something with Mail, itself. 
    You could try downloading and installing the 10.6.7 combo update. That may repair what is wrong.

  • Drag and Drop images between two listviews

    I need a help for listview drag n drop opretion on winform. where  listview1 hold the images and i want to drag images from listview1 to listview2
    and then when i click any button i want all paths of Images which is in the listview2. and also i want to set the image size on listview2. Please help me.

    Hi Ajay Kumar,
    According to your description, you'd like to drag and drop listviewitems between two listviews.
    Here is my example for dropping items between listviews. You could add one imageList control to your form.
    public Form1()
    InitializeComponent();
    this.listView2.AllowDrop = true;
    this.listView1.AllowDrop = true;
    this.listView2.View = System.Windows.Forms.View.LargeIcon;
    this.listView2.DragDrop += new System.Windows.Forms.DragEventHandler(this.OnDragDrop);
    this.listView2.DragEnter += new System.Windows.Forms.DragEventHandler(this.OnDragEnter);
    this.listView1.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.OnItemDrag);
    private void Form1_Load(object sender, EventArgs e)
    DirectoryInfo dir = new DirectoryInfo(@"D:\Material\Emoticons");
    foreach (FileInfo file in dir.GetFiles())
    try
    this.imageList1.Images.Add(Image.FromFile(file.FullName));
    catch
    Console.WriteLine("This is not an image file");
    this.listView1.View = View.LargeIcon;
    this.imageList1.ImageSize = new Size(32, 32);
    this.listView1.LargeImageList = this.imageList1;
    this.listView2.LargeImageList = this.imageList1;
    //or
    //this.listView1.View = View.SmallIcon;
    //this.listView1.SmallImageList = this.imageList1;
    for (int j = 0; j < this.imageList1.Images.Count; j++)
    ListViewItem item = new ListViewItem();
    item.ImageIndex = j;
    this.listView1.Items.Add(item);
    private void OnItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e)
    DoDragDrop(e.Item, DragDropEffects.Move);
    private void OnDragEnter(object sender,
    System.Windows.Forms.DragEventArgs e)
    if (!e.Data.GetDataPresent(typeof(ListViewItem)))
    e.Effect = DragDropEffects.None;
    return;
    var items = (ListViewItem)e.Data.GetData(typeof(ListViewItem));
    if (items == null)
    e.Effect = DragDropEffects.None;
    else
    e.Effect = DragDropEffects.Move;
    private void OnDragDrop(object sender, System.Windows.Forms.DragEventArgs e)
    ListViewItem items = (ListViewItem)e.Data.GetData(typeof(ListViewItem));
    if (items != null)
    this.listView2.Items.Add((ListViewItem)items.Clone());
    Results:
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Drag and drop attachments between two email windows

    Hi together,
    my problem is easy. i cannot drag and drop attachements between two email windows using Apple Mail. On my old MBAir it was no problem. I do not know which configuration i have to change. To drag and drop to the desktob is no problem. Now i have to drop an attachement on the desktop to attach it to a new mail. This cannot be the solution :-)  Please help me.Thank you.
    Noobie :-)

    There is no configuration for it. It should work.
    Can you try it in a different user account. If it works in a different account, then it is likely something in your current user account that is messed up. If it doesn't work in another user account, then it is likely something with Mail, itself. 
    You could try downloading and installing the 10.6.7 combo update. That may repair what is wrong.

  • Regarding - Drag and Drop operations between two outlinefields

    Hi,
    Has any one tried the drag and drop operations between two Outline widgets in a window.Any help appreciated.
    Thanks
    balsub

    There is no configuration for it. It should work.
    Can you try it in a different user account. If it works in a different account, then it is likely something in your current user account that is messed up. If it doesn't work in another user account, then it is likely something with Mail, itself. 
    You could try downloading and installing the 10.6.7 combo update. That may repair what is wrong.

  • Data comparisons and movements

    I have a Heap Sort using the following code, and I cannot seem to figure out how many data comparisons and data movements there are as the heap is sorted. Does anybody know how to count the number of comparisons and movements?? Please let me know....much appreciated...Thanks :)
    import java.io.IOException;
    import java.util.*; // Calender Class for timing
    public class Heap {
    private MyNode[] heapArray;
    private int maxSize;
    private int currentSize; // number of items in array
    public Heap(int mx) {
    maxSize = mx;
    currentSize = 0;
    heapArray = new MyNode[maxSize];
    public MyNode remove()
    MyNode root = heapArray[0];
    heapArray[0] = heapArray[--currentSize];
    trickleDown(0);
    return root;
    public void trickleDown(int index) {
    int largerChild;
    MyNode top = heapArray[index];
    while (index < currentSize / 2)
    int leftChild = 2 * index + 1;
    int rightChild = leftChild + 1;
    // find larger child
    if (rightChild < currentSize
    heapArray[leftChild].getKey() < heapArray[rightChild]
    .getKey())
    largerChild = rightChild;
    else
    largerChild = leftChild;
    if (top.getKey() >= heapArray[largerChild].getKey())
    break;
    heapArray[index] = heapArray[largerChild];
    index = largerChild;
    heapArray[index] = top;
    public void displayHeap() {
    int nBlanks = 32;
    int itemsPerRow = 1;
    int column = 0;
    int currentIndex = 0;
    while (currentSize > 0)
    if (column == 0)
    for (int k = 0; k < nBlanks; k++)
    System.out.print(' ');
    System.out.print(heapArray[currentIndex].getKey());
    if (++currentIndex == currentSize) // done?
    break;
    if (++column == itemsPerRow) // end of row?
    nBlanks /= 2;
    itemsPerRow *= 2;
    column = 0;
    System.out.println();
    else
    for (int k = 0; k < nBlanks * 2 - 2; k++)
    System.out.print(' '); // interim blanks
    public void displayArray() {
    for (int j = 0; j < maxSize; j++)
    System.out.print(heapArray[j].getKey() + " ");
    System.out.println("");
    public void insertAt(int index, MyNode newNode) {
    heapArray[index] = newNode;
    public void incrementSize() {
    currentSize++;
    public static void main(String[] args) throws IOException {
    int size, i;
    size = 500;
    Heap theHeap = new Heap(size);
    for (i = 0; i < size; i++) {
    int random = (int) (java.lang.Math.random() * 5000);
    MyNode newNode = new MyNode(random);
    theHeap.insertAt(i, newNode);
    theHeap.incrementSize();
    System.out.println(size+" random numbers are currently being generated...");
    for (i = size / 2 - 1; i >= 0; i--)
    theHeap.trickleDown(i); // creates the heap
    System.out.print("\nRandom Numbers in a Heap: ");
    theHeap.displayArray(); // prints the heap
    long time1000start = new Date().getTime() ; // this makes a new Date object and then sets the long integer value of the Date object
    // ******************* START - sorting numbers *******************
    for (i = size - 1; i >= 0; i--)
    MyNode biggestNode = theHeap.remove();
    theHeap.insertAt(i, biggestNode);
    // ******************* END - sorting numbers *******************
    long time1000end = new Date().getTime() ; // this makes a new Date object and then sets the long integer value of the Date object
    double timediff1000m = (time1000end - time1000start); // difference of time in milliseconds
    double timediff1000s = ((time1000end - time1000start) / 1000); // difference of time in seconds
    System.out.print("\nRandom Numbers in a Sort: ");
    theHeap.displayArray(); // prints the numbers in increasing order
    System.out.print("\nStart Time of Sort: "+time1000start);
    System.out.print("\nEnd Time of Sort: "+time1000end);
    System.out.print("\nTime to Complete Sort: "+timediff1000m+" milliseconds or "+timediff1000s+" seconds.");
    } // end main method
    } // END project :)

    I never miss class....my instructor gave us the assignment of making a heap sort and he told us to use code off the internet as a resource because the only sorting we have done so far is bubble.....this was a research project, for my instructor to see if we can use the internet as an effective resource to put together a program and learn about a differnet type of sorting.....everyone in the class got a different type of sort (merge, quick, insertion, etc...). i have put the program together and customized it to my needs based on my knowledge.....the last thing i am having trouble with is my counting of comparisons and data movements. Can you please help me finish up my program.

  • Can I put my library on an external hard drive and use it between two computers?

    Can I put my library on an external hard drive and use it between two computers? I have two MBP; I will refer to one as computer A and to the other as computer B. I would like to be able to plug in my external hard drive, boot up iTunes, and if there were any changes made to the library previous to its last time accessed on this compluter, they show up on that computer, regardless of being imported on the other.
    A hypothetical example: I import three albums called 1, 2, and 3 on computer A over a week or so. I take the external hard drive and plug it into computer B. The entire library which was visible on A, is visible on B, including albums 1, 2, and 3.
    Is this possible? If so, what files need to be copied onto the external? I'm trying some different combinations, trial and error basically. Hopefully someone knows and can answer before I mess up my library. I also want to do this to free up space on my computer. All importing will be done from disc.

    iTunes/Preferences/Advanced : point your iTunes to the new location of the Library.
    Set "Share on local network" in the Sharing tab, and you or everyone on the local network can play your music.
    You make a backup first of the Library.
    Move the follwing to the new location:
    /Users/your username/Music/iTunes/iTunes Music
    have fun.

  • As to the data type of the data type of the difference between two date type of datas

    Hi,
    I have a question about the data type of the difference between two date type of datas.
    There are two date type of datas as:
    SSHIPMENTS.RECEIVEDATETIME
    SSHIPMENTS.PROMISEDATETIME
    I try to use the following SQL Script in Oracle SQL*Plus as:
    SELECT CASE
    WHEN (SSHIPMENTS.RECEIVEDATETIME - SSHIPMENTS.PROMISEDATETIME) < '000 01:00:00.000' THEN 'OnTime'
    WHEN (SSHIPMENTS.RECEIVEDATETIME - SSHIPMENTS.PROMISEDATETIME) < '000 01:30:00.000' THEN '60-89 Minutes'
    ELSE '3+ Hours'
    END
    FROM SSHIPMENTS;
    The error message of "Invalid Number" for the '000 01:30:00.000' happens.
    I don't know if the data type of the interval is wrong.
    Many Thanks,
    Cathy

    SELECT CASE
    WHEN (to_char(SSHIPMENTS.RECEIVEDATETIME,'hhmiss') - to_char(SSHIPMENTS.PROMISEDATETIME,'hh24miss')) < '010000' THEN 'OnTime'
    WHEN (to_char(SSHIPMENTS.RECEIVEDATETIME,'hhmiss') - to_char(SSHIPMENTS.PROMISEDATETIME,'hh24miss'))< '000 01:30:00.000' THEN '60-89 Minutes'
    ELSE '3+ Hours'
    END
    FROM SSHIPMENTS;
    just try it out..

  • How to drag and drop button between two toolbar?

    Hi,everybody :)
    i hava a problem :
    if i have two toolbar in a frame , and there are some button in each, how can i use dnd package to drag and drop button between two toolbar,such as drag one button in a toolbar to the other toolbar ,i write some sample code ,but find some difficult to finish
    can anyone give me some example code?
    Thanks!

    hi:)
    i have done it ,but there is another problem ,after i finish drag the button and drop it into the toolbar,if my mouse across the dragged button ,it will change the color ,can i setup any mathod to disappear the side_effect?
    thank u
    click open to show the other frame
    and the code is as follows:
    import java.awt.*;
    import java.awt.datatransfer.*;
    import java.awt.dnd.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    public class buttondrag implements DragGestureListener, DragSourceListener,
    DropTargetListener, Transferable{
    static JFrame source = new JFrame("Source Frame");
    static JFrame target = new JFrame("Target Frame");
    static final DataFlavor[] supportedFlavors = { null };
    static {
    try {
         supportedFlavors[0] = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
    catch (Exception ex) {
         ex.printStackTrace();
    } Object object; // Transferable methods.
    public Object getTransferData(DataFlavor flavor) {
    if (flavor.isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType)) return object;
    else{
    return null;
    public DataFlavor[] getTransferDataFlavors() {
         return supportedFlavors;
    public boolean isDataFlavorSupported(DataFlavor flavor) {
         return flavor.isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType);
    } // DragGestureListener method.
    public void dragGestureRecognized(DragGestureEvent ev) {
    ev.startDrag(null, this, this);
    } // DragSourceListener methods.
    public void dragDropEnd(DragSourceDropEvent ev) { }
    public void dragEnter(DragSourceDragEvent ev) { }
    public void dragExit(DragSourceEvent ev) { }
    public void dragOver(DragSourceDragEvent ev) {
         object = ev.getSource();
    public void dropActionChanged(DragSourceDragEvent ev) { } // DropTargetListener methods.
    public void dragEnter(DropTargetDragEvent ev) { }
    public void dragExit(DropTargetEvent ev) { }
    public void dragOver(DropTargetDragEvent ev) { dropTargetDrag(ev); }
    public void dropActionChanged(DropTargetDragEvent ev) { dropTargetDrag(ev); }
    void dropTargetDrag(DropTargetDragEvent ev) { ev.acceptDrag(ev.getDropAction()); }
    public void drop(DropTargetDropEvent ev) {
         ev.acceptDrop(ev.getDropAction());
         try {
         Object target = ev.getSource();
         Object source = ev.getTransferable().getTransferData(supportedFlavors[0]);
         Component component = ((DragSourceContext) source).getComponent();
         Container oldContainer = component.getParent();
         Container container = (Container) ((DropTarget) target).getComponent();
         container.add(component);
         oldContainer.validate();
         oldContainer.repaint();
         container.validate();
         container.repaint();
         catch (Exception ex) {
              ex.printStackTrace();
              ev.dropComplete(true);
    public static void main(String[] arg) {
    JButton button = new JButton("Drag this button");
    JToolBar sbar = new JToolBar();
    JToolBar dbar = new JToolBar();
    JButton open_button = new JButton("Open");
    source.getContentPane().setLayout(null);
    source.setSize(new Dimension(400, 300));
    sbar.add(button);
    sbar.setBounds(new Rectangle(0, 0, 400, 31));
    sbar.add(open_button);
    open_button.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent e) {
    target.setVisible(true);
    source.getContentPane() .add(sbar);
    target.getContentPane().setLayout(null);
    target.setSize(new Dimension(400, 300));
    target.getContentPane().add(dbar);
    dbar.setBounds(new Rectangle(0, 0, 400, 31));
    dbar.add(new JButton("button1"));
    buttondrag dndListener = new buttondrag();
    DragSource dragSource = new DragSource();
    DropTarget dropTarget1 = new DropTarget(sbar, DnDConstants.ACTION_MOVE, dndListener);
    DropTarget dropTarget2 = new DropTarget(dbar, DnDConstants.ACTION_MOVE, dndListener);
    DragGestureRecognizer dragRecognizer1 = dragSource.createDefaultDragGestureRecognizer(button, DnDConstants.ACTION_MOVE, dndListener);
    source.setBounds(0, 200, 200, 200);
    target.setVisible(false);
    target.setBounds(220, 200, 200, 200);
    source.show();
    }

  • How to drag and drop files between two JFileChooser

    Sir i want to drag and drop files between two JFileChooser i don't know how to do that. So is there any reference code for that so that i can able to do it. I have enabled setDragEnabled(true) for both the jfilechooser now i don't now how to drop files in them means drag file from one jfilechooser and drop it to another JFileChooser,.
    Plz help me this is the requirement in my project.

    Note: This thread was originally posted in the [New To Java|http://forums.sun.com/forum.jspa?forumID=54] forum, but moved to this forum for closer topic alignment.

Maybe you are looking for