Updating a table binded to a database

HI,
I am using a table binded to a table inside a database. How can the database be updated when a new row is added to the database. I am using the persist command in a separate session EJB to add the new row.
thanks
Ray

you mean how can the datatable be updated when the database is updated.
Use Ajax to poll for a change I suppose. Perhaps you could set a session variable or something that says that the data is dirty, check that value through an Ajax call and then refresh the datatable when the variable is true (don't forget to set the variable to false again, or else the table keeps updating!)

Similar Messages

  • Listening to change in a row of a table a and update a table in a diferent Database

    i want to update a table using values from a different database table. how to i do it in SQl 2012

    i want to update a table using values from a different database table. how to i do it in SQl 2012
    With Service Broker?
    Without Service Broker, you would do:
    UPDATE targettbl
    SET    col1 = b.col1,
           col2 = b.col2,
    FROM   targettbl a
    JOIN   srctbl b ON a.keycol1 = b.keycol1
                   AND a.keycol2 = b.keycol2
    It is important that a row in targettbl maps to at most at one row in srctbl, or else the result will not be predictable.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Updating FND table owner password after database import/export?

    We created a reporting instance from our production environment, and moved the EUL to a new schema through a database export/import process - not the Discoverer Administrator export/import process. The password associated with the owner of the FND tables is embedded within the EUL in production. When this was moved to a new schema in our reporting instance, this password "came with" the EUL. However, the password for the FND table owner is different in the reporting instance than it is in production. Is there any way to update this after the fact for the owner of the EUL?
    Here's what happened: EUL_OWNER1 is the owner of the Applications mode EUL in production. The copy was taken of production to create the reporting instance. At that time, EUL_OWNER2 was created in the reporting instance, and the tables and data owned by EUL_OWNER1 was exported and imported into EUL_OWNER2. The reason that we did this was to lock down security and keep people from running reports against production, hindering the performance of the overall system. The APPS password (which owns the FND tables), which was required when creating the EUL_OWNER1 EUL in production, is different in the reporting instance. When you log into Discoverer Administrator as EUL_OWNER2 and try to validate folders, you get "ORA-00942: table or view does not exist" errors for all of your tables. Basically, that user cannot view those tables because it does not have the appropriate APPS password.
    Can this be updated somehow? Or do I have to re-create the EUL for EUL_OWNER2 by using the Discoverer export/import functions? Thanks.
    Meredith

    Hi,
    I don't think the FND password is embedded in the EUL tables. What you will have lost by moving the EUL through a database export/import is all the grants that gave the EUL owner access to the FND tables and other Apps objects. These can be reapplied at the database level. However, the EUL owner does not actually need access to the tables that are mapped into the EUL as you can refresh these when you connect as an Applications user.
    Hope that helps,
    Rod West

  • Updating SYS.USER password field across databases

    Hello -
    I am trying to update the password field across four SYS.USER tables in four different databases. All databases have the same host name/IP address, but each has a distinct service_name and password.
    A web application updates the inital USER table (password field). But three other databases are connected to the website in question and the USER table for each must match up with the initial USER table that has been updated.
    Is a trigger best, or a stored procedure, or replication, or other? Or is there a way to link tables? How do I include the connection info (service name and db password) in the code that updates the table in a given database?
    I hope that I am simply making this more complicated than it needs to be. Either way, any help is greatly appreciated.
    Ann

    yep,
    I faced this behavior too, and the only way to fix it, is forcing the user to re-type the password.

  • Reg: How to automate updation of tables between two oracle DB Instances

    Hi All,
    I have a requirement to auto update the tables between two oracle database instances. What are the possible solutions to handle this kind of situations.
    Please help me out in identifying the correct solution.
    Thanks in advance :)

    The possible solutions are outlined in the distributed database documentation
    They are
    a) trigger (6.0 and higher)
    b) advanced replication. Creates triggers on every table. Requires every table to have a primary key (8.0 and higher)
    c) Streams (Uses logminer, has no impact on table. Requires every table to have a primary key, or supplemental logging will be used. (9.0 and higher)
    d) Change Data Capture: superset of Streams (9i and higher).
    If you don't require realtime updates you don't need c or d. b is difficult to manage. Using a) the source db can potentially have to wait for the target db to complete it's transaction.
    Sybrand Bakker
    Senior Oracle DBA

  • How to update a table in database

    Hi.
    i am working on HR system. I have developed a form of report engine. Report Engine form contains no any database table but text items, buttons and options.
    I have placed a button and in its when button press triger i wrote a procedure to update a table record as:
    Update Empbiodata
    Set Status = 'Retired'
    Where Status = 'On Duty'
    but that button is not updating the database record. when i add a line of Commit_form, after that i faced the error message there is no change to save.
    I have run this code on SQL prompt and saw working well.
    please solve the problem that why this code is not working in button press trigger in the form.
    thnx

    Hi Zaheerms,
    You can do this kind of updates in the Forms.
    I will help u in this scenario.
    1st tell me the update column is a database item or not ?
    Sample code :
    begin
    Update Empbiodata
    Set Status = :block.column_name --'Retired'
    Where Status =:block.column_name -- 'On Duty'
    commit;
    -- For checking message
    fnd_messahe.set_string('Testing'||:block.column_name);
    fnd_message.show;
    end;
    and give some condition as per ur requirement.
    I think so this will help you.
    If not post again and i will try to clarify you.
    thanks,
    SIvaprasad

  • Progammatic update a table with a database view  in the page

    Hi All,
    I am using JDev 11g. With FOD database schema, I have one database view Products which comes from two tables Products_Base and Product_Transactions. I created three EOs (ProductEO, ProductsBaseEO, ProductTransactionsEO) and three VOs (ProductVO, ProductsBaseVO, ProductTransactionsVO) based on their EOs respectively.
    Here is my scenario. I have an ADF form which is based on the database view Products and is dragged and dropped from Data Controls->ProductVO. When an existing record is submitted, a backing bean method will be called to update the data against the table Products_Base (and the table Product_Transactions at the same time) programmatically. An update method updateProductPrice() is added into the Application Module and published it to UI Client. The submit button in the page is created by directly dragging and dropping Data Controls->updateProductPrice into the page. When I run it, I got the following error message,
    Failed to post data to database during "Update": SQL Statement "UPDATE PRODUCTS ProductEO SET COST_PRICE=:1 WHERE PRODUCT_ID=:2".
    What I don't understand here is that, in my update method updateProductPrice(), it supposes to update the table Products_Base. But from the error, it appears that it is trying to update the view Products. Can anyone give me a help on what I did wrong here? When I try to debug it, it throws an exception to this line in the method updateProductPrice(),
    getDBTransaction().commit();
    Here are my codes,
    The method which got called in the backing bean
    public String cb6_action() {
    DCBindingContainer bc = (DCBindingContainer)getBindings();
    FacesCtrlAttrsBinding ProductId = (FacesCtrlAttrsBinding)bc.get("ProductId");
    FacesCtrlAttrsBinding CostPrice = (FacesCtrlAttrsBinding)bc.get("CostPrice");
    JUCtrlActionBinding action =
    (JUCtrlActionBinding)bc.findCtrlBinding("updateProductPrice");
    DCDataControl dc = action.getDataControl();
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    AppModule service = (AppModule)am;
    service.updateProductPrice(new Long(ProductId.toString()), CostPrice.toString());
    return null;
    public BindingContainer getBindings() {
    return BindingContext.getCurrent().getCurrentBindingsEntry();
    The update method defined in the Application module (AppModuleImpl.java)
    public void updateProductPrice(long productId, String costPrice) {
    ProductsBaseEOImpl product = retrieveProductById(productId);
    if (product != null) {
    try {
    product.setCostPrice(new Number(costPrice));
    getDBTransaction().commit();
    catch (JboException ex) {
    getDBTransaction().rollback();
    throw ex;
    catch (SQLException ex1) {
    getDBTransaction().rollback();
    private ProductsBaseEOImpl retrieveProductById(long productId) {
    EntityDefImpl productDef = ProductsBaseEOImpl.getDefinitionObject();
    Key productKey = ProductsBaseEOImpl.createPrimaryKey(new DBSequence(productId));
    return (ProductsBaseEOImpl)productDef.findByPrimaryKey(getDBTransaction(),productKey);
    Edited by: john wang on Oct 27, 2009 7:14 AM

    or
    merge into test
    using (select rowid rid
                , id
                , sub_id
                , startdate
                , lead (startdate) over (order by id, sub_id) - 1 ed
           from test) x
    on (x.rid = test.rowid)
    when matched then
       update set end_date = x.ed
    ;

  • How to bind JtextFields in Swing to Table fields in the database

    Can some one give the code of how to bind JtextFields in Swing to Table fields in the database
    Am really new to java programming and have interest in learning

    The standard JDK doesn't do this for you. If you search on Google, you may find some 3rd party packages that will do this.
    You need to create your own form add execute the appropriate SQL yourself. Read the tutorial on [url http://java.sun.com/docs/books/tutorial/]JDBC Database Access to get started.

  • Is it necessary to update scope_info and scope_config when adding columns to a table in a provisioned database?

    I followed the example provided in
    https://jtabadero.wordpress.com/2011/04/13/modifying-sync-framework-scope-definition-part-3-workarounds-addingremoving-columns/ to add columns to a table in a provisioned database.  The sample code replaces the stored procedures triggered when the
    table is updated with new stored procedures which include the additional columns
    However, the sample does not update scope_config. When I am finished, the new columns do not appear in the scope config.  Looking at the SQL code it is immediately obvious why.  Here is an excerpt from the beginning of the query
    DROP PROCEDURE [PATIENT_insertmetadata];
    DROP PROCEDURE [PATIENT_updatemetadata];
    DROP PROCEDURE [PATIENT_deletemetadata];
    -- BEGIN Enable Snapshot Isolation on Database 'PatScan' if needed
    IF EXISTS (SELECT NAME FROM sys.databases where NAME = N'PatScan' AND [snapshot_isolation_state] = 0)
    BEGIN
     ALTER DATABASE [PatScan] SET ALLOW_SNAPSHOT_ISOLATION ON
    END
    GO
    -- END Enable Snapshot Isolation on Database 'PatScan' if needed
    -- BEGIN Create Scope Info Table named [scope_info]
    IF NOT EXISTS (SELECT t.name FROM sys.tables t JOIN sys.schemas s ON s.schema_id = t.schema_id WHERE t.name = N'scope_info' AND s.name = N'dbo')
    BEGIN
     CREATE TABLE [scope_info] ([scope_local_id] int IDENTITY(1,1) NOT NULL, [scope_id] uniqueidentifier DEFAULT NEWID() NOT NULL, [sync_scope_name] nvarchar(100) NOT NULL, [scope_sync_knowledge] varbinary(max) NULL, [scope_tombstone_cleanup_knowledge] varbinary(max)
    NULL, [scope_timestamp] timestamp NULL, [scope_config_id] uniqueidentifier NULL, [scope_restore_count] int DEFAULT 0 NOT NULL, [scope_user_comment] nvarchar(max) NULL)
     ALTER TABLE [scope_info] ADD CONSTRAINT [PK_scope_info] PRIMARY KEY ([sync_scope_name])
    END
    GO
    -- END Create Scope Info Table named [scope_info]
    -- BEGIN Create Scope Config Table named [scope_config]
    IF NOT EXISTS (SELECT t.name FROM sys.tables t JOIN sys.schemas s ON s.schema_id = t.schema_id WHERE t.name = N'scope_config' AND s.name = N'dbo')
    BEGIN
     CREATE TABLE [scope_config] ([config_id] uniqueidentifier NOT NULL, [config_data] xml NOT NULL, [scope_status] char NULL)
     ALTER TABLE [scope_config] ADD CONSTRAINT [PK_scope_config] PRIMARY KEY ([config_id])
    END
    GO
    -- END Create Scope Config Table named [scope_config]
    In an already provisioned database, the scope_info and scope_config tables already exist.  Hence the portions of the script to create the scope_info and scope_config tables are skipped.  I tried modifying the query to drop these tables.  When
    I do so, ne tables are created but they only define the modified table.
    Is it necessary to update scope_info and scope_config?  Are there are side effects (such as deprovisioning) if I drop and then recreate these tables? Can I just update the existing scope_config, replacing the portion of the XML which defines the table
    being modified? Do I have to make changes in scope_info?
    Thanks
    Howard Weiss
    Howard P. Weiss

    I followed the example provided in
    https://jtabadero.wordpress.com/2011/04/13/modifying-sync-framework-scope-definition-part-3-workarounds-addingremoving-columns/ to add columns to a table in a provisioned database.  The sample code replaces the stored procedures triggered when the
    table is updated with new stored procedures which include the additional columns
    However, the sample does not update scope_config. When I am finished, the new columns do not appear in the scope config.  Looking at the SQL code it is immediately obvious why.  Here is an excerpt from the beginning of the query
    DROP PROCEDURE [PATIENT_insertmetadata];
    DROP PROCEDURE [PATIENT_updatemetadata];
    DROP PROCEDURE [PATIENT_deletemetadata];
    -- BEGIN Enable Snapshot Isolation on Database 'PatScan' if needed
    IF EXISTS (SELECT NAME FROM sys.databases where NAME = N'PatScan' AND [snapshot_isolation_state] = 0)
    BEGIN
     ALTER DATABASE [PatScan] SET ALLOW_SNAPSHOT_ISOLATION ON
    END
    GO
    -- END Enable Snapshot Isolation on Database 'PatScan' if needed
    -- BEGIN Create Scope Info Table named [scope_info]
    IF NOT EXISTS (SELECT t.name FROM sys.tables t JOIN sys.schemas s ON s.schema_id = t.schema_id WHERE t.name = N'scope_info' AND s.name = N'dbo')
    BEGIN
     CREATE TABLE [scope_info] ([scope_local_id] int IDENTITY(1,1) NOT NULL, [scope_id] uniqueidentifier DEFAULT NEWID() NOT NULL, [sync_scope_name] nvarchar(100) NOT NULL, [scope_sync_knowledge] varbinary(max) NULL, [scope_tombstone_cleanup_knowledge] varbinary(max)
    NULL, [scope_timestamp] timestamp NULL, [scope_config_id] uniqueidentifier NULL, [scope_restore_count] int DEFAULT 0 NOT NULL, [scope_user_comment] nvarchar(max) NULL)
     ALTER TABLE [scope_info] ADD CONSTRAINT [PK_scope_info] PRIMARY KEY ([sync_scope_name])
    END
    GO
    -- END Create Scope Info Table named [scope_info]
    -- BEGIN Create Scope Config Table named [scope_config]
    IF NOT EXISTS (SELECT t.name FROM sys.tables t JOIN sys.schemas s ON s.schema_id = t.schema_id WHERE t.name = N'scope_config' AND s.name = N'dbo')
    BEGIN
     CREATE TABLE [scope_config] ([config_id] uniqueidentifier NOT NULL, [config_data] xml NOT NULL, [scope_status] char NULL)
     ALTER TABLE [scope_config] ADD CONSTRAINT [PK_scope_config] PRIMARY KEY ([config_id])
    END
    GO
    -- END Create Scope Config Table named [scope_config]
    In an already provisioned database, the scope_info and scope_config tables already exist.  Hence the portions of the script to create the scope_info and scope_config tables are skipped.  I tried modifying the query to drop these tables.  When
    I do so, ne tables are created but they only define the modified table.
    Is it necessary to update scope_info and scope_config?  Are there are side effects (such as deprovisioning) if I drop and then recreate these tables? Can I just update the existing scope_config, replacing the portion of the XML which defines the table
    being modified? Do I have to make changes in scope_info?
    Thanks
    Howard Weiss
    Howard P. Weiss

  • Access is not inserting, updating or deleting records in my database table on the server

    I am having a problem with an application I developed using Dreamweaver 8 and Access 2000 several years ago which is no longer working correctly. The problem is that Access is not inserting, updating or deleting records in my database table on the server but is reflected in changes to my Web site. I used the Dreamweaver server behaviors: insert record, update record and delete record to make the changes to my Access table on the server. My Access table on the server shows all of the records I inserted or updated in the past, but not any of the newly inserted on updated records.
    does any one have any ideas as to what my problem is?
    Jim

    No, that has nothing to do with your problem. Let's make sure I understand the symptoms.
    1) Your site is online at a remote host.
    2) You use a dynamic page in your online site to update a database record (insert, delete, or update)
    3) The update then appears correctly on your dynamic content page.
    4) You download the mdb and it appears to not have any of the upates you just made.
    Please correct any of these statements if they are wrong.
    If the above is correct, then you must be looking at a cached mdb, or the mdb you are looking at is in the wrong location. Do this: search your entire drive for copies of the mdb, including in the Windows temp directories which is likely where the cached copy is located. Delete any extra copies and download again.

  • How can i update the REMARK field in ADRT database table

    Hi all,
    How can i update the REMARK field in ADRT database table
    By using Function modules or BAPI’s
    Please reply me fast

    Hi,
    you can try this code:
        SELECT SINGLE * FROM KNA1 WHERE KUNNR = wa_kunnr.
        IF sy-subrc = 0.
          CLEAR adrct.
          SELECT SINGLE * FROM adrct WHERE addrnumber = kna1-adrnr.
          IF sy-subrc = 0.
            adrct-remark = wa_remark.
            MODIFY adrct.
          ENDIF.
        ENDIF
    best regards,
    Thangesh

  • ODP OracleCommandBuilder. Updating a table including DATE columns.

    Hi
    I have a problem with the OracleCommandBuilder not creating the correct update commands when I have DATE type columns in the table.
    I have created a test table (called DATETEST) with three columns:
    STRINGCOLUMN     VARCHAR2 10
    DATECOLUMN DATE
    NUMBERCOLUMN     NUMBER
    The STRINGCOLUMN is the primary key.
    Then I created a typed dataset that looks like this:
    STRINGCOLUMN     string
    DATECOLUMN string
    NUMBERCOLUMN     long
    This is the XML schema for the typed dataset:
    <?xml version="1.0" encoding="utf-8" ?>
    <xs:schema id="DateDS" targetNamespace="http://tempuri.org/DateDS.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns="http://tempuri.org/DateDS.xsd" xmlns:mstns="http://tempuri.org/DateDS.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
         <xs:element name="DateDS" msdata:IsDataSet="true">
              <xs:complexType>
                   <xs:choice maxOccurs="unbounded">
                        <xs:element name="DATETEST">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="DATECOLUMN" type="xs:string" minOccurs="0" />
                                       <xs:element name="STRINGCOLUMN" type="xs:string" minOccurs="0" />
                                       <xs:element name="NUMBERCOLUMN" type="xs:long" minOccurs="0" />
                                  </xs:sequence>
                             </xs:complexType>
                        </xs:element>
                   </xs:choice>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    And this is the test code:
    Dim connection As Oracle.DataAccess.Client.OracleConnection
    Dim adapter As New Oracle.DataAccess.Client.OracleDataAdapter()
    Dim dbCommand As New Oracle.DataAccess.Client.OracleCommand()
    Dim sqlstring As String
    Dim data As New DateDS() 'Typed dataset
    Const ConnectionString As String = "User Id=............."
    Try
    'Connect to database
    connection = New OracleConnection(ConnectionString)
    connection.Open()
    'Get data from table DATETEST
    dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN) AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
    dbCommand.Connection = connection
    adapter.SelectCommand = dbCommand
    adapter.Fill(data, "DATETEST")
    'Make changes to dataset
    data.DATETEST(0).DATECOLUMN = Now()
    data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
    'Update database
    sqlstring = "SELECT * FROM DATETEST"
    adapter.SelectCommand = New OracleCommand(sqlstring, connection)
    Dim custCB As New Oracle.DataAccess.Client.OracleCommandBuilder()
    custCB.DataAdapter = adapter
    adapter.Update(data, "DATETEST")
    'Disconnect
    connection.Close()
    connection.Dispose()
    Catch exc As Exception
    MessageBox.Show(exc.Message)
    End Try
    Getting the data from the database is not a problem.
    The dataset contains the correct information.
    But updating the database is impossible.
    I get errors like:
    ORA-01861: literal does not match format string
    And if I don't specify a DATE format in the TO_CHAR statement I get this error:
    Concurrency violation: the UpdateCommand affected 0 records.
    I think I've tried everything.
    I've used the OracleGlobalization class, with the SetSessionInfo method.
    I've tried all different types of date conversions to make sure that
    the date format on the database is the same as in the dataset.
    I've tried to change the NLS parameters on the DB server and in the registry on the client.
    I've tried to change the DATECOLUMN type in the typed dataset from string to Oracle.DataAccess.Types.OracleDate
    But it still doesn't work.
    The default date format on the DB 9i server is AMERICAN,(DD-MON-RR).
    A strange thing is that when I instead of using the ODP classes use
    the System.Data.OracleClient and its OracleCommandBuilder
    the code works perfectly without any errors.
    This is the test code that works:
    Dim connection As System.Data.OracleClient.OracleConnection
    Dim adapter As New System.Data.OracleClient.OracleDataAdapter()
    Dim dbCommand As New System.Data.OracleClient.OracleCommand()
    Dim data As New DateDS()
    Dim sqlstring As String
    Const ConnectionString As String = "User Id=......."
    Try
    'Connect to database
    connection = New System.Data.OracleClient.OracleConnection(ConnectionString)
    connection.Open()
    'Get data from table DATETEST
    dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN,'YYYY-MM-DD HH24:MI:SS') AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
    dbCommand.Connection = connection
    adapter.SelectCommand = dbCommand
    adapter.Fill(data, "DATETEST")
    'Make changes to dataset
    data.DATETEST(0).DATECOLUMN = Now()
    data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
    'Update database
    sqlstring = "SELECT * FROM DATETEST"
    adapter.SelectCommand = New System.Data.OracleClient.OracleCommand(sqlstring, connection)
    Dim custCB As New System.Data.OracleClient.OracleCommandBuilder()
    custCB.DataAdapter = adapter
    adapter.Update(data, "DATETEST")
    'Disconnect
    connection.Close()
    connection.Dispose()
    Catch exc As Exception
    MessageBox.Show(exc.Message)
    End Try
    My experience until this came up is that the ODP provider is better on everything
    than the microsoft Oracle provider so I don't want to switch unless I have to.
    Could someone that have used the ODP OracleCommandBuilder for updating a table including DATE columns with a typed dataset please give me some tips on how to make this work?
    I would be the happiest man on earth if someone had a solution :-)
    Erik

    Don't convert the dates to strings. Ever.
    The command builder uses the metadata returned from the select command to build the insert/update commands. Using to_char in the query tells ODP that that is a varchar2 column. If you omit the to_char the commandBuilder will know to bind a date parameter in that spot.
    Also in your typed dataset you should change the type from a string to a date.
    David

  • Updating a Table in a JSF

    Hey Everyone,
    I'm having a bit of an issue and wanted to see if anyone could help me out. So I have a Datbase all set up (it has 4 tables in it) and in my JSF page that I'm creating I want a user to be able to either select some predefined SQL from a Drop Down Menu or they can enter their own SQL statement in the Text Area. The DD Menu is already set up with some choices that will then update the Text Area to show the SQL statement that will be executed and then there's a "blank" option that will leave the TA blank so they can type whatever they want. So here's my problem now:
    I have a submit button, and figured that after the user hit submit I could grab the text within the TA and then issue that as the query. What I want to happen after this is the table below the TA will show the query results, but so far I've just been running in circles. If I put a table there and bind it to one of the tables (the Employee Table holds the main information but some of the queries will require information from some of the other tables as well) then as far as I can tell I can't get the table to update based on the query results.
    So I guess that's where my question lies, is there a way to update a table on the screen to only show the results from a given query, and then maybe default back to an empty table when a user hits "done" or "try a new query"?
    Thanks if anyone can help, I'm just a bit confused.
    Oh, and I'm using Netbeans on Ubuntu, in case anyone needs to know.

    Yes, it is similar to the example from kferri01. His example assumes that you want to read the entire remote table. If a significant number of rows have the flag set that indicates that this row will never change again, then filtering based on the flag may increase performance. The remote database should do the query and send only the rows that match the WHERE clause across the network to be merged. Something like:
    MERGE INTO local_table l
    USING (SELECT column_list
           FROM remote_tabe@db_link
           WHERE flag <> 'this_row_will_never_change') r
    ON (l.local_pk = r.remote_pk)
    WHEN MATCHED THEN
       UPDATE l.local_col1 = r.remote_col1,
              l.local_col2 = r.remote_col2,
    WHEN NOT MATCHED THEN
       INSERT (l.local_pk, l.local_col1, l.local_col2, . . .)
       VALUES (r.remote_pk, r.remote_col1, r.remote_col2, . . .)HTH
    John

  • While updating a table i am getting ORA-00600 error.

    Hi all,
    While updating a table i am getting the following:
    **SQL Error: ORA-00600: internal error code, arguments: [qkebCreateConstantOpn1], [], [], [], [], [], [], [], [], [], [], []**
    **00600. 00000 - "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"**
    I am not getting how to proceed on this. Please guide me.
    Thanks,
    Ritesh

    While performing some unspecified action (no DML) on an unknown table (no DDL) in an unknown version and edition of the Oracle database you had an untrapped Oracle exceptions.
    There are too many unknowns to help you beyond recommending you open an SR at MyOracleSupport.

  • Updating a table using cursor is taking long time in oracle

    Hi,
    I am working on the oracle database 11gR2. I am trying update a table column which is newly added through cursor. below is the cursor.
    BEGIN
         FOR lcur_tab IN (select l.LOGIN_ID as login_id, lt.ERROR_CODE as error_code from LOGIN l INNER JOIN LOGIN_TASK lt ON (l.LAST_LOGIN_TASK_ID = lt.LOGIN_TASK_ID) )
         LOOP
                   UPDATE ACCOUNT SET LOGIN_ERROR_CODE = lcur_tab.error_code where ACCOUNT_ID IN (SELECT ACCOUNT_ID FROM LOGIN_ACCOUNT where LOGIN_ID = lcur_tab.login_id ) ;
         end LOOP;
         commit;
    END;
    In the cursor we are trying to copy the Login table error_code value to LOGIN_ERROR_CODE of ACCOUNT Table, for the accounts associated with that Login. Here newly added column is LOGIN_ERROR_CODE in account table. this account table have 11million rows in it. when i used the above cursor it took 3hours and still running. So we stopped after that. Is there any way i can change this cursor syntax to update those column values. How can we do this type of updates?
    Also i am planning to run thus update in the background . I don't have much knowledge on the PL/SQL stuff. So please help on this.
    Thanks in advance.
    Edited by: Hari on Mar 21, 2012 10:06 PM

    Is there a reason that you don't want to do this with a single `UPDATE` statement? That should be quite a bit more efficient.
    Something like
    UPDATE account a
       SET login_error_code = (
          select lt.error_code
            from login_task lt
                 join login l on (l.last_login_task_id = lt.login_task_id)
                 join login_account la on (la.login_id = l.login_id)
           where la.account_id = a.account_id )
    WHERE EXISTS (
          select 1
            from login_task lt
                 join login l on (l.last_login_task_id = lt.login_task_id)
                 join login_account la on (la.login_id = l.login_id)
           where la.account_id = a.account_id );Justin

Maybe you are looking for

  • CS4 install problem "you cannot run...architecture not supported" error

    Just received my copy of CS4 (Mac) from amazon.com. Installed it. But could not get it to run. Got a "You cannot run....architecture not supported" error message. Can't understand why? This is my first version of Photoshop CS. Didn't install CS3...et

  • TS3274 load web page then screen goes black and reboots

    hit safari icon.then connect to a web page then all of the sudden the screen shades out and reboots the unit

  • Can't uninstall iTunes. "Store View Button" as the issue. What do I do?

    I tried to add new music from my computer to my ipod and there was a problem that would not allow it to happen. I decided to uninstall and then reinstall itunes. Problem - I am unable to uninstall the entire program. I have an error that discusses "S

  • IDOC_INPUT_GLMAST - GLMAST

    Hello All, For Message typ GLMAST, for inbound delivery i use the standard Function Module IDOC_INPUT_GLMAST. I need to delete few segements and i dont see an EXIST which will help me do so. Please lte me know your suggestions on this. 1. I cannot de

  • PO Mass change for Net Price

    Dear Experts, Please help. I want to change net price of POs, i tried to use MEMASSPO but there's no field for net price which is the one i want to change. Kindly help and advise if there's another for PO net price mass change. Thank you very much. Z