UPDATING A TABLE WITH SAME INFO FROM ANOTHER TABLE ON THE SAME DB

0down votefavorite
I am trying to update a table with info from another table on the same db with same table name. I just want the info to be the same , no primary key or constraint involve just a straight replacement of records and I keep getting errors WITH THE TABLE not
being recignize. below is my query:
UPDATE
VNDFIL
SET EOBTYP
=  VNDFIL.EOBTYP, 
EDI_X12_835_VERSION =  VNDFIL.EDI_X12_835_VERSION
FROM
AGERECOVERY
WHERE
VNDFIL.EOBTYP
= VNDFIL.EOBTYP
AND
VNDFIL
.EDI_X12_835_VERSION
= VNDFIL.EDI_X12_835_VERSION

Hi rotary,
If those two same named tables are in the same database then they have to be in different schemas. If you mean they are in the same server instance, then they may be in different databases, besides the "table not being recognized" error,
anyway you should use the fully qualified table names, that is database.Schema.Table(If across instances, ServerName should be prefixed) to avoid the table unrecognized error.
Using Identifiers As Object Names
With the fully qualified names, your update statement can be like below.
UPDATE
db1.schema1.VNDFIL
SET EOBTYP = srcTbl.EOBTYP, EDI_X12_835_VERSION = srcTbl.EDI_X12_835_VERSION
FROM
db1.schema2.VNDFIL srcTbl
WHERE
db1.schema1.VNDFIL.EOBTYP = srcTbl.VNDFIL.EOBTYP AND
db1.schema1.VNDFIL.EDI_X12_835_VERSION = srcTbl.VNDFIL.EDI_X12_835_VERSION
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support

Similar Messages

  • Breakout table (fill table with matching data from another table)

    Hi
    I've been trying to study old discussions about breakout tables. I feel I'm close, but still no cigar :-)
    In plain english, I'm trying to autocreate rows with data on a table, based on matching values from another table. E.g. have a table to display all rows where type = AssetX
    I have attached a screenshot of my "master table" called Assets:
    I'm looking to prefill Asset name, Total from this table and populate a new table called e.g. Greenhouse
    Where I'd be adding more data (date, income, expense).
    Any help whould be greatly appreciated.
    Thanks!

    Hi,
    Here is a Sample Query.
    Update Emp A
    Set Sal = (Select Sal from emp b where
    a.empno = b.empno)
    where empno in (select empno from emp);
    Regards,
    Ganesh R
    null

  • Auto Populate Field in One Table with Primary Key from another table.

    Greetings all,
    I have created two tables. One for Root Cause which will be the based description information of an analysis. Each Root cause can have many corrective actions.
    My Table structure is as follows:
    RCCA TABLE:
    =====================================
    Column Name     Data Type     Nullable
    RCCAID     NUMBER     No
    DESCRIPTION     VARCHAR2(4000)     Yes
    SUMMARY     VARCHAR2(4000)     Yes
    OWNER     VARCHAR2(4000)     Yes
    DATEOFINCIDENT DATE     Yes
    STATUS     VARCHAR2(4000)     Yes
    CORRECTIVE ACTION TABLE
    =====================================
    Column Name     Data Type     Nullable
    CAID     NUMBER     No
    RCCAID     NUMBER     No
    CANUMBER      NUMBER     Yes
    CACTION     VARCHAR2(4000)      Yes
    DATEDUE     DATE     Yes
    COMMENTS     VARCHAR2(4000)      Yes
    So I have a form that creates the RCCA and then I have another form that I want to feed off of the first form. My thought was that when the RCCA was created, it would open a report of the RCCA and then in another region of the page I would add corrective action form. What I am looking to do is when I press the Create Corrective Action, it will automatically populate the RCCAID in the Corrective Action Table so that it is associated directly to the RCCA. I don't want to have to have someone know what the RCCAID is from teh RCA table because they are autogenerated.
    There may be a better way to do this and since I am new to APEX and to Oracle Databases, I am just going with what my logic tells me. Any assistance or thoughts would be appreciated.
    Assuming there would be some type of trigger?
    I will have to be able to view each RCCA and CA in a report that customers will see.
    Thanks in Advance
    Wally

    Hi Debasis,
    Have a look on this
    Quick note on IDENTITY column in SAP HANA
    Regards,
    Krishna Tangudu

  • Insert into a table with unique columns from another table.

    There are two tables,
    STG_DATA                                                          
    ORDER_NO    DIR_CUST_IND
    1002                     DNA
    1005                     GEN
    1005    
    1008                     NULL
    1001                     NULL
    1001                     NULL
    1006                     NULL
    1000                     ZZZ
    1001                     ZZZ
    FACT_DATA
    ORDER_NO    DIR_CUST_IND
    1005                      NULL
    1006                      NULL
    1008                      NULL
    I need to insert only unique [ORDER_NO] from STG_DATA to FACT_DATA with corresponding [DIR_CUST_IND]. Though STG_DATA has multiple rows with same ORDER_NO, I need to insert only one of that it can be any record.
    Sarvan

    CREATE TABLE #Level(ORDER_NO INT, DIR_CUST_IND CHAR(3))
    INSERT #Level
    SELECT 1002,'DNA' UNION
    SELECT 1005,'GEN' UNION
    SELECT 1005,NULL UNION
    SELECT 1008,NULL UNION
    SELECT 1001,NULL UNION
    SELECT 1001,NULL UNION
    SELECT 1006,NULL UNION
    SELECT 1000,'ZZZ' UNION
    SELECT 1001,'ZZZ'
    SELECT ORDER_NO,DIR_CUST_IND
    FROM( SELECT ROW_NUMBER()OVER(PARTITION BY ORDER_NO ORDER BY ORDER_NO) RowNum,*
    FROM #Level)A
    WHERE RowNum=1
    I hope this would give you enough idea. All you have to do is just write insert statement.
    Next time please post DDL & DML.
    Chaos isn’t a pit. Chaos is a ladder. Many who try to climb it fail and never get to try again. The fall breaks them. And some are given a chance to climb, but they refuse. They cling to the realm, or the gods, or love. Illusions. Only the ladder is real.
    The climb is all there is.

  • Looping delete statement where table name is coming from another table

    Hi All,
    We have to write code to delete records from active tables of WDSO.We have 5 DSO  so inspite of writing delete statement for each table we want to put all table names into one table and then loop through it .but we are getting error when we are refering that table field which has active table name.error is :
    "dictionary structure or table is either not active or does not exist "
    As per my understanding in a delete /select /insert /update statement we need to put table name (whose field we are refering ) it can't be replaced by a variable .
    ex: v_table = 'EMPLOYEE' .
    DELETE FROMv_table WHERE EMP_NAME = 'ABDC' .
    is wrong and it must be like
    ex : DELETE FROM EMPLOYEE WHERE EMP_NAME = 'ABDC' .
    but we want to make our code dynamic .
    Can you please suggest a way so that we can read the table names from another table and delete data based on some selection fom those tables .
    I tried variants ,perform etc and even searched FM for the same but not found a solution .Your help will be greatly appreciated .
    Thanks in advance .
    Regards,
    Jaya

    Hi,
    You can change your statement as follows:
    DELETE FROM (v_table) WHERE EMP_NAME = 'ABDC' .
    However, I would not recommend this. There is a standard function module RSAN_ODS_DATA_DELETE which allows selective deletion - that should be a safer way to do this. You can

  • Procedure to insert data into table by selecting data from another table

    Hi all,
    I have to create a procedure where i have to select the data from one table and insert it into another table. Any help on this. And i have to update the 2nd table also when ever new records got inserted in the 1st table then.
    Regards

    Hi, you can try something like:
    CREATE [OR REPLACE] PROCEDURE procedure_name
    IS
    BEGIN
    INSERT INTO TABLE1
    VALUES (SELECT * FROM TABLE2);
    END;
    For the other part you may create a trigger on the first table AFTER INSERT to insert the values in the second table too.

  • Create a table which has columns from another table in other schema

    Hi All
    I need to create a table which is table driven i.e., the columns of that table need to be inserted from another table in a different schema...Can any one help me with this??

    create table newtab (--column spec here--) as
    Select --columns here-- from otherschema.tablename;max

  • Updating a field from info from another table

    I am trying to update a field in a table by the data from another lookup table. These tables have to be linked by two columns, not just one. It seems like I have to use a sub query to extract data from the lookup table. I am unable to get a correct syntax for the SQL statements.
    Does anyone has any ideas??

    UPDATE table_B t2 SET t2.col1 = (SELECT t1.col1 FROM table_A t1 WHERE t1.col2 = t2.col2 AND t1.col3 = t2.col3);
    table_B is the table whose col1 needs to be updated with col1 of table_A. The join conditions are two (with col2 and col3)
    Hope this is what you are looking for!!
    Cheers
    r@m@

  • Sort a Table with data extracted form Another table

    I have a MAster Table that consist of many columns of data. I have extracted data (rows) from the table to another table for a list. I used vlookup to get the extracted data. In my new table everything is list ed out perfectly. I want to sort the table using one of the columns. I tried the reorganize button and just sorting on that one column and it won't sort. I know I'm doing something wrong whether the way I am extracting the data,or something else. Do I use lookup and large or small function to list and sort it from the main table? I stumped. Anybody have sugestions?

    Hi tj,
    "The Master file is the second image. I have extracted the data for the second table(second image). "
    Hmmm...
    Both tables are the second image. Good trick!
    Good thing you included the description.
    The (modified) Master table is Table 1 on Sheet 15. From this, you are extracting the participants for "R & B Winter Sk8 Jam. You want the extracted rows to be displayed on the Contestant Sheet table sorted by Division.
    I see two possible lines of attack here:
    The simplest might be to presort the Master table on Division, then within that sort, on last name, then on first name. With the Master table in that order, extracting the data using the index you are currently using should pull the rows in the desired order.
    Construct an index of numerical values constructed from the sum of:
    -- a very large number corresponding to the event, pulled from a Lookup table.
    -- a large numbers corresponding to the division, pulled from a second Lookup table.
    -- a small number corresponding to he count (from the top of the main tale to the current row) of Sk8ers entered in each event. (This, I think, would be the same as the count in your Index column.)
    Retrieval would be done using RANK to determine the smallest and largest index values to retrieve, and SMALL to collect data from the rows with index values within that range.
    No. 2 is at the concept stage, and is open to anyone wanting to give it a go.
    Regards,
    Barry

  • How to populate rows in the detail table of a form from another table.

    please can someone help me here:
    i have a master/detail page. the master data is created and then i would like to do this: when one goes to the detail page (when first created), i would like somehow to populate all the rows in the detail table from rows retrieved in another table (with conditions).
    i am new to apex so if this is a stupid question i apologise in advance!

    Hi
    Firstly, there are no stupid questions, we all start somewhere!
    However, I could do with some more detail (or even better an example on apex.oracle.com). Please can you post exactly what you have so far and what you want to achieve with simple details of the tables involved.
    It sound like you may need to create a custom process to populate the details. You say 'with conditions'... what conditions?
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Opening a view from another view of the same window in diff Browser.

    Hi Experts,
    My requirement is to open a view (say view 2) from another view (say view 1) with click of a button in a different browser, both the views are embedded into the same window, and also i have to pass some data from view1 to view2, based no the input data, i am displaying some information. Also both views belog to the same component.
    Some pointers on this would be of great help.
    Regards,
    Ashish.

    You would need to open another window.
    See if_wd_window and if_wd_window_manager.
    Call the GET_API to get a handle to window manager.
    The new window can show V2.
    The original Window with 2 views,
    must fire plug to navigate v2 to empty view to hide it from Window1.
    The to Views talk to one another via WDC Controller.
    View 2 calls WDC controller methods.  The WDC controller the fires Event.
    View 1 can listen to this event with a method of type event handler.
    View 1 can for example react to button on View 2 and close WINDOW 2.
    Good luck
    Phil.

  • Ain't getting it: insert into table by determing value from another table

    I have a table (PERCENTILE_CHART) with percentiles and test scores for different tests:
    Structure:
    Percentile, Reading_Test, Writing_Test
    Data:
    30,400,520
    31,450,560
    97,630,750
    98,630,780
    99,640,800
    The data is currently in ascending order by Percentile.
    If a person took the Reading test and scored 630 he or she would be in the 98th (not 97th) percentile of the class taking that test.
    I wrote a statement to return the percentile:
    select Percentile
    from ( select ROWNUM, PERCENTILE
    from PERCENTILE_CHART
    where READING_TEST <= '650'
    order by READING_TEST desc)
    where ROWNUM < 2 order by PERCENTILE desc;
    This select works and is able to determine the highest percentile for a score.
    Ok, now I want to process all the records in a STUDENT table which have
    test scores and insert them in a new table along with the percents, normalizing the data in the process.
    Have this:
    STUDENT:
    Student_Name,Student_ID,
    John Smith,121,Reading,98,Writing,90
    Maggie Smithe,122,Reading,95,Writing,96
    And needs to be moved to into SCORES with the percentiles, so I get this:
    SCORES:
    Student_Name,Student_ID,Test_Name,Percentile
    121,Reading,98
    121,Writing,90
    122,Reading,95
    122,Writing,96
    This is were I get confused. How do I insert the data into the SCORES table with the percentile? I think calling a function in package is the way to do it:
    function oua_Test_Percentile_f (
    p_Test_Name in char,
    p_Test_Value in char)
    return char as
    -- Declare variables
    c_Return_PTile char(2);
    begin
    select PERCENTILE into c_Return_PTile
    from (select ROWNUM, PERCENTILE
    from PERCENTILE_CHART
    where p_Test_Name <= '&p_Value'
    order by p_Test_Nmae desc)
    where ROWNUM < 2 order by PERCENTILE desc;
    return c_Return_PTile;
    end;
    But this function doesn't return the percentile even though it is based on my working select mentioned earlier. It returns a blank for all tests.
    And even if it is working how do I then populate the SCORES table?

    You may want to use analytical functions so that you can determine the percentile across all of the different scores:
    SQL> with
    2 PERCENTILE_CHART as
    3 (
    4 select 30 PERCENTILE, 400 READING_TEST, 520 WRITING_TEST from dual union all
    5 select 31 PERCENTILE, 450 READING_TEST, 560 WRITING_TEST from dual union all
    6 select 97 PERCENTILE, 630 READING_TEST, 750 WRITING_TEST from dual union all
    7 select 98 PERCENTILE, 630 READING_TEST, 780 WRITING_TEST from dual union all
    8 select 99 PERCENTILE, 640 READING_TEST, 800 WRITING_TEST from dual
    9 )
    10 select
    11 max(percentile) over (partition by reading_test) HIGHEST_READING,
    12 max(percentile) over (partition by writing_test) HIGHEST_WRITING,
    13 percentile_chart.*
    14 from
    15 percentile_chart
    16 /
    HIGHEST_READING HIGHEST_WRITING PERCENTILE READING_TEST WRITING_TEST
    30 30 30 400 520
    31 31 31 450 560
    98 97 97 630 750
    98 98 98 630 780
    99 99 99 640 800
    SQL>
    I wasn't exactly sure how you wantd to coorelate this to the student records though; the student table had only two column name headings but there were four rows listed as examples and had fewer rows than in the percentile_chart table...
    If you join the student table to the able query it might be what you are looking for.
    You can create another table based on the output of your query by doing:
    create table scores
    as select * from
    (insert your query here)
    /

  • Substitute from another line in the same document - MIRO & FB60

    Hi ABAPers,
    Would any of you please advise me on how to achieve the automatic substitution of certain field information from another line item in the same accounting document. For example,
    Dr Vendor
    Cr P & L
    Dr Balance sheet (automatic)
    On the Line item "balance sheet", I would like the logic to search withint the same document to copy attribute from the first line item 'Vendor'. Please advise me on how to achieve this on the following both scenario
    - MIRO (Logistic Invoice Verification)
    - FB60 (Finance Invoie)
    Kind regards

    Hi
    Thanks for the note.
    The information I would like to substitution are terms of payment, vendor number, baseline date and Text field.
    also advise With reference to 386896 - Substitution for call-up point 3 ('Complete document'), how would we be able to achieve the call up point 3 things if the origin of the document is from MM (MIRO).
    Thanks in advance
    taro

  • I would like to be able to sync from another ID on the same computer that sync now works on.

    I have a laptop running XP SP2.
    Sync was setup on this machine on an administrator account, and works fine. I usually run this machine from another non-administrator account. The device I am syncing to is an iPod Touch.
    I would like to be able to use my existing Sync account.
    When I start to add this device and am typing my email address in it does not let me complete the field.
    I am running FF4 beta.
    Could someone please assist me with this problem.

    When you try to use the Mac side on your external monitor do you get a blank screen or do you see the aurora background?
    It would help to know which one of the 9 different models of MacBook you have. To see which model you have go to the Apple in the upper left corner and select About This Mac, then click on More Info. When System Profiler comes up check the Model Identifier and post it back here.

  • Adding files from another desktop on the same computer

    I am new to this discussion and I did a quick search to see if anything turned up similar to this question. My husband and I have our own desktops on our Mac; he has several songs that I want from his iTunes library and vice versa. We can't figure out how to add files from each other's library to save our lives. When I go to the import section of iTunes, I can get to his desktop, but there is a little stop symbol with a "-" sign next to his music folder. It is probably very simple, but short of burning a disc and doing it that way, I can't figure it out. Any help would be greatly appreciated.
    Jill
    Power PC G5   Mac OS X (10.4.5)  

    The stop/- sign means the folder is read protected. You can only (by default) use his public folder. To transfer items via copying them over the network you would need to log in as an administrator (most likley as his account) remotely. This will give you acccess to all of his folders.
    If you want to copy between folders on the same machine you need to be an administrator. Try logging in with the admin account.
    If you want to just share the music you can do that too. In OS X Preferences -> Sharing -> Firewall -> check the share iTunes Music checkbox.
    In iTunes you would then need to go to iTunes Preferences -> Sharing -> Make sure both the share button and the "Looked for shared music" and "Share my Music are checked" are checked.
    Do this two both machines.
    And you should then see a folder in iTunes with the other music.
    If you are on a network this works out well with out having to duplicate two sets of data/mp3s.
    Hope this helps.
    -J

Maybe you are looking for

  • Object Oriented Programming concepts

    Hi Friends, I need your help to understand the Object Oriented Programming concepts. Please help me- Thanks, Fl4syed

  • Predefined Search Help for WERKS doesn't work properly

    Hi Experts, in my dynprofield I have a field called 'gf_werks'. In Screen painter I manually added predefined search help H_T001W_T. If I push F4 on gf_werks search help pops up. But if I select one entry it transports the name of selected werks. But

  • SDN Blog on What's new in Nakisa 3.0

    Hi all, Below is an SDN blog I wrote detailing some of the new features and functionality in STVN 3.0. [/people/luke.marson/blog/2010/07/23/whats-new-in-nakisa-30|/people/luke.marson/blog/2010/07/23/whats-new-in-nakisa-30] Enjoy! Luke

  • How can I delete folder in Messages - Show Folder

    Hi. I have BB9900. When I will go to Messages->Show Folder – then I see Folders  And there is some e-mail adress, inbox etc. many of them. There is also one e-mail address which is not used for me now – it's used in past. I would like to delete that

  • Using a logo on the background?

    I need to be able to use a non-square logo (with its alpha channel) overlayed on the background. The logo is to remain on screen throughout the menu, but its not practical to comp the logo onto the background in photoshop (moving bkgd!). I cannot fin