Update rows in a remote table by synonym

Hi all

I'm new to Apex and I have searched this forum about this, but could not find.

Here's what I'm trying to do.

I have DB1, where the Apex is installed. And I want to access/update of the data in the db2 tables. Here are the steps I followed

1 created a dblink in DB1 to DB2.
2. created synonym in DB! remote table TableA to DB2. create synonym tablea_syn for tablea@dblink1;
3. now through the Apex object browser, I would be able to update/insert/delete records in tableA@dblink. Then, I selected synonyms in the object browser, but not able to see all the lines that are present in tableA@dblink1. I'm Basel to see lines using Toad.
Is it possible to put day/remove or insert new lines into remote tables using synonyms thru Apex?

Please help me with this problem.

Thanks in advance.

Salvation (what is your name?)

I took a peek in your application and I have corrected and tested an update. You have a few syntax errors, and I don't blame you because I already had them when I posted the code. I wanted to write a quick pseudo-code and you have to change accordingly. In any case, it's working now, and here are a few syntax errors, I found:
1. When you want to refer to an element of the apex in a SQL, it must begin by ":", for example: P1_EMP_NAME
2 - the keword 'from' was missing in the inert training
3 make sure create you processes in the logical right place, your submit the process that happens after the location header! which means that it will take place the first thing in your page, and it's wong. usually this type of process must be placed in the last section of process (on submit after validation... etc)

Hope you feel better now,

Thank you
Sam

Tags: Database

Similar Questions

  • Poor performance during the iteration/update rows of a tree table

    Hello

    We have a tree table based on a VO and EO (with transitional attributes). One of the attributes is an indicator.
    The original Version is filled with a complex query with several thousand lines.

    Now, when the user clicks on a node, all children are updated (their flag is set to true) recursively.

    It's really really slow. It may take several minutes, while a similar update via PL/SQL on a real table would take a few seconds.

    Is it possible to improve the performance? We have already applied all the tunings on EO as VO mentioned in the Oracle Documentation, but they had almost no effect:
    -keep the viewlink iterators set line
    -indicators of query
    -Use the batch update

    The algorithm we use is the following:
        private void checkTreeNodes(JUCtrlHierNodeBinding node, Boolean check) {
            if (node == null) {
                return;
            }
    
           TreeVORowImpl nodeRow = (TreeVORowImpl)node.getRow();
            if (nodeRow != null) {
                    nodeRow.setFlag(check);
            }
    
            List<JUCtrlHierNodeBinding> children = null;
            if (!nodeRow.getLevel().equals("4"))  // no more than 4 levels
                children = node.getChildren();
    
            if (children != null) {
                for (JUCtrlHierNodeBinding _node : children) {
                    checkTreeNodes(_node, check);
                }
            }
        }

    Hello

    try to move the logic of the definition of the transitional indicator at the service of the company (method exposed on the client interface) and then refresh the tree instead of a record thousand on the client component analysis.

    Frank

  • Create a db with a simple form application, based on a remote table

    Hello

    I have APEX 4.0 installed on my laptop and a distant DB (always in my local network) with EBS R12 on it.
    I created a dblink with my HR schema and updated my tnsname.ora. Now I can connect and browse the remote db with schema APPS/APPS.
    I can also browse table away from my local db user 'HR '.

    for example: select * from emp@apex_dblink; recover data without problem even if I'm a developer sql or standard interface of APEX with my APEX user.

    As a training, now I want to create an application database from scratch on a tabular presentation with the HR schema. When I browse for the table, I don't see my table 'emp' remote and when I push the "emp@apex_dblink" research, he said only: "emp@apex_dblink is not a valid table name.".

    Some have said, it is because of the 'grant privilege' and 'create the synonym' but I don't know if like my dblink I should think to solve this problem...
    In addition, I do not know much about the administration and do not know where to go...

    Here is some information:

    DB user: hr/hr@XE
    APEX user: ulrich/ulrich-> name of the workspace: APEX_WORKSPACE

    That's your time and your response.

    ARO

    Ulrich

    Apex gets his table & veiw your local database catalog definitions. Are two ways to do what you want:
    (1) create copies of the tables/views you want and create your forms & reports based on these tables/views. Once you have your app work (at least the table/view definitions are now known to Apex), delete local tables and replace them with synonyms for remote tables.

    -- run in local Apex database
    drop table emp;
    -- I'd recommended naming your DB link after the remote DB name to keep easy track of where it's pointing
    -- create database link EBSPROD connect to HR using HR123 identified by 'EBSPROD.world';
    -- or include the schema name if you need multiple DB links to that remote DB
    -- create database link EBSPROD@hr connect to HR using HR123 identified by 'EBSPROD.world';
    -- create database link EBSPROD@scott connect to scott using tiger identified by 'EBSPROD.world';
    -- select * from emp@EBSPROD@scott;
    
    create or replace synonym EMP for EMP@apex_dblink;
    

    (2) create local views to remote objects. Apex point to these points of view the.

    -- run in local Apex database
    create or replace view EMP as (select * from EMP@apex_dblink);
    

    Published by: maceyah on March 3, 2011 09:04

  • Using Merge in oracle 11g this error SQL Error: ORA-30926: failed to get a stable set of rows in the source tables

    whenever I run this code I get this error

    SQL Error: ORA-30926: failed to get a stable set of rows in the source tables

    30926 00000 - "impossible to get a stable set of rows in the source tables.

    * Cause: A stable set of rows could not be achieved due to the large dml

    activity or one not deterministic where clause.

    * Action: Remove any non deterministic of the clauses and reissue of the dml.

    Don't know wht goes wrong!


    SQL:

    MERGE IN VENDORS_ACTIVE_DATE s

    USING (nvl (d.VENDOR, s.VENDOR) selection of the SELLER,

    NVL (d.COMPANY_CODE, s.COMPANY_CODE) COMPANY_CODE.

    (case when ((d.VENDOR = s.VENDOR) and (d.COMPANY_CODE = s.COMPANY_CODE)))

    )

    then "MATCH".

    When d.COMPANY_CODE is null

    then 'DELETE '.

    When s.COMPANY_CODE is null

    then "INSERT."

    else 'UPDATE '.

    chck end)

    from (select * from VENDORS_ACTIVE_DATE where COMPANY_CODE = 2) s

    full outer join (select * provider where COMPANY_CODE = 2) d

    on (d.COMPANY_CODE = s.COMPANY_CODE AND s.COMPANY_CODE = 2)

    ) d

    WE (d.COMPANY_CODE = s.COMPANY_CODE AND d.chck in ('UPDATE', 'GAME', 'DELETE'))

    WHEN MATCHED THEN

    UPDATE SET s.VENDOR = d.VENDOR

    WHERE d.chck in ('UPDATE', 'DELETE')

    DELETE WHERE d.chck = 'DELETE '.

    WHEN NOT MATCHED THEN

    INSERT (SELLER, COMPANY_CODE)

    VALUES (d.VENDOR, d.COMPANY_CODE)

    Work request: (deleted the duplicate data in tables (source and target))

    MERGE IN VENDORS_ACTIVE_DATE s

    USING (nvl (d.VENDOR, s.VENDOR) selection of the SELLER,

    NVL (d.ACTIVEDATE, s.ACTIVEDATE) ACTIVEDATE.

    NVL (d.COMPANY_CODE, s.COMPANY_CODE) COMPANY_CODE.

    (case when ((d.VENDOR = s.VENDOR))

    - AND D.ACTIVEDATE = S.ACTIVEDATE

    and NVL (d.ACTIVEDATE, trunc (sysdate)) = NVL (s.ACTIVEDATE, trunc (sysdate))

    and (d.COMPANY_CODE = s.COMPANY_CODE)

    )

    then "MATCH".

    When d.COMPANY_CODE is null

    then 'DELETE '.

    When s.COMPANY_CODE is null

    then "INSERT."

    else 'UPDATE '.

    chck end)

    from (select * from suppliers where COMPANY_CODE = 2) d

    full outer join (select * from vendors_active_date where COMPANY_CODE = 2) s

    on (d.COMPANY_CODE = s.COMPANY_CODE and s.vendor = d.vendor)

    ) d

    WE (d.COMPANY_CODE = s.COMPANY_CODE AND d.VENDOR = s.VENDOR AND d.chck in ('UPDATE', 'GAME', 'DELETE'))

    WHEN MATCHED THEN

    S.ACTIVEDATE = UPDATE SET d.ACTIVEDATE

    WHERE d.chck in ('UPDATE', 'DELETE')

    DELETE WHERE d.chck = 'DELETE '.

    WHEN NOT MATCHED THEN

    INSERT (VENDOR, ACTIVEDATE, COMPANY_CODE)

    VALUES (d.VENDOR, d.ACTIVEDATE, d.COMPANY_CODE)

  • FUSION IN: ORA-30926: failed to get a stable set of rows in the source tables

    Hi all

    Database Oracle 12 c Enterprise Edition Release 12.1.0.1.0 - 64 bit Production 0

    PL/SQL Release 12.1.0.1.0 - Production 0

    CORE 12.1.0.1.0 Production 0

    AMT for 64-bit Windows: Version 12.1.0.1.0 - Production 0

    NLSRTL Version 12.1.0.1.0 - Production 0

    When you use the MERGE clause, if executed more than once, I get the below error

    ORA-30926: failed to get a stable set of rows in the source tables

    create table CBC (nums number, sname varchar2 (10))

    create tar (tnum number, tNom varchar2 (10)) table

    Insert in src values (1, 'a')

    Insert in src values (1, 'b')

    Insert in src values (2, "c")

    merge into tar

    using the CBC

    on (nums = tnum)

    when matched

    then

    update the value tNom = sname

    When not matched

    then

    Insert the values(snum,sname);

    What expect, it's that first time itself (when inserted), he must raise the error. But it's not.

    Select * from tar

    TNUM TNOM

    1 b

    1 a

    2 c

    But if we run for the second time it shows the error.

    I saw the document of the Oracle and he said

    MERGEis a deterministic statement. You cannot update the same row in the target table multiple times in the same MERGE statement.

    I've seen below cela son but failed to get the solution for this.

    MERGE STATEMENT ORA-30926: failed to get a stable set of lines in the source

    Nondeterministic fusion?

    Someone at - it make a clarification?

    I don't want to insert records into the first time itself. for example, to run the first time he must raise the error. can I do this using MERGE?

    Thank you

    Hello

    O - O wrote:

    Thanks knani, Frank.

    One more doubt.

    When you run the MERGE statement, the first time, there is no rows in the target table, so no rows in the target table is what it is.

    So we cannot perform below sqls using MERGE when the target table is empty?

    insert into tar values (1, 'a')

    updated tar tNom = 'b' set where tnum = 1

    insert into tar values (2, "c")

    Is - that means that the MERGER will be only works with validated data?

    Right; a MERGE statement will not update a line which has been previously inserted into the same MERGE statement.  All fact tables reference to the data in the tables by the time the MERGER began.

  • Update of a column of table from xml data

    Hello

    I have an obligation to update a particular table from xml data column. to do this, I wrote the code below but I am not able to insert. could you please a peek into that.

    create table emp3
    as
    select *From emp
    where 1=1;
    
    alter table emp3
    add (fax_response varchar2(50));
    
    /*create sequence EmailRecords_XMLFILE_SEQ
      minvalue 1
      maxvalue 999999999999999999999999999
      start with 1
      increment by 1
      nocache;*/
    
    /* create global temporary table EmailRecords_XMLFILE
      (
      ID NUMBER not null,
      xmlfile CLOB
      )
      on commit preserve rows;*/
    
    /* create global temporary table UPD_Email_Records_With_Xml
      (
      id NUMBER not null,
    
      response VARCHAR2(500)
    
      )
      on commit preserve rows; */
    
    
    

    the XML data is

    <FAX>
    <EMAILOG>
    <ID>7839</ID>
    <RESPONSE>FAX SENT</RESPONSE>
    </EMAILOG>
    <EMAILOG>
    <ID>7566</ID>
    <RESPONSE>FAX NOT SENT</RESPONSE>
    </EMAILOG>
    </FAX>
    
    
    

    CREATE OR REPLACE PROCEDURE proc_upd_email_records (
       loc_xml          IN       CLOB,
       p_err_code_out   OUT      NUMBER,
       p_err_mesg_out   OUT      VARCHAR2
    )
    IS
       loc_id   NUMBER;
    BEGIN
       loc_id := emailrecords_xmlfile_seq.NEXTVAL; --created sequence
    
    
    
       INSERT INTO emailrecords_xmlfile --created Global Temp table
                   (ID, xmlfile
                   )
            VALUES (loc_id, loc_xml
                   );
    
       COMMIT;
          insert into UPD_Email_Records_With_Xml --created Global Temp table
            (ID, RESPONSE)
            select x1.id,
    
                      x1.RESPONSE
              from EmailRecords_XMLFILE,
                   xmltable('/FAX/EMAILOGID' passing
                            xmltype.createxml(EmailRecords_XMLFILE.xmlfile)
                            columns header_no for ordinality,
                            id number path 'ID',
                            RESPONSE VARCHAR2(250) path 'RESPONSE'
    
                               ) x1
             where EmailRecords_XMLFILE.id = loc_id;
       COMMIT;
    
       UPDATE emp3 er
          SET er.fax_response = (SELECT response
                               FROM upd_email_records_with_xml pr
                              WHERE pr.ID = er.empno)
        WHERE er.empno IN (SELECT ID
                             FROM upd_email_records_with_xml);
    EXCEPTION
       WHEN NO_DATA_FOUND
       THEN
          raise_application_error
             (-20000,
              'Sorry ! The Xml File which is passed is empty. Please try with Valid Xml File. Thank you!!! '
             );
       WHEN OTHERS
       THEN
          p_err_code_out := 4;
          p_err_mesg_out := 'error in insertion=> ' || SQLERRM;
    END proc_upd_email_records;
    {code}{code}
    
    
    

    Someone suggest me a slightly easier way to insert data...

    Thank you...

    You're complicating things

    A simple MERGE statement will do.

    create or replace procedure (proc_upd_email_records)

    loc_xml in clob

    )

    is

    Start

    merge into e emp3

    a_l'_aide_de)

    Select id

    response

    from xmltable)

    "/ FAX/EMAILOG.

    by the way xmlparse (document loc_xml)

    the columns id number way "ID".

    , path of varchar2 (250) response 'RESPONSE '.

    )

    ) v

    on (e.empno = v.id)

    When matched then update

    Set e.fax_response = v.response

    ;

    end;

    /

    But there is no value added by using these temporary tables if you are not at least an intermediate XMLType column (storage preferably binary XML).

    -What is the input XML code?

    -What is the version of db?

  • Update the values in the Table from another Table containing historical data

    So, I have two tables, a table and a master table.  The current table is updated each week and at the end of the week, is copied to the main table to keep historical data.  I have update the table in progress early in the week and want to take the latest data from the master table and update the current table with the data.  The current table could have additional IDs or some of the IDS could have deposited (these lines would receive data in the main table).  I want to only update the rows in the current table that have existing data to the attr1, attr2, attr3 columns.  A particular ID may have more than one record in the primary table, I want only the last disk to use for updating the current table.  The data from a different database where no direct connection is possible then I have to import data every week.  Here are some statements of create/insert:

    create table current_T (ID1 varchar(100),adate date,attr1 varchar(100),attr2 varchar(100),attr3 varchar(100))
    

    create table Master_T (ID1 varchar(100),adate date,attr1 varchar(100),attr2 varchar(100),attr3 varchar(100))
    
    

    begin
    insert into current_T (ID1,adate)
    values ('IE111','08/02/13');
    insert into current_T (ID1,adate)
    values ('IE112','08/02/13');
    insert into current_T (ID1,adate)
    values ('IE113','08/02/13');
    
    insert into master_T (ID1,adate,attr1,attr2,attr3)
    values ('IE111','08/01/13','yes','abc','123');
    insert into master_T (ID1,adate,attr1,attr2,attr3)
    values ('IE112','08/01/13','no','dgf','951');
    insert into master_T (ID1,adate,attr1,attr2,attr3)
    values ('IE113','08/01/13','no','dgf','951');
    insert into master_T (ID1,adate,attr1,attr2,attr3)
    values ('IE113','07/01/13','no','dgf','951');
    end;
    

    This has been a scratcher for me head and any help would be greatly appreciated.  I'm coding in Apex 4.1

    Thank you

    -Steve

    Not tested

    merge into current_t c

    using (select *)

    Of

    (select m.*

    row_number() over (partition by m.id1 m.adate DESC order) rn

    of master_t m

    )

    where rn = 1

    ) u

    on (c.id1 = u.id1)

    When matched then update

    Set c.adate = u.adate

    c.attr1 = u.attr1,

    c.attr2 = u.attr2,

    c.attr3 = u.attr3,

    When not matched then insert

    (c.id1, c.adate, c.attr1, c.attr2, c.attr3)

    values

    (u.id1, u.adate, u.attr1, u.attr2, u.attr3)

    ;

  • Cannot perform the insert/update on the form of tables, due to the dynamic action

    Hi all

    I created a dynamic action that calculates multiple cells in a table.

    This feature works well, when I change the value of the associated cell then the computed value is changed by the dynamic action.

    But I am not able to insert or update the line in a table when the dynamic action is enabled. When I put the condition 'Never', then the line is inserted or updated without any problems.

    All guess where is the problem?

    Apex version: 4.1.1.00.23

    Jiri

    Nina wrote:

    I don't know why the 123,40 value (or other) is set to the next item in line (f09, fsc, etc.)
    >

    What is hidden and generated Apex elements are always included in the last cell (td) of the line. Thus, it has nothing to do with the next item, only the last cell.
    If you see the last cell of the 888 Page you will see probably the same type = "hidden" entries here also.

    Your problem is not related to the HTML fragment to the last cell in the row showing all those extra items, it's somewhere else.

    Oh, here comes the jQuery selector:

    var clickedRow = $(this.triggeringElement).closest('tr');
    
    $(clickedRow).children('td[headers="SAL"]').find("input").val(myCalculatedTotal);
    

    SAL, COMM, w/e. here you will find the TD with headers = "COMM" and all the input fields and the value of all the entries in total calculated. Your selection is not precise enough in this case.
    So, target the specific entry.
    With the code example:

    
    
    
    
    
    
    
    
    

    change the switch on

    $(clickedRow).children('td[headers="SAL"]').find('input[name="f08"]').val(myCalculatedTotal);
    
  • collection of statistics on a remote table

    Hello

    Is it possible and how to collect statistics on remote tables of non-Oracle?
    In my set up an Oracle Server (11g r2) is connected to an Oracle Server remote gateway to Oracle and DB2 server through ODBC gateway. All queries are distributed and heterogeneous, that is, the access data of the two remote servers. The query optimizer uses the real on remote tables from Oracle statistics, while for DB2 tables some default values are used. The difference between the default values and actual statistics is huge.
    I found in a user's guide this column selectivity cannot be collected for tables non-Oracle. Is it possible to collect general statistics such as number of rows from the tables? It would be different if I use DRDA gateway to access DB2?

    Concerning

    Ruslan,
    The HS_FDS_SUPPORT_STATISTICS = TRUE parameter is supported using DG4ODBC, even if it is not documented. However, as already said it depends on the ODBC driver and the database non-Oracle to what is returned when set.
    To see if it is used by the pilot, then check track of debug gateway. With the parameter set to true, then you should see explicit SQLStatistics ODBC calls. If these are not present then the parameter is to have no effect. You can also view an ODBC trace for these calls.

    Kind regards
    Mike

  • Impossible to get a stable set of rows in the source tables

    Hi guys,.

    I use the following query to fusion in a stored procedure.
       MERGE INTO tt_OPEN_IN_TMP B
       Using (Select * From Tt_Sl_Fifo) A 
       ON ( A.Store_Code = B.Store_Code
         AND A.item_code = B.item_code
         And A.Packing = B.Packing
         And A.Serial_No = B.Serial_No )
       When Matched Then Update Set Opn_Fifo_Cost = A.Rate_Bc;
    The procedure raises error * "Unable to get a stable set of rows in the source tables" * as a result of the query. But if I run the query individually, it works very well. Please help me solve this problem.

    Thank you
    RAM.

    The error is due to what there is in double store_code, item_code, packaging, combination of serial_no in the Tt_Sl_Fifo table. If there are multiple records with the same store_code, item_code, packaging, serial_no Oracle has no way to determine which to use for the update. If you know that there is whenever duplicates they will all have the same column of rate_bc then instead of using

    (select * from tt_sl_fifo)
    

    use

    (select distinct store_code, item_code, packing, serial_no, rate_bc from tt_sl_fifo)
    

    Or if there is other criteria, like a date column, you can use to determine what is the one you want to use to day then you can use something like

    (select store_code, item_code, packing, serial_no, rate_bc from tt_sl_fifo
      where (store_code, item_code, packing, serial_no, add_date) in
           (select store_code, item_code, packing, serial_no, max(add_date)
              from tt_sl_fifo group by store_code, item_code, packing, serial_no))
    
  • Display and update of fields in different tables on the same page.

    I am facing two problems...

    (1) I have a report on which I show several fields of 4 different tables. For each row of data, there is a link to change on the first column. By clicking on the link change, I show you a form where I want to show the respective data. On the link change, even if I send you the data in the report, they do not appear on the form (what edit link is clicked). Also, there is only room for 3 items to ship through the link change.
    How to display the data correctly on the form? Is there another way to use the link change?

    (2) on the form, how do I update the data from different tables?

    Thank you

    Gargi

    Hi Lisa,

    The text of presentation on the INSTEAD OF triggers is in: [http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7004.htm#sthref7918]

    First of all, your SQL View contains a unique key so that your triggers and the two Apex know what is updated.

    Then, you can create instead of triggers for "instead of INSERT ON viewname", 'instead of UPDATE ON viewname' and 'DELETE ON viewname' on your SQL view. What do these triggers depends on what you need. In the trigger code, you refer to new data using: NEW.column_name and old data using: OLD.column_name (updates both: OLD and: NEW values).

    I'm not sure of the SEPARATE, the GROUP IN question. You would certainly have a unique key on each record. It could be that the DISTINCT or GROUP BY clause will have to be taken out of the SQL view and is part of the source of the region, so that the SQL view does nothing with the data other than to join several tables in a single "table" from the Primary Key/Foreign Key relationship.

    Andy

  • Download massive updated the planned orders in table msc_supplies

    Hi all

    I need your suggestion below requirement:

    For item RM, we planned order suggested that the CPHA; before releasing it, we want to change Date of implementation and the amount of order, then output the last modified scheduled released automatically to create the PR in purchases & Payables.

    In order to change the planned orders of RM, we export order planned the Workbench of the CPSA in the worksheet and then change dates, quantity, etc. in the worksheet. We want this change data to insert in the table msc_supplies automatically with manually intervene them and followed by releasing these planned automatically orders to create a PR

    We want to know how to achieve this requirement. We want to know the available custom hook and script to insert record in to msc_supplies.

    Have a great day.

    Thank you

    Sanngo

    Hello

    We expect steps below:

    (1) export the planned RM command suggested by the CPSA to the spreadsheet or report.

    (2) prepare the csv file with mandorty field as shown below in the table, i.e. date, quantity, etc. and format the data according to the custom intermediate table created.

    (3) custom concurrent requests created, which is used to locate the data file and upload the data to a custom intermediate table.

    (4) of the intermediate table that we are download the same data in the database MSC_SUPPLIES table (make a validation here check) in the same program. After that a manually scheduled commands added to the table of MSC_Supplies and can be found in the CPSA workbench.

    (4) in the same concurrent application of custom, call "automatic rejection" to release these records of the base table of msc_supplies, where release_flag a value of 1.

    We want to know the required fields need to be updated in the staging table custom and the base table:

    ORGANIZATION_CODE

    ORGANIZATION_ID

    ITEM_SEGMENTS

    INVENTORY_ITEM_ID

    ORDER_TYPE_TEXT

    ORDER_TYPE (5)

    New Date

    FIRM_DATE

    New quantity

    FIRM_QUANTITY

    Argument Plan_ID

    Transaction_id

    RELEASE_STATUS (1)

    SR_INSTANCE_ID

    You can test adding the manually planned adhoc decrees on Workbench CAWC namely, which are updating fields in the MSC_SUPPLIES table.

    Have a great day.

    Thank you

    Sannago

  • Update multiple columns from multiple tables in a single UPDATE request

    Hello

    I'm trying to figure if I'm heading in the right direction.

    I want to update multiple columns from multiple tables in a single UPDATE request. Also, I would like to update multiple columns in a table from the tables.

    Scenario 1

    UPDATE Table2, Table 3
    SET T2.Column1 = T1.Column1 
    ,T2.Column2 = T1.Column2
    ,T3.Column2 = T1.Column2
    FROM Table1 T1, Table2 T2, Table3 T3
    WHERE T1.id = T2.id
    and T1.id = T3.id
    
    

    Scenario 2

    UPDATE Table3
    SET T3.Column1 = T1.Column1 
    T3.Column2 = T1.Column2
    ,T3.Column3 = T2.Column3
    ,T3.Column4 = T2.Column4
    FROM Table1 T1, Table2 T2, Table3 T3
    WHERE T3.id = T1.id
    and T3.id = T2.id
    
    

    Hello

    For scenario 1, you must write separate instructions UPDATE table2 and table3.

    To guard against someone else change one of these tables while you act so you can copy all relevant data in a global temporary table and update this global temporary table table3.

    ENGAGE only when two tables have been changed.

    You can write a procedure or an INSTEAD OF trigger to do all this.

    For scenario 2, you can reference many tables that you need when new table3.  It might be more efficient and simpler to use the MERGER rather than UPDATED.  For example:

    MERGE INTO table3 dst

    WITH THE HELP OF)

    SELECT t1.id

    t1.column1

    t1.column2

    t2.column3

    t2.column4

    FROM table1 t1

    JOIN table2 t2 ON t1.id = t2.id

    )             src

    WE (dst.id = src_id

    WHEN MATCHED THEN UPDATE

    SET dst.column1 = src.column1

    dst.column2 = src.column2,

    dst.column3 = src.column3,

    dst.column4 = src.column4,

    ;

  • How to rename the table or synonym?

    Hi all

    11.2.0.1

    I want to rename the table or synonym owned by HR as a SYS user.

    SQL > rename hr.emp in hr.emp_old;

    *

    ERROR on line 1:

    ORA-01765: specifying the name of the owner of the table is not allowed

    Thank you very much

    zxy

    Hello

    You can do something like that as a user of the SYSTEM:

    1 alter session set current_schema = "HR".

    2. Rename emp emp_old

    Thank you &

    Best regards

  • Presentation tabular - when the updated row, add a user id and a time stamp line.

    Hello.
    I have a simple tabular presentation based on a table of four elements: the primary key (seq #), title, Updated_by, Updated_timestamp.
    I want to fill the Updated_timestamp and updated_by fields when a user updates or adds to the table.
    On other forms, I use a calculation to update the page_item in section page_processing of the APEX. However, in the form of tables, I don't know
    where I can update these two fields.
    Any suggestions?

    Thank you! I think the trigger is the way to handle this. Thanks again.

Maybe you are looking for

  • Satellite L350 - 17Q - Manager of storage on XP Intel?

    Hi all To be sure: -in the BIOS, I can put only SATA - AHCI or Compatible-XP runs only when the value that is compatible with SATA-Intel Storage Manager runs only when the SATA RAID or AHCI-So I can't launch the Intel Storage Manager Right? (if not f

  • Running OS 10.10.5 and have the popup MacKeeper in Safari and want to eliminate

    Trying to get rid of the popup MacKeeper

  • 00cx0000022

    Why my computer always after updates Configuration fails to start with error Windows Explorer is not responding, but allows me Internet

  • Play all the / Play list

    I assume from the lack of response to a previous post that there is no function 'play together' on the Jam music video. I find the ability to use Windows Media Player to play lists created insanely hard.  I would just ask if there is a fairly simple

  • Dimensions GROSS a7S

    All of the RAW files on my camera are coming as 2768 x 1848. How can I set up the camera to make great RAW format? Thank you!