Error facing in MERGE :Updating 2 Tables

Hi ,
I am getting Error while trying the update 2 tables:
MERGE INTO  table_b dst
   USING  (
SELECT  
header_id,line_id,detail_id,group_id
   FROM      table_a
                  )               src
    ON     ( 
                dst.header_id = src.header_id
           AND  dst.line_id = src.line_id
           AND  dst.detail_id = src.detail_id
    WHEN MATCHED THEN UPDATE  SET  det.GROUP_ID  = src.group_id
N.B:GROUP_ID is preent in both tables (table_a,table_b)
Error while issuing the Command
Error at Command Line:14 Column:35
Error report:
SQL Error: ORA-00904: "DET"."GROUP_ID": invalid identifier
00904. 00000 -  "%s: invalid identifier"
*Cause:   
*Action:

921311 wrote:
Hi ,
I am getting Error while trying the update 2 tables:
MERGE INTO  table_b dst
   USING  (
SELECT 
header_id,line_id,detail_id,group_id
   FROM      table_a
                  )               src
    ON     (
                dst.header_id = src.header_id
           AND  dst.line_id = src.line_id
           AND  dst.detail_id = src.detail_id
    WHEN MATCHED THEN UPDATE  SET  det.GROUP_ID  = src.group_id
N.B:GROUP_ID is preent in both tables (table_a,table_b)
Error while issuing the Command
Error at Command Line:14 Column:35
Error report:
SQL Error: ORA-00904: "DET"."GROUP_ID": invalid identifier
00904. 00000 -  "%s: invalid identifier"
*Cause:  
*Action:
I'm sure you're just as capable of looking at your code as I am, and it took me only 1 second to spot
you have aliased the table table_b as dst but referred to it as det.

Similar Messages

  • Error converting data when updating table

    Hi,
    I need to understand why I cannot gat my update to work properly, I have to concat 4 fields (numbers with leading zeros so I can create a new number with leading 1. My field is already set as a bigint but I cannot convert the resulting string properly
    UPDATE table 
    set field = convert(bigint, '1', strfield1 + strfield2 + strfield3 + strfield4)
                                           1,  001      
    +   0125   + 0045      + 004568 
    The end result need to return the number 100101250045004568  to be inserted into a bigint field but I always get the following error:
    Error converting data type nvarchar to bigint
    If I try a select , it shows the proper result, so what am I missing here

    Guess I will have to wait for our new SQLServer 2012, coming in next week, I have tried every possible cast, convert possibility to make it work.
    Thank you all
    Al
    This should work fro SQL Server 2008 R2
    select CAST(('1'+ strfield1 + strfield2 + strfield3 +strfield4) AS BIGINT);
    web: www.ronnierahman.com

  • Merge - update table@dblink

    Hi all,
    my need is to perform merge:
    1) update table2@dblink only when some column(s) is/are different than in local table1
    2) insert rows into table2@dblink when not present.
    (2) works fine.
    (1) works strange. It was tested successfully at test server where both table1 and table2 are local. It just doesn't work at production server where table2 is remote (using dblink), it doesn't report any error, but values just are not updated.
    Query code:
    merge into remote.table2@dblink rr
    using
    select
      ID                       ,
      NAME                   
    from local.table1
    ) hh
    on ( hh.id = rr.id )
    when matched
               then update set
                       rr.NAME                     =  hh.NAME
                    where
                       rr.NAME                     <> hh.NAME
    when not matched then insert (
                                  rr.ID                       ,
                                  rr.NAME
                           values (
                                  hh.ID                       ,
                                  hh.NAME
                                  );Oracle version:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    (the same on local and remote servers).
    The content of table:
    ID
    NAME
    1
    Germany
    2
    Spain
    3
    Italy
    4
    Portugal
    4 rows selected.Please, help me.

    Looks like Bug:
    Bug 9816678 - Merge on a remote table using local table gives wrong results. [ID 9816678.8]
    Fixed in 11.2.0.3 ...

  • Update table using merge or Update statement

    Hi All,
    We have oracle 10G R2 On windows...
    We have tables BROK_DEALER_MAP and DTRMIS_REPORT.
    create table BROK_DEALER_MAP
    SL_NO NUMBER,     
    BROK_DLR_CODE VARCHAR2(30),     
    EMP_TAG     VARCHAR2(30),
    REMARKS     VARCHAR2(60),
    CONS_CODE VARCHAR2(30),     
    BROK_DLR_NAME VARCHAR2(50),
    BROKER_TYPE VARCHAR2(30),
    BROK_DLR_0 VARCHAR2(30),
    CATG_DESC VARCHAR2(60),     
    Category VARCHAR2(30));
    desc DTRMIS_REPORT
    SL_NO
    POSTED_DATE
    ZONE
    AMC_REGION
    CITY
    BROK_DLR_CODE
    BROK_DLR_NAME
    SUB_BROKER
    B_TYPE
    FOLIO_NO
    INVESTOR_NAME
    TAX_NO
    INV_TAG
    SCHEME_CODE
    SCHEME_NAME
    SCH_CLASS
    TRXN_MODE
    CHN_TAG
    FP_COUNT
    FP_AMOUNT
    AP_COUNT
    AP_AMOUNT
    PUR_COUNT
    PUR_AMOUNT
    SIP_COUNT
    SIP_AMOUNT
    SI_COUNT
    SI_AMOUNT
    RED_COUNT
    RED_AMOUNT
    SO_COUNT
    SO_AMOUNT
    DR_COUNT
    DR_AMOUNT
    STP_COUNT
    STP_AMOUNT
    NET_SALES
    DISTRIBUTOR_TYPE
    SCHEME_TYPE
    FOCUS_PRODUCT
    RM_CODE
    RM_NAMEtable BROK_DEALER_MAP doesn't have any duplicate records.
    table DTRMIS_REPORT have more than 2 lacks duplicate records.
    Now i want to update table DTRMIS_REPORT (DISTRIBUTOR_TYPY COLUMN) With the values of BROK_DEALER_MAP (CATEGORY COLUMN).
    For that i have written merge statement like below
    merge into dtrmis_report a
    using brok_dealer_map b
    on (a.brok_dlr_code=b.cons_code)
    when matched then
    update set a.Distributor_type=b.category
    where a.brok_dlr_code=b.cons_code;IT's giving error saying ORA-30926: unable to get a stable set of rows in the source tables.
    How to update the table.
    Please help.

    Chanchal Wankhade wrote:
    IT's giving error saying ORA-30926: unable to get a stable set of rows in the source tables.That means there are duplicate records in your source table.
    Please post the output of the below
    select cons_code
    from brok_dealer_map
    group by cons_code
    having count(*) > 1;In case of duplicate CONS_CODE, you need to decide with which the target table should get updated
    And are you seriously giving a where condition in merge like you posted..?
    Edited by: jeneesh on Dec 19, 2012 9:56 AM

  • "Error in updating Table J_1iexchdr"

    Hi ,
    When I am creating the excise invoice, It's terminated the program and gives the following error
    "Error in updating Table J_1iexchdr"
    What can be the reason?
    Regards
    Prem

    Hi prem
    Look if these threads can help
    RG23C Update Problem
    Problem in SAP Script
    billing document not creating
    return delivery
    ************Reward points if usefull**************

  • Error in updating table J_1PART2

    Hi,
       I am getting an error while saving the excise invoice as 'error in updating table J_1PART2'.
    What would have gone wrong?????? please help!!!
    Thanks ,
    Ramya

    Discussion moved from SAP ERP Sales and Distribution (SAP SD) to Internationalization and Unicode
    Please use Internationalization and Unicode for you CIN related queries

  • Error in updating table J_1IEXCHDR,J_1IEXCDTL in tcode J1IJ

    Hi,
    while cancelling excise invoice in Tcode J1IJ ,
    we are getting 'error in updating table J_1IEXCHDR,J_1IEXCDTL'.
    what is missing or tell the procedure to resolve the issue.
    Regards,

    Discussion moved from SAP ERP Sales and Distribution (SAP SD) to Internationalization and Unicode
    Please use Internationalization and Unicode for you CIN related queries

  • Database, Dataset, Table Adaptors Error "Unable to load, Update requires a valid DeleteCommand when passed DataRow collection with deleted row"

    Microsoft Visual Basic 2010 Express.
    I am new to Visual Basic programing and i am trying to understand the relationships between Datasets, database, table Adaptors. I have to following code that is is giving me the following error" Unable to load, Update requires a valid DeleteCommand
    when passed DataRow collection with deleted rows". 
    I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    It seems that i can delete the data on the DataGridView Table and it only displays the correct data. but my database is not updating, even though the data grid displays differently.I can determine this because, when i save the offset database, i have all
    the previous uploads and all the rows that i wanted to delete are still there.
    My final goal is to be able to import offset data from a CSV file, save this data on the pc, send a copy of this data to a NuermicUpDown so the customer can modify certain numbers. From here they download all the date to a controller.  IF the customer
    needs to modify the imported data, they can go to a tab with a data grid view and modify the table. They will also have to option to save the modified data into a csv file.  
    Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    CODE:
    Private Function LoadOffSetData()
            Dim LoadOffsetDialog As New OpenFileDialog 'create a new open file dialog and setup its parameters
            LoadOffsetDialog.DefaultExt = "csv"
            LoadOffsetDialog.Filter = "csv|*.csv"
            LoadOffsetDialog.Title = "Load Offset Data"
            LoadOffsetDialog.FileName = "RollCoaterOffset.csv"
            If LoadOffsetDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then  'show the dialog and if the result is ok then
                Try
                    Dim myStream As New System.IO.StreamReader(LoadOffsetDialog.OpenFile) 'try to open the file with a stream reader
                    If (myStream IsNot Nothing) Then 'if the file is valid
                        For Each oldRow As MaterionOffsetDataSet.OffsetTableRow In MaterionOffsetDataSet.OffsetTable.Rows
                            oldRow.Delete()                       
    'delete all of the existing rows
                        Next
                        'OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        Dim rowvalue As String
                        Dim cellvalue(25) As String
                        'Reading CSV file content
                        While myStream.Peek() <> -1
                            Dim NRow As MaterionOffsetDataSet.OffsetTableRow
                            rowvalue = myStream.ReadLine()
                            cellvalue = rowvalue.Split(","c) 'check what is ur separator
                            NRow = MaterionOffsetDataSet.OffsetTable.Rows.Add(cellvalue)
                            Me.OffsetTableTableAdapter.Update(NRow)
                        End While
                        Me.OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        MainOffset.Value = OffsetTableTableAdapter.MainOffsetValue          'saves all the table offsets
    to the offset numericUpDown registers in the main window
                        StationOffset01.Value = OffsetTableTableAdapter.Station01Value
                        StationOffset02.Value = OffsetTableTableAdapter.Station02Value
                       myStream.Close() 'close the stream
                        Return True
                    Else 'if we were not able to open the file then
                        MsgBox("Unable to load, check file name and location") 'let the operator know that the file wasn't able to open
                        Return False
                    End If
                Catch ex As Exception
                    MsgBox("Unable to load, " + ex.Message)
                    Return False
                End Try
            Else
                Return False
            End If
        End Function

    Hello SaulMTZ,
    >>I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    This error usually shows that you do not initialize the
    DeleteCommand object, you could check this
    article to see if you get a workaround.
    >> Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    If you are working CSV file, you could use OleDB to read it which would treat the CSV file as a Table:
    http://www.codeproject.com/Articles/27802/Using-OleDb-to-Import-Text-Files-tab-CSV-custom
    which seems to be easier (in my opinion).
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • When syncing my iphone i get a msg, "itunes could not sync calendars to the iphone because an error occurred while merging data"   I sync my calendar to outlook.  My iphone calendar has all and the most updated information.  Outlook shows only recurringMY

    I'm at a loss as to what to do. Any help is appreciated.  When syncing my iphone I get an message, "itunes could not sync calendars to the iphone because an error ocurred while merging data" I sync my calendar to outlook.  My iphone calendar has all and the most updated information.  Outlook calendar only shows my recurring events. 

    hi there,
    i've found a great & simple solution for this problem
    just open your iCloud acc on iPhone
    turn off calendars (it wil ask you to keep info or not - KEEP IT!)
    and turn back on (MERGE!)
    now SYNC it..
    and that's it
    PS in my case it was contacts so the procedure is the same..

  • Error updating table 37

    HI,
    When I am generating a excise invoice the system triggers u201CError updating table 372"
    I have not maintained of table 372 in access seq (Cd type (JEXP) . Previous i have maintained this table in my access seq and its working fine but I am not able to save the document,
    in that time i got error like
    No account is specified in item 0000000001
    Message no. F5670
    Diagnosis
    No account was specified for account type "S" in item "0000000001" of the FI/CO document.
    System Response
    The Financial Accounting program cannot process the document.
    Procedure
    A system error has probably occurred in the application you called up. Check the data transferred to item "0000000001" of the FI/CO document.
    Pl let me know if anything else is required to avoid further problems
    All errors I have attached with screen shot pl give me reply .
    Pl let me know if anything else is required to avoid further problems
    Any possible solution for this?
    1 ) IN VKOA transaction G/L accounts which are assigned in our sales account keys with combination of condition table fields is :
    App CndTy. ChAc SOr AAG AAG ActKy G/L acct
    V KOFI CAIN ERRO 01 06 ERL 300009 Sales
    V KOFI CAIN ERRO 01 06 EXD 140014 CENVAT Clearing
    V KOFI CAIN ERRO 01 06 EXS 140009 Ed Cess
    V KOFI CAIN ERRO 01 06 MW3 140071 VAT
    V KOFI CAIN ERRO 01 06 MWS 140071
    V KOFK CAIN ERRO 01 06 ERL 300009
    V KOFK CAIN ERRO 01 06 EXD 140014
    V KOFK CAIN ERRO 01 06 EXS 140009
    V KOFK CAIN ERRO 01 06 MW3 140071
    V KOFK CAIN ERRO 01 06 MWS 140071
    In Customer account assignment group and material account assignment groups. Setting is correct
    in the IMG settings
    IMG>Logistics general>Tax on Goods movements>India>Account determination.
    What GL should be assign here
    Excise G/L A/c for RG23A BED CENVAT offset account Mod.Clerng
    ARE1
    ARE3
    DLFC   ?          ?                     ?                  ?                   ?
    EWPO ?          ?                    ?                   ?                  ?
    GRPO
    TR6C
    UTLZ
    Pl let me know if anything else is required to avoid further problems
    Regards
    SAPCO

    Solved. Thanks to....
    http://www.vecna.com/whatWeDo/projects/9ias-experience.html

  • ME 808: System error: error during update Table EKAB

    Hi,
    Couple of years ago, during carve out, one of the contracts was deleted.
    A PO created against that contract carries some open quantities. Now our purchasing wants to close this PO, either by changing the quantity to delivered quantity (delivered quantity is lesser than PO quantity), or by checking the delivery complete box. But they are not able to do so, as there was no contract number exists in the system table.
    I propose to create a contract with the same number mentioned in the PO and then to change the quantity in the purchase req and PO. However now the system issues a dump error message "ME 808: System error: error during update Table EKAB".
    Can anyone help how to resolve the issue?
    Any body had similar situation?
    Thanks for your help.
    Regards,
    Shiva

    Hi,
    I am not sure how the external consultants deleted this contract during carve out.
    Our division was bought out from another company and moved the data to our SAP system.
    I checked the OSS and found note 922427 could resolve the issue.
    Thanks for your response.
    Regards

  • Update Error: No access permission as table is already locked

    Hi All,
    I am trying to reload work order master data but keepp getting the update error "No access permission as table is already locked". I have looked at sm12 but no lock entries found.
    Pls advice.

    Hi Ola,
    Have you checked RS12 tcode for master data locks?
    Best regards,
    Eugene

  • Error when attempting to merge into table with RLS - ORA - 28132

    hey,
    i've encountered an "ORA-28132 - Merge into syntax does not support security policies" when attempting to merge into a table with RLS defined on it.
    i looked around and found this [discussion |http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:259415261270] on ask tom.
    according to the thread - this was a bug in 9i. in 10g merge is possible only if the policy returns "null" and in 11g it was finally fixed.
    *i have been able to merge into tables with rls in 10gR2 in some cases.*
    i would like to know if anyone has some more information about this error. when can i merge into tables with RLS ?
    thanks, Haki.

    Never.
    The bug was that it did work sometimes in 10g i.e. it should always raise an error.
    It's something that I've always found a bit odd and frustrating - that MERGE and RLS policy should not be compatible.
    But bottom line is that you shouldn't be using MERGE on table with RLS policy.
    Edited by: Dom Brooks on Feb 14, 2011 10:51 AM

  • Error updating table 372"

    Hi friends,
    when iam generating a excise invocie the system triggers"Error updating table 372"
    Any possible solution for this?
    Thanks
    Ivy

    Dear All,
    I done this--by doing some configuration changes.
    Normally while doing Exports we are tempted to use the same sales area and accordingly we may give the combination of excise grp+series grp+export type in IMG>>>Logistics General>>>India>>>Business transactions>>>Outgoing excise invoices>>>Maintain default excise groups and series groups.
    Once after removing the export type to your sales area combination--system will show this error--and we cannot even post the Excise invoices.(J1IIN)
    I tried in my IDES--that with export type(Ex.Export under Bond)--with this assignment--i am able to post my excise invoices.
    Once after removing this assignment of export type--again i am getting this error.
    Actually i am not even aware why it is happening--almost after two months of struggle--i find this.
    (i feel it is in the same way that we cannot even open/See a sales order by deleting sales group which was created&used previously)
    i am sharing this because somebody may get a little help with my thread.
    Mark this if helpful--there by others can easily find this thread.
    Phanikumar

  • Error updating table with form

    All i have setup a application using the tabular form, and i went through the wizard and now when the table comes up with the entries that i can change i get this error
    Error in mru internal routine: ORA-20001: no data found in tabular form
    Error Unable to process update.
    OK
    Even when i use the delete i get
    ORA-20001: Error in multi row delete operation: row= 5, ORA-01403: no data found,
    Error multi row operation failed
    OK
    And i am unable to update any rows

    It looks to me you wrongly selected the P-Key for the tabular form.
    If you can provide some more information like the table columns, p-key etc we may help you out in debugging.

Maybe you are looking for

  • Mac Messenger program shut down

    When ever I try to close any conversation window in mac messenger the program automatically shuts down and then asks me to send an error report. The program starts up again and runs fine until I close another conversation window and it shuts down aga

  • How can I get the scroll bars to be more visible/contrasting?

    The scroll bars are difficult for me to differentiate from their background. Can I change their colour or darkness to make them more visible?

  • Itunes 11.1 crashes when started in 32 bit mode

    I'm running itunes 11.1 (126) on a new macbook air. it's running fine in default 64-bit mode but when I try to start it in 32-bit (because of some podcasts that require quicktime) itunes immediately crashes after starting. has anyone experienced the

  • Steps for creating Input Schedules

    Hi Can any one provide the steps to create Input Schedules - any documentation available at sdn?? Thank you Raju

  • Best options for decent quality output?

    Hi all, I'm using a Canon HG10 shooting HD AVCHD. I am pretty pleased with the new archive facility as it's helping save space, and I'm debating whether to edit in 960x540 or 1920x1080. The 1080 footage looks way better onscreen (to my eye at least)