Updating a table  while joining

Hi
I am joining three tables a,b,c of which b and c are really large ( 20 million+ records). The join is running and in the mean time I am updating some rows in the table b and c. Will my join reflect the newly updated data in b and c? Will the join complete successfully? Can you please point to some resources do that I can understand the internals during JOIN?
Thanks
Saravanan

Your JOIN will be readconsistent to it's start. So you will NOT see any updates.
This is basic Oracle read consistency.
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Update LIKP table while saving the output type in VT02N transaction

    Hi All,
    I have a requirement where i have to update Delivery Priority(LPRIO) field in LIKP table while saving the output type in VT02N transaction. I am not able to use the BAPI "BAPI_OUTB_DELIVERY_CHANGE" or FM "WS_DELIVERY_UPDATE" because, when we save the output type the programs that are configured in NACE are triggered in update mode and hence i will get a roll back error.
    Let me know other ways of updating the table at the time of saving output type for shipment transaction VT02N.

    This could be a result of one of the following reasons:
    1: Incorrect smart form/routine assigned in the output configuration (NACE)
    2: Serial number range of the delivery expired
    3: The default settings of the user (SU01) processing the delivery is missing the default printer name.
    Hope this is helpful
    Manish

  • Need to update column in table from joining the two tables

    Hi
    i want to update a table by joining two table but i m getting the below error
    single row subquery returns more than one value.
    i m using following query
    update table2
    set deposite_date=(select a.deposit_date from table1 a,table2 b
    where a.ban=b.ban and (a.deposit_date between b.cy_start_date and b.due_date))
    table2
    ban due_date cy_start_date deposite_date
    100 5/6/2011 22/05/2011
    101 7/11/2011 22/05/2011
    102 5/25/2011 22/05/2011
    table1
    ban      deposit_date
    100      04/12/2011
    100      04/15/2011
    102      03/25/2011
    101      04/26/2011
    101      05/06/2011
    101      07/26/2011
    can i insert latest deposit_date from table1 which lies between b.cy_start_date and b.due_date
    Thanks

    Hi,
    Welcome to the forum!
    876466 wrote:
    Hi
    i want to update a table by joining two table but i m getting the below error
    single row subquery returns more than one value.Exactly!
    (   SELECT  a.deposit_date
        FROM    ...returns all deposit_dates.
    (   SELECT  MAX (a.deposit_date)
        FROM    ...would return only the latest one.
    Also, you need to correlate the sub-query to the main query, so that it only looks for rows with the same ban.
    i m using following query
    update table2
    set deposite_date=(select a.deposit_date from table1 a,table2 b
    where a.ban=b.ban and (a.deposit_date between b.cy_start_date and b.due_date))
    table2
    ban due_date cy_start_date deposite_date
    100 5/6/2011 22/05/2011
    101 7/11/2011 22/05/2011
    102 5/25/2011 22/05/2011
    table1
    ban      deposit_date
    100      04/12/2011
    100      04/15/2011
    102      03/25/2011
    101      04/26/2011
    101      05/06/2011
    101      07/26/2011
    can i insert latest deposit_date from table1 which lies between b.cy_start_date and b.due_datePerhaps you need something like this:
    UPDATE  table2     b
    SET     deposit_date     =
             (    SELECT  MAX (a.deposit_date)
                   FROM      table1           a
               WHERE      a.ban          = b.ban
               AND      a.deposit_date BETWEEN b.cy_start_date
                               AND     b.due_date
    ;Notice that table1 is the only table in the FROM clause of the sub-query, but the sub-query is correlated to table2, so we can reference columns from table2 in the sub-query.
    Whenever you have a problem, post CREATE TABLE and INSERT statements for your sample data.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results will be the contents of the changed table(s) when everything is finished.
    Always say which version of Oracle you're using.
    Edited by: Frank Kulash on Aug 1, 2011 1:58 PM

  • Update EKKO table

    Hi,
    I have got the requirement to update EKKO table while creating PO. The exact scenario is, I need to update email address based on some condition while creating PO.
    This is what I have found:
    When we create PO, the ADRNR field of EKKO would have a value. But when we change address in the PO manually then it would have ADRNR field value in EKKO. It will not change address in the vendor master record. In stead it is maintaining separate entry in ADRC.
    My issue is I have written the logic in EXIT_SAPMM06E_012 to generate ADRNR while creating PO. I do not know where to update the field ADRNR of EKKO. Am I following right step. Please advise.
    Thanks,
    Ramesh

    Hi,
    The sandard SAP approach is, whenever you change an address in address tab of PO the ADRNR field in the EKKO will be generated and corresponding record will be created in table ADRC.
    If your only requirement is to only store mail address, based on certain condition in PO and for that PO only, then you can store then mail address in any unused field at the header level in PO which is big enough to store the mail address or you can store the mail address in any header level text which you are not using.
    If this fulfil your requirement without affecting any other functionality you can dissucc with your functional consultant and decide which way to adopt.
    Regards,
    Pratik

  • Running Cursor script to update Oracle Table.

    I have the following script. I have a cursor in which i perform an update operation on a oracle table. But The table "ICS_TRADE_DETAILS " is not getting updated. Am i doing something wrong? I get the correct values populated in the "lastChanged" and "tradeID" fields.
    Help Appreciated !!!!
    DECLARE
    lastChanged VARCHAR2(32);
    tradeID VARCHAR2(32);
    CURSOR c1 IS
    SELECT TRADEID,LASTCHANGED
    from CVSELECT;
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1 INTO tradeID,lastChanged
    DBMS_OUTPUT.PUT_LINE('lastChanged: '||lastChanged);
    DBMS_OUTPUT.PUT_LINE('tradeID: '||tradeID);
    update ICS_TRADE_DETAILS
    SET LASTCHANGED=lastChanged
    WHERE CTRADEID=tradeID;
    COMMIT;
    EXIT WHEN c1%NOTFOUND;
    END LOOP;
    CLOSE c1;
    END;

    ji li wrote:
    Is this related to someone else pulling data from the table(s) you are updating (and committing frequently)?
    If so, wouldn't the undo segments hold enough of the changed data for the dataset to be consistent?
    The reason I ask is because I've always been of the impression it was better to commit frequently as opposed to doing autonomous (all or none) processing.When you open a cursor, Oracle needs to fetch data as of that particular SCN. So if someone is potentially updating the table while you are reading data, you want to make sure that Oracle will have the UNDO data in hand to be able to get back to the old state. If you commit in the loop, however, Oracle now believes that your session is no longer interested in older UNDO data so it may well purge that data too quickly, causing ORA-01555 errors. Fetching across a commit is almost certainly a bad idea.
    Commit frequency should be driven exclusively by logical units of work. If you have a loop, the logical unit of work is almost always the whole set of rows that you want to process. If processing dies in the middle, you're generally much better off having everything rolled back than in having half the rows processed and not knowing which half were processed and which half were not. If you are processing extremely large numbers of rows (i.e. data warehouse loads), it is sometimes worthwhile to code all the extra logic required to make the process restartable and to commit periodically in order to avoid situations where something dies 2 hours into a run and you have to spend another 2 hours rolling back those changes before you can restart. But that's the exception to the rule and generally only appropriate after spending quite a bit of effort performance tuning which would remove 99% of loops in the first place.
    Justin

  • 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.

  • How can I join 3 tables while extracting data from SAP R/3?

    I have 3 tables with the following columns
    Emp table (emp)
      emp_id
      emp_name
      emp_add
    Dept table (dept)
      dept_id
      dept_name
      dept_loc
    Location table (loc)
      loc_id
      loc_name
    Now. If I want to select data from loc_id = 10 and emp_id between 2000 and 3000
    How to join these three tables while extracting data from R/3
      join condition
       loc.loc_id = dept.loc_id
    and dept.dept_id = emp.dept_id
    and loc.loc_id =10
    and emp.emp_id between 2000 and 3000.
    Could any one let me know the procedure to extract this data into BW system.

    Hi,
    shouldn't your join condition be:
    loc.loc_id = dept.DEPT_LOC
    and dept.dept_id = ??
    If you can join the three tables then create a generic datasource (RSO) based on a view (create your view with your join in SE11).
    Enable the loc_id and the emp_id as selectable in the datasource so you can then select the values from a BW IPack.
    hope this helps...
    Olivier.

  • What are the Pros and Cons while joining tables at DF and Universe level

    Hi Experts,
    I am new to Data federator designer. I need help on the below.
    Could you please let me know the Pros and Cons while joining the source tables in data federator
    And While joining the DF target tables in universe designer.
    Regards,
    Gana

    Hi,
    1. I have created target tables based on source tables with one to one mapping and then join all target tables in universe.
    Ex: Source tables: Infocube text tables, fact tables and 3rd party data base table
    Target tables:Target tables are same as source tables
    --- Yes this is the way to create target Tables  and join them in the universe.These target Tables gives you the flexibility  like in future your requirement is to add one more object based on some calculation which is not possible in the universe so that time you can create  one more column in the target table and do the calculation. at the same time if you are using source table you can not do anything.
    2. Created single target table with all objects of source tables and merged all sources tables data.
    Ex: Source tables: Infocube text tables, fact tables and 3rd party data base table
    Target table: Single table.
    --- This is bit complex structure to merge all tables data in the one target table.in this situation you have to put more efforts and it is more complex.basically this type of target table is useful when you are merging data by multiple source into single  or  creating one target table based on the  union of tables by adding two mapping rules or more and you can not join tables in universe.
    Better approach is first 1. create target tables based on the source tables and join them in the universe.
    Thanks,
    Amit

  • Issue while Updating a table having Unique Secondary Index

    Hi,
    I am trying to update a 'Z' table in which there are 5 fields comprising of primary key. Out of them 2 key fields are defined as a part of seconadry index with 'Unique' option selected.
    As per the requirement, I am trying to update the table using modify statement so whenever this statement occurs it will check the primary keys and accordingly try to m

    958572 wrote:
    Hi,
    We have observed the exception *'JDBC activity timed out while updating the table -Table1"* in our logs in prod environment.
    1)we verified the AWR report for that particular time and observed that one update statement was trying to update the table table1.
    its a simple update statement as below
    UPADTE TABLE1 SET COL1=VAL1,COL2=VAL2 WHERE ID1=VAL1 AND ID2=VAL2;
    there is a PK index on ID2 column.
    2)we also came to know that there were no locks on TABLE1 during this time.
    can some one please let me know what could be the possible reason for this kind of exception?
    ThanksOS/Networking mis-configuration.
    Oracle does not know or care about the type or flavor of remote client (JDBC, OCI, ODBC, etc).
    Oracle's default configuration contains no timeout.
    I suspect a FireWall setting.

  • Exception while updating a table

    Hi
    while updating a table throw entity bean i am getting
    Base EJBException
    java.sql.SQLException: ORA-01401: inserted value too large for column
    how to resolve this problem
    com.sap.engine.services.ejb.exceptions.BaseEJBException: SQLException while the data is being flushed. The persistent object is com.chep.portfolio.da.ejb.admin.UserPreferencesEJBBean4_0Persistent.
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:101)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
         at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
         at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
         at com.chep.portfolio.da.ejb.admin.UserPreferencesEJBLocalLocalObjectImpl4_0.setUserProfileId(UserPreferencesEJBLocalLocalObjectImpl4_0.java:614)
         at com.chep.portfolio.admin.business.facade.user.UserFacadeBean.updateUserPreferences(UserFacadeBean.java:774)
         at com.chep.portfolio.admin.business.facade.user.UserFacadeLocalLocalObjectImpl0_0.updateUserPreferences(UserFacadeLocalLocalObjectImpl0_0.java:247)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.sql.SQLException: ORA-01401: inserted value too large for column
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2035)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2876)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
         at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:240)
         at com.chep.portfolio.da.ejb.admin.UserPreferencesEJBBean4_0Persistent.ejb_iUpdate(UserPreferencesEJBBean4_0Persistent.java:552)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:80)
         ... 33 more
    java.sql.SQLException: ORA-01401: inserted value too large for column
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2035)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2876)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
         at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:240)
         at com.chep.portfolio.da.ejb.admin.UserPreferencesEJBBean4_0Persistent.ejb_iUpdate(UserPreferencesEJBBean4_0Persistent.java:552)
         at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:80)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
         at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
         at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
         at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
         at com.chep.portfolio.da.ejb.admin.UserPreferencesEJBLocalLocalObjectImpl4_0.setUserProfileId(UserPreferencesEJBLocalLocalObjectImpl4_0.java:614)
         at com.chep.portfolio.admin.business.facade.user.UserFacadeBean.updateUserPreferences(UserFacadeBean.java:774)
         at com.chep.portfolio.admin.business.facade.user.UserFacadeLocalLocalObjectImpl0_0.updateUserPreferences(UserFacadeLocalLocalObjectImpl0_0.java:247)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    how to solve this one

    Hi, vanaja,
    "inserted value too large for column" - this is the reason for the exception. That is, you are trying to persist a value that exceeds the table column capacity.
    What you can do is reduce the length of the data element you want to update, or, 2) first increase the relevant column maximum length, then try to update the table again.
    If you choose 2), and if you are using the system database, then you can use Java Dictionary and follow [THIS|http://help.sap.com/saphelp_nw70/helpdata/en/fe/53fb40f17af66fe10000000a1550b0/frameset.htm] procedure to increase the maximum length of a column.
    Hope that helps!
    Regards,
    Yordan

  • Validity Table not updating for 0IC_C03 while updating data

    Hi,
    1.Validity table not updating for 0IC_C03 while updating data in my BW 7.4 With HANA data base?
    Key fields : 0Plant
                       0Calday
    if you run this programe after loading data - RSDG_CUBE_VALT_MODIFY it is updating.
    2. I am not getting no marker update option in non-cumulative Info cube 0ic_c03 manage tab or in DTP tabs check as per 7.4 modifications?
    and  2LIS_03_BX in DTP I am getting below this option only
    Can you please give me solution for this issues.
    Regards
    Umashankar

    Hi Uma,
    Please go through the below link which might be helpful.
    Not able to Edit Validity Table : RSDV
    Marker Update Option is available under Collapse tab of Info cube.
    Thanks,
    Karan

  • How to capture userid,date in a custom table while updating a form

    Hi,
    I have a requirement to insert the userid, the form name and the date on which the record is saved in a custom table while updating a custom form.
    We are using Form Builder 6.0.
    I am new to Forms and can anyone help me with these?
    I would also want to know under which trigger i should be writing the code in.
    Thanks in advance.

    you can use:
    usrid := get_application_property(username);
    formname := get_application_property(current_form);
    dt := to_char(sysdate,'dd/mm/yyyy hh:mi:ss');
    you insert these values in on-update trigger at form level

  • Updating the VETVG table while creating the purchase order

    hi all,
       I have one requirement to calculated the delivery creation date while creating the Purchase Order. It is calculated based on the delivery date of PO. I have calculated that one but how to update it after calculation. Can any body give a user exit or BADI with implementation which will update the VETVG table while creating the PO.
    Thanks
    rajkumar

    hi sanjay,
    thanks for reply, I am using same BADI(ME_PROCESS_PO_CUST) and implementation(FIELDSELECTION_ITEM_REFKEYS). In this implementation i am setting the shipping data with SET_SHIPPINGDATA method . but after that the values are not updating the EKPV and VETVG tables but it is only showing in the screen. Can you give a idea where to pass these values so it will update the tables.
    thanks
    rajkumar

  • While Joining 3 tables am getting 2 rows,actual i need a single row

    Hi all,
        While joining 3 tables am getting 2 Rows, i need  1 row.
    please find my query and actual output and expected output.
    Help me out to handle this.
    select
            --MFU_D_C_INVESTOR_ID_DET,
            mfu_remove_junk(Q.CAN)                               CAN_ST,
            mfu_remove_junk(Q.INSTALLMENT_AMOUNT) AMOUNT_ST,
            mfu_remove_junk(x.Can )                                Can ,
            mfu_remove_junk(x.Amc_Code )                      Amc_Code ,
            mfu_remove_junk(x.Folio_No )                         Folio_No ,
            mfu_remove_junk(x.Order_Status )                  Order_Status ,
            mfu_remove_junk(x.User_Code )                    User_Code ,
            mfu_remove_junk(x.User_Txrn_No )               User_Txrn_No ,
            mfu_remove_junk(x.Group_Ord_No )              Group_Ord_No ,
            mfu_remove_junk(x.Ind_Txn_Ref_No )            Ind_Txn_Ref_No ,
            mfu_remove_junk(x.Pending_Txn_Ref_No )    Pending_Txn_Ref_No ,
            mfu_remove_junk(x.Appl_No )                       Appl_No ,
            mfu_remove_junk(x.Ts_Machine_Id )             Ts_Machine_Id ,
            mfu_remove_junk(x.Trxn_Date )                    Trxn_Date ,
            mfu_remove_junk(x.Trxn_Time )                    Trxn_Time ,
            mfu_remove_junk(x.Timestamp_No )             Timestamp_No ,
            mfu_remove_junk(x.Sch_Code )                   Sch_Code ,
            mfu_remove_junk(x.Reinv_Tag )                    Reinv_Tag ,
            mfu_remove_junk(x.Txn_Mode )                   Txn_Mode ,
            mfu_remove_junk(x.Trxn_Type )                   Trxn_Type ,
            mfu_remove_junk(x.Sub_Trxn_Type )           Sub_Trxn_Type ,
            mfu_remove_junk(x.Units )                          Units ,
            mfu_remove_junk(x.Amount )                      Amount ,
            mfu_remove_junk(x.All_Units_Flag )            All_Units_Flag ,
            mfu_remove_junk(x.Entity_Id )                    Entity_Id ,
            mfu_remove_junk(x.ENTITY_BRANCH_ID )  ENTITY_BRANCH_ID ,
            mfu_remove_junk(x.Location )                     Location ,
           (TO_CHAR(sysdate,'DD-MON-RRRR'))        CREATED_DATE
         From MFU_FTP_XML_FILES T
      Left Join Xmltable('/COMM_TXN_STRUCT/FILE_ROWS/FILE_ROW'
                          Passing T.Filecontent
                          Columns
    --MFU_D_C_INVESTOR_ID_DET
    Can                 Varchar2(500) Path  'INVESTOR_ID_DET/CAN',
    Amc_Code            Varchar2(500) Path  'INVESTOR_ID_DET/AMC_CODE',
    Folio_No            Varchar2(500) Path  'INVESTOR_ID_DET/FOLIO_NO',
    Order_Status        Varchar2(500) Path  'TRANSACTION_DET/ORDER_STATUS',
    User_Code           Varchar2(500) Path  'TRANSACTION_DET/USER_CODE',
    User_Txrn_No        Varchar2(500) Path  'TRANSACTION_DET/USER_TXRN_NO',
    Group_Ord_No        Varchar2(500) Path  'TRANSACTION_DET/GROUP_ORD_NO',
    Ind_Txn_Ref_No      Varchar2(500) Path  'TRANSACTION_DET/IND_TXN_REF_NO',
    Pending_Txn_Ref_No  Varchar2(500) Path  'TRANSACTION_DET/PENDING_TXN_REF_NO',
    Appl_No             Varchar2(500) Path  'TRANSACTION_DET/APPL_NO',
    Ts_Machine_Id       Varchar2(500) Path  'TRANSACTION_DET/TS_MACHINE_ID',
    Trxn_Date           Varchar2(500) Path  'TRANSACTION_DET/TRXN_DATE',
    Trxn_Time           Varchar2(500) Path  'TRANSACTION_DET/TRXN_TIME',
    Timestamp_No        Varchar2(500) Path  'TRANSACTION_DET/TIMESTAMP_NO',
    Sch_Code            Varchar2(500) Path  'TRANSACTION_DET/SCH_CODE',
    Reinv_Tag           Varchar2(500) Path  'TRANSACTION_DET/REINV_TAG',
    Txn_Mode            Varchar2(500) Path  'TRANSACTION_DET/TXN_MODE',
    Trxn_Type           Varchar2(500) Path  'TRANSACTION_DET/TRXN_TYPE',
    Sub_Trxn_Type       Varchar2(500) Path  'TRANSACTION_DET/SUB_TRXN_TYPE',
    Units               Varchar2(500) Path  'TRANSACTION_DET/UNITS',
    Amount              Varchar2(500) Path  'TRANSACTION_DET/AMOUNT',
    All_Units_Flag      Varchar2(500) Path  'TRANSACTION_DET/ALL_UNITS_FLAG',
    Entity_Id           Varchar2(500) Path  'TRANSACTION_DET/ENTITY_ID',
    ENTITY_BRANCH_ID    Varchar2(500) Path  'TRANSACTION_DET/ENTITY_BRANCH_ID',
    Location            Varchar2(500) Path  'TRANSACTION_DET/LOCATION'
    ) X
    on (1=1)
         left join XMLTABLE('/CT_SYS_STRUCT/FILE_ROWS/FILE_ROW'
                   PASSING T.FILECONTENT
                   columns
    CAN                varchar2(500)  PATH 'INVESTOR_ID_DET/CAN',
    INSTALLMENT_AMOUNT varchar2(500)  PATH 'TRANSACTION_DET/INSTALLMENT_AMOUNT'
    )Q
    on (1=1)
    Where
    TRUNC((TO_DATE(T.RETRIVED_DATE,'DD-MON-RRRR HH:MI:SS PM')))=TRUNC(SYSDATE-2)
    Order By Rownum,X.Can Asc;
    Actual O/P:
    15114LBA01  1000.00     (null)               (null)         (null)     (null)      (null)                 (null)               (null)                  
            (null)      (null)         15114LBA01    SMF         AC       MFU    40715117000    15114010001   1511401000102      
    Expected O/P:
    can_st                amount     can                 amc    order  user      trxn_no             group_ord         ind_txn_no
       15114LBA01   1000.00  
    15114LBA01    SMF 
    AC 
    MFU    40715117000    15114010001    1511401000102 

    Expected O/P:
    can_st      amount  can       amc order user trxn_no     group_ord   ind_txn_no
    15114LBA01 1000.00 15114LBA01 SMF
    AC
       MFU 40715117000 15114010001 1511401000102
    check http://docs.oracle.com/cd/E11882_01/server.112/e41084/ap_keywd001.htm#SQLRF55621
    to verify:
    with
    actual_output as
    (select '15114LBA01' can_st,1000.00 amount,null can,null amc,null order_,null user_,null trxn_no,null group_ord,null ind_txn_no from dual union all
    select null,null,'15114LBA01','SMF','AC','MFU',40715117000,15114010001,1511401000102 from dual
    select max(can_st) can_st,max(amount) amount,max(can) can,max(amc) amc,max(order_) order_,max(user_) user_,max(trxn_no) trxn_no,max(group_ord) group_ord,max(ind_txn_no) ind_txn_no
      from actual_output
    CAN_ST
    AMOUNT
    CAN
    AMC
    ORDER_
    USER_
    TRXN_NO
    GROUP_ORD
    IND_TXN_NO
    15114LBA01
    1000
    15114LBA01
    SMF
    AC
    MFU
    40715117000
    15114010001
    1511401000102
    select max(can_st) can_st,max(amount) amount,max(can) can,max(amc) amc,max(order_) order,max(user_) user,max(trxn_no) trxn_no,max(group_ord) group_ord,max(ind_txn_no) ind_txn_no
      from actual_output
    ORA-00923: FROM keyword not found where expected
    Regards
    Etbin

  • Updating a table with need of table joins

    Hi,
    I want to update a table (via PL/SQL process) but to do it I need to include joins - and my code throws an error...
    How would I go about getting this to work?
    UPDATE employees a, action b
    SET a.met_employee = '0000'
    WHERE b.date_met NOT BETWEEN QA1 AND QA2
    AND b.date_met NOT BETWEEN QB1 AND QA2
    AND b.date_met NOT BETWEEN QC1 AND QC2
    AND b.date_met BETWEEN QD1 AND QD2
    AND b.emp_id = P12_ID
    AND a.emp_id = P12_ID;
    Where QA1, QA2, QB1, QB2, QC1, QC2, QD1, QD2 are variable values of pre-defined dates and P12_ID is the ID variable.
    The problem occurs because I need to use the two tables - how can I solve this?
    Thanks,
    Si

    The employee table has multiple actions (action table)
    We want to set certain values i.e the '0000' to certain employees that have had actions on certain dates (the defined variables)
    So it needs to check all the actions within the set dates and give only employees within this criteria the value '0000'
    with the following...
    update emplyees
    set met_emplyees = '0000'
    where emp_id = P12_ID;
    that will always set the employee with '0000'. However '0000' should only be set to employees that had actions on certain dates.
    Cheers
    Si

Maybe you are looking for