Synchronization of data between the tables of towing

HII
I have two database 1 and both of the databases of database 2 have citizen of table (citizen_ssn, citizen_name) with the same structure
Ok

and I create the link of database database 1 into database 2 (link name: link1)
and I have another link for 2 to 1 of the databases database (link name: Link2)
I want to synchronize data between two tables
in other words, I want to when new record adds database1 go base2 and check if this folder exists (using citizen_ssn) or not, if it exists then add the record only in database1
otherwise add record base1 and base2.

and if there is record inserted into database 2, I'll go to database1 and check if it exists, it exists to add recording base2, if not add it in base1 and base2

can I do this in real time or not.
Thank you...

I don't see how you have an infinite loop. If you insert a row into database1, the trigger will fire and verify the existence of the line of base2. If the line exists in base2, nothing happens. If the line does not exist, then a line will be inserted in base2, after what the relaxation in base2 fires that will check the existence of the line in database1 and, since it is, won't do anything.

What Miss me?

HTH
Srini

Tags: Database

Similar Questions

  • problem copying of data between the tables

    Hello members,

    Its my first day using SQL queries the server for Oracle 10 g. I used the following query to copy certain fields in a table:

    CREATE TABLE SAMPLE_TEMP (SELECT customer BALANCE OF CUSTOMER_ALL)

    The CUSTOMER_ALL table has more than 2 million documents. I managed to create an array and copy of the data, but the new table could fill only 52978 records.

    -Samples in my table
    BALANCE CUSTOMER
    6.28899273 0
    6.28899274 0
    6.28899275 0
    6.28899289 625.12
    6.28899292 2666.24

    How can I go about fixing this? I have to declare a structure and set it to the number of records that I will store? Any guidance will help me get started.

    Concerning

    Newbie

    Hello

    If the CUSTOMER_ALL table is a living picture, he could have new records INSERTed because you copied the data, so you'll have different counts.

    To check the difference of data:

    SELECT CUSTOMER, BALANCE FROM CUSTOMER_ALL
     MINUS
    SELECT CUSTOMER, BALANCE FROM SAMPLE_ALL
    
  • How to write a simple select query to get the data of the table as an XML.

    How to write a simple select query to get the data of the table as an XML. In the query, I'm just adding items below which i need be there in the XML document
    select '<test_tag>'||EMP_NAME||'</test_tag>','<date>'||sysdate||'</date>' 
    from temp_table where id_num BETWEEN 1 AND 10;
    I have need to add the root tag as well in the beginning and the end of < root > < / root > this xml file. Please advice if this is possible with the select query
    without using XMLGEN, XMLQUERY or any other packages built and function?

    I need to URL escapes with the UTF-8 code points that we have already achieved using the utl_http package. Please help how to do that without using the utl_http package.

    What is wrong with him?

    At present, the only way I can think of to avoid a call to UTL_HTTP. SET_BODY_CHARSET is to write your own little wrapper.
    In this way, you can specify the Boolean parameter or omit it if you choose to use named parameters:

    SQL> create or replace function my_url_escape (url in varchar2)
      2  return varchar2
      3  deterministic
      4  is
      5  begin
      6   return utl_url.escape(url, false, 'AL32UTF8');
      7  end;
      8  /
    
    Function created
    
    SQL> select my_url_escape('http://some.uri.com/param?lang=fr&text=contrôle') from dual;
    
    MY_URL_ESCAPE('HTTP://SOME.URI
    --------------------------------------------------------------------------------
    http://some.uri.com/param?lang=fr&text=contr%C3%B4le
     
    
  • How to publish a data in the table from another table

    Oracle forms6i

    Hai All

    I created a form in order to generate traffic. I had a problem that I can post that two data

    I have two tables, a table is created dynamically the data in the tables are extracted from the text file, and they are divided and stored fields are

    Bartime Bardate barcode

    000011 0815 01/08/2010 - it came

    000012 0816 01/08/2010

    000013 0815 01/08/2010

    000011 1130 08/01/2010 - he goes for a break

    000011 1145 01/08/2010 - it comes once again in

    000011 1650 01/08/2010

    000012 1655 01/08/2010

    000013 1645 08/01/2010 - it home

    That I need to transfer this data to the database table, the table name is dail_att and the fields are
    Code bars, timein, timeout, breakin, escape, day like I need like this

    Barcode Timein Breakin Breakout Timeout Attend_date

    000011 0815 1130 1145 1650 01/08/2010

    I tried to use some service number and rank of count, but it does not work Pls I give good solutions

    The encoding is


    declare
    The CNT number;
    bar_code varchar2 (25);
    date of bar_date;
    in_time varchar2 (25);
    out_time varchar2 (25);
    intr_intime varchar2 (25);
    intr_outtime varchar2 (25);

    Cursor c1 is
    SELECT count (*), barcode, bardate, bartime
    -ROW_NUMBER() over (order by bartime) RN
    of temp_attendance
    Group of barcodes, bardate, bartime

    order by bardate;
    Start
    To r1 c1 loop
    -Select the barcode, bardate, bartime
    -ROW_NUMBER() on the partition by barcodeorder by bartime: nurse
    -of temp_attendance
    -the Group of barcodes, bardate, bartime
    -order by bardate;

    If (cnt < = 1) then
    Select the code bar, intimate, intrtimein, introuttime, outtime, attend_date in bar_code, in_time, intr_intime, intr_outtime, out_time, bar_date from dail_att where attend_date = r1.bardate - 1;

    Update dail_att set outtime = r1.bartime where attend_date = r1.bardate and barcode is r1.barcode.;
    elsif (cnt < = 2) then
    insert into dail_att(barcode,attend_date,intime,outtime)
    values (R1. Barcode, R1.bardate, min (R1. Bartime), Max (R1. Bartime));
    -other
    -update dail_att set outtime = r1.bartime where attend_date = r1.bardate and barcode is r1.barcode.;
    end if;

    End loop;
    forms_ddl ('commit');
    exception
    while others then
    forms_ddl ('rollback');
    message(SQLERRM|| dbms_error_Text);
    message(SQLERRM|| dbms_error_Text);
    End;




    Thanks and greetings

    Srikkanth.M

    You seem to always have the same problem, but give it different titles. It would be much easier that you would hold a thread open until its resolved. The last time you had this problem that I posted the following code, it didn't help you? (Replace x and y in each if or ELSIF with the calendar you want to watch)

    CURSOR cr IS
      SELECT CODE,
             DATE,
             TIME
        FROM FROM TEMP_ATTENDANCE
       ORDER BY CODE, DATE, TIME;
    BEGIN
      FOR rec IN cr LOOP
        IF rec.TIME BETWEEN x AND Y THEN
          -- Update record for last day
          ..
        ELSIF rec.TIME BETWEEN x AND Y THEN
          -- Update record
         ..
        ELSIF rec.TIME BETWEEN x AND Y THEN
          -- Update record
         ..
        ELSIF rec.TIME BETWEEN x AND Y THEN
          -- Update record
         ..
        ELSIF rec.TIME BETWEEN x AND Y THEN
          -- Update record
         ..
        ELSIF rec.TIME BETWEEN x AND Y THEN
          -- Update record
         ..
        END IF;
      END LOOP;
    END;
    
  • Read xls file and display the data in the table.

    Hello

    Try to read the data from an xls or csv file and fill the same data in the table. If I need to use the table to store the data from the file and display, hoping that someone could help.

    Thank you

    Hari

    Hi hari,.

    One thing that is very important when you use the Excel activeX interface (in case you need it) is good termination of worksheet/workbook/lettering handles.

    You need these handles to specify what cell in which file you are trying to access.

    If you are unable to throw each handle you have, then you will be left with ghost Excel process in your task manager, devours your system's memory.

    Thus, when debugging of your application, open the Task Manager and the watch as Excel treats created/destroyed and make sure that you end up with zero Excel process running when your application is closed.

    Also consider the case of fault for your program. Check that your exit routes did not omit any termination of handle.

  • How can insert different types of data in the table?

    Hello
    How can I insert different types of data in the table, (e.g., numeric and string) in the same index of a table.

    example:
    index0 car 10 green

    car red 11 index1
    Index2 car Blue 12

    where green car red and blue car as string and 10, 11 and 12 in the numeric form.
    then I extracted 10, 11 and 12 a digital table

    and, the green car, red car, blue car in a string array

    Help!

    Use 'Analysis of the chain' as in the picture as an attachment.  This will extract the number and color that you can add tables later.

  • problem with the storage of the data in the table

    Hello

    I'm having the problem on the storage of data in the table. My problem is that whenever he makes a loop, the table just keep replacing them rather save to the next index. At 0, the value is 123, and 1 is 234. But I saw that all the data capture all crush to 0 until the last data see the 0. How can I fix this problem?


  • How to add data to the table changed in sql developer at Apex and vice versa

    Hello

    I had tables of database with sql developer. But now, I have modified the database (new tables added + changed the data in the tables). However, in the Apex, I the old database. Is it possible to get the new Apex database with the data of the table changed so this database in both places (sql and apex developer) is exactly the same... Also the other way around.

    Thank you

    The database schema that contains the tables, is it associated with the workspace even you are searching through the APEX product t development?  Why I'm asking is, if they are the same schema, the tables that you MODIFIED should be appear in the sql for APEX workshop part.  Now reports and forms will NOT see the changes (unless you have actually added or updated definitions for column).

    Can you explain what exactly you were doing the SQL Developer to the tables in your schema?

    Thank you

    Tony Miller
    Los Alamos, NM

  • 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

  • FDMEE error data import: No. periods have been identified for the loading of the data in the table "AIF_EBS_GL_BALANCES_STG".

    Hi experts,

    I tried to load the data of EBS in HFM via FDMEE.

    Importing data in the rule of loading, I have encountered an error in loading.

    2014-11-21 06:09:18, 601 INFO [AIF]: beginning of the process FDMEE, process ID: 268

    2014-11-21 06:09:18, 601 [AIF] INFO: recording of the FDMEE level: 4

    2014-11-21 06:09:18, 601 [AIF] INFO: FDMEE log file: D:\fdmee\outbox\logs\TESTING_268.log

    2014-11-21 06:09:18, 601 [AIF] INFO: user: admin

    2014-11-21 06:09:18, 601 INFO [AIF]: place: Testing_loc (Partitionkey:3)

    2014-11-21 06:09:18, 601 [AIF] INFO: name: OCT period (period key: 31/10/14 12:00 AM)

    2014-11-21 06:09:18, 601 INFO [AIF]: name of the category: real (category key: 1).

    2014-11-21 06:09:18, 601 INFO [AIF]: name rule: Testing_dlr (rule ID:8)

    2014-11-21 06:09:19, 877 [AIF] INFO: Jython Version: 2.5.1 (Release_2_5_1:6813, September 26 2009, 13:47:54)

    [JRockit (R) Oracle (Oracle Corporation)]

    2014-11-21 06:09:19, 877 INFO [AIF]: Java platform: java1.6.0_37

    2014-11-21 06:09:19, 877 INFO [AIF]: connect the file encoding: UTF-8

    2014-11-21 06:09:21, 368 [AIF] INFO: - START IMPORT STEP -

    2014-11-21 06:09:24, 544 FATAL [AIF]: error in CommData.insertImportProcessDetailsTraceback (most recent call last): File '< string >", line 2672, in insertImportProcessDetail

    RuntimeError: No periods have been identified for the loading of the data in the table 'AIF_EBS_GL_BALANCES_STG'.

    2014-11-21 06:09:24, 748 FATAL [AIF]: load balances data launch GL error

    2014-11-21 06:09:24, 752 [AIF] INFO: end process FDMEE, process ID: 268

    I found a post related to this error, but did not respond.

    I know I'm missing something, gurus please help me to overcome this error.

    ~ Thank you

    I managed to overcome this problem,

    This was caused due to an error in the map of the time.

    In the mapping of source, the name of period should be defined exactly as displayed in the EBS.

    for example: {EBS--> OCT - 14} FDMEE {mapping source--> OCT - 14}

    The names of the time must be identical.

  • delete the data in the table

    Hello

    Search page, I developed with two buttons, go and clear.and data sought are displayed in the table on the page.

    using the 'clear' button I can able to clear data from text boxes, but I want to data displayed in the table on the page must also be clear.

    Please provide assistance to achieve this.

    and iam also getting a problem more clearly by clicking the button twice, the first time it is deletion of the data, where, like the second time, it's

    What gives exception.how to prevent null pointer is not to get a null pointer exception.

    Hello

    in, click clear, you want data from the table are evacuated, do you want to text boxes to clear snow?

    You can achieve this by extending the controller and clear data that VO, so to clear the table.

    1 handle the button click clear

    If (oapagecontext. GetParameter("ClearBtn")! = null)

    2 claire VO associated table

    SVO OAViewObject = (OAViewObject) am.findViewObject ("yourVO"););

    svo.setWhereClause ("1 = 2");

    svo.executeQuery ();

    3. If you want to clear the text boxes you can use following code

    OAMessageTextInputBean mtib = (OAMessageTextInputBean) webBean.findIndexedChildRecursive ("bean_id");

    if(MTIB!=null)

    mtib.setValue (pageContext, null);

  • Button insert data to the table

    Hello

    I use APEX 4.2.3 with XE, I try to insert data into the table using code below but nothing happen when I press the button, create this button like 'create a button to point to page'-> 'dynamic action'-> 'run pl/sql '.

    begin
    insert into dummy values('xx');
    commit;
    end;
    
    

    So to clarify, you have

    (1) created a button that "action" is "defined by the dynamic action.

    (2) created a dynamic action that executes pl/sql at the click on the button and you are pl/sql?

  • How to export data from the table with the colouring of cells according to value.

    Hi all

    I use jdeveloper 11.1.1.6

    I want to export data from the table with a lot of formatting. as for color cells based on value and so much. How to do this?

    You can find us apache POI-http://poi.apache.org/

    See this http://www.techartifact.com/blogs/2013/08/generate-excel-file-in-oracle-adf-using-apache-poi.html

  • Is it possible to see/get the data from the table to a dump file

    I have files dmp generated using expdp on oracle 11 g...

    expdp_schemas_18MAY2013_1.dmp

    expdp_schemas_18MAY2013_2.dmp

    expdp_schemas_18MAY2013_3.dmp

    Can I use a settings file given below to get the data from the table in the file sql or impdp the only option to load the data of table in database.

    VI test1.par

    USERID = "/ as sysdba".

    DIRECTORY = DATA

    dumpfile=expdp_schemas_18MAY2013%S.dmp

    SCHEMAS = USER1, USER2

    LOGFILE = user_dump_data.log

    SQLFILE = user_dump_data. SQL

    and impdp parfile = test1.par.

    No,

    DataPump cannot retrieve a dumpfile data in a flat file.

    Dean

  • Choose the date of the table

    Hello

    It comes to my table
    CREATE TABLE TEMP_LEAP
      (
        "DATE_FROM" DATE
      )
    Insertion of the data in it with the procedure which takes 2 parameters of date format:
    CREATE OR REPLACE
    PROCEDURE  "T_PROC" (p_dat_from date, p_dat_to date) IS
    BEGIN
    
    
    DECLARE
    
      day       number     := 0;
      st           NUMBER := 0;
    
    BEGIN
    
    day := p_dat_to+1 - p_dat_from; 
    
    for p in 1 .. day     
               
    loop   
                    
       insert into temp_leapp (date_from) values (p_dat_from+st);    
                    
        st := st+1;  
                  
    end loop;  
               
     commit; 
    END;
    END;
    Now lets fill in the data in the table:
    execute T_PROC(TO_DATE('01.01.2010','DD.MM.YYYY'),TO_DATE('17.08.2013','DD.MM.YYYY'));
    Data are now filled in the table.

    I want to do is do a select statement that will make the following output data:
    01.01.2010 - 31.12.2011
    01.01.2012 - 31.12.2012
    01.01.2013 - 17.08.2013
    I want is to get the leap year if there is a. I only need of days in the year, so don't mind the months.

    I need to check if there is a leap year in considering the p_dat_from and p_dat_to.

    If it isn't then you will get a single record of our instruction select and values will be made of: p_dat_from - p_dat_to.

    If there is a leap year in our period we will arrive after statements (example above).

    01.01.2010 - 31.12.2011 <-first date is p_dat_from and second is the last day before the leap year
    01.01.2012 - 31.12.2012 <-this is leap year. First date is the beginning of the leap year and the last date is the end of the leap year or p_date_to (if it ends in leap years).
    01.01.2013 - 17.08.2013 <- and this is the period after the leap years.

    It is a piece of code that I fell or with up to now:
    SELECT
    MIN(date_from),
    MAX(date_from)
    FROM temp_leap
    WHERE remainder(to_number(to_char(date_from,'yyyy')),4) = 0
    union
    
    SELECT 
    
    MIN(date_from) over (partition by to_char(date_from,'yyyy')),
    MAX(date_from) OVER (PARTITION BY to_char(date_from,'yyyy'))
    FROM temp_leap
    WHERE remainder(to_number(to_char(date_from,'yyyy')),4) <> 0
    
    ORDER BY 1,2;
    OK, that's all. I hope that its understandable that I do.
    If you have a questions please ask away.

    PS is there anything I need to do. You don't have to bother with the questions "what i February is after before etc." I don't love about it. All the other logic is already fixed all I need is what I wrote above.

    Thank you.

    Published by: BluShadow on March 14, 2013 08:24
    Fixed barcode labels

    Here's a way...

    SQL> create table temp_leap(date_from DATE)
      2  /
    
    Table created.
    
    SQL>
    SQL> insert into temp_leap
      2  select date '2010-01-01' + rownum - 1
      3  from dual
      4  connect by rownum <= (date '2013-08-17' - date '2010-01-01') + 1
      5  /
    
    1325 rows created.
    
    SQL>
    SQL> commit
      2  /
    
    Commit complete.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  select min(date_from)||' - '||max(date_from)
      2  from
      3        (select date_from
      4              ,sum(leap_yr_switch) over (order by date_from) as leap_yr_switch_cnt
      5        from (
      6              select date_from
      7                    ,case when lag(leap_yr) over (order by date_from) != leap_yr then 1 else 0 end as leap_yr_switch
      8              from (
      9                    select date_from
     10                          ,case when mod(to_number(to_char(date_from,'YYYY')),400) = 0
     11                                 or (    mod(to_number(to_char(date_from,'YYYY')),4) = 0
     12                                     and mod(to_number(to_char(date_from,'YYYY')),100) != 0
     13                                    )
     14                           then 1 else 0 end as leap_yr
     15                    from temp_leap
     16                   )
     17             )
     18       )
     19  group by leap_yr_switch_cnt
     20* order by min(date_from)
    SQL> /
    
    MIN(DATE_FROM)||'-'||MAX(DATE_FROM)
    -------------------------------------------
    01-JAN-2010 00:00:00 - 31-DEC-2011 00:00:00
    01-JAN-2012 00:00:00 - 31-DEC-2012 00:00:00
    01-JAN-2013 00:00:00 - 17-AUG-2013 00:00:00
    

    Published by: BluShadow on March 14, 2013 08:51
    a slight correction in the calculation of the leap year, forgotten 100 years being does not leap.

Maybe you are looking for

  • TS_PropertySetValNumber options

    I use GetCtrlIndex() to get the index of the selected value in the control of the ring. Need for fileglobal with the index value. TS_PropertySetValNumber() takes double, is there another function or options to set the varaible with the index value? *

  • Outlook Express, asking for a username and a password

    I have changed some things with att that is my e-mail server.   When I got back to Outlook EXpress asked me an ID and a password.    Nothing works and can find no way to change this. What is the secret?

  • GPIB &amp; amp; Reading VISA queue

    I'm trying to read binary data from the GPIB or VISA. Now I have the problem that I don't know how much memory I should I allot that I can read all the data. There the entry queues where I can get the size of bytes to read? The problem is that the bi

  • Files JDE generating several COD

    All of a sudden the JDE generates a COD that line when renamed. ZIP can be extracted in several files of COD... I was not able to properly install my application via OTA or Desktop Manager. I tried to leave such original COD file, I tried to extract

  • I have a text field. I need to remove the first 8 characters of the field, leaving the remaining characters. Help?

    I have a text field. I need to remove the first 8 characters of the field, leaving the remaining characters. Help?Example:I need to remove these numbers PXXXXXX. Leaving the other characters.Thank youBob