Update Table from view data

I want o update the Table using the view of a table of different schema. A dblink is created between two schema's ?
Kindly suggest the method to implement this ?
What Form type should i use?
Its is possible to use collections?
Sanjay

user12957777 wrote:
I want o update the Table using the view of a table of different schema. A dblink is created between two schema's ?
Kindly suggest the method to implement this ?
What Form type should i use?
What do you mean by "connection"?
If you use a single database then just add schema's preffix and that's all.
under table owner:
insert into <table_name> select * from <schema>.<view>under view owner:
insert into <schema>.<table_name> select * from <view>But make sure your users get necessary grants.

Similar Messages

  • Union tables from multiply data srouces in OBIEE

    Hi Pros,
    Recenetly I am doing a POC about union the same structure table from multiply data sources through OBIEE, uptill now I still can't make that out, I have tried below ways :
    Precondition: I have configured those two tables under one physical folder with two connection pool
    1. When do the union in physical level, can not implement since either can not create a view union two tables or using SQL.
    2. When do the union in Logical level, can not implement also
    I know that this kind of data integration should be done before we import into OBIEE model, but there is some policy that we can't integrate, so I just wondering whether OBIEE has this functionlity that can union data from different data source. Please advise.
    thanks

    Hi Srinivas
    After a second thought, I am wondering what you mean in the post, but the situation is that there are two tables in different data sources, Table-A and Table-B in the Physical layer, they are not yet integrated into one table(let's say Table-C), you mean add a data source indictor column into a table in BMM layer, I want to know how can we integrate data (UNION), because from my perspective, if TABLE-A have bleow column ID,NAME,ADDRESS, while the TABLE-B have the same, the difference is the data bwtween them, even we create a logicl table in BMM, drag those those columns, we only get ID,NAME,ADDRESS,ID#,NAME#,ADDRESS#, but the table structure is different.
    The problem is how to create a logic table like TABLE-D (ID,NAME,ADDRESS) which have the data both from TABLE-A and TABLE-B in Physical Layer. While no need to filter by prompt about the data sources. We need to show the data altoghter.
    Please advise if I missing you point.
    thanks
    Edited by: Henry He on Dec 28, 2010 3:21 PM

  • Create table from view giving error

    i am trying to creating a table from view it is giving following error. can you please help
    create table jd as
    select * from A.ab_v where 1=2;
    error
    ORA-01723
    zero columns not allowed

    As others already pointed out you have NULL as view column(s). You need to either modify view and use CAST(NULL AS desired-type). For example:
    SQL> create or replace
      2    view v1
      3      as
      4        select  null new_date
      5          from dual
      6  /
    View created.
    SQL> create table tbl
      2    as
      3      select  *
      4        from  v1
      5  /
        select  *
    ERROR at line 3:
    ORA-01723: zero-length columns are not allowed
    SQL> create or replace
      2    view v1
      3      as
      4        select  cast(null as date) new_date
      5          from dual
      6  /
    View created.
    SQL> create table tbl
      2    as
      3      select  *
      4        from  v1
      5  /
    Table created.
    SQL> drop table tbl
      2  /
    Table dropped.
    SQL> create or replace
      2    view v1
      3      as
      4        select  cast(null as number) new_number
      5          from  dual
      6  /
    View created.
    SQL> create table tbl
      2    as
      3      select  *
      4        from  v1
      5  /
    Table created.
    SQL>  Or list individual view columns with NULL CASTing in CTAS:
    SQL> create or replace
      2    view v1
      3      as
      4        select  null new_date
      5          from dual
      6  /
    View created.
    SQL> create table tbl
      2     as
      3       select  cast(new_date as date) new_date
      4         from  v1
      5  /
    Table created.
    SQL> desc tbl
    Name                                      Null?    Type
    NEW_DATE                                           DATE
    SQL> set null NULL
    SQL> select  *
      2    from  tbl
      3  /
    NEW_DATE
    NULL
    SQL> SY.

  • Inserting the column values into table from view through procedure!!!

    below is my example code
    Create or replace procedure test_proc
    is
    cursor test_cur is
    select a.col1 , b.col2, c.col3, d.col4, e.col5
    from tableA a, tableB b, tableC c, tableD d, tableE e;
    test_cur_rec test_cur%rowtype;
    Begin
    insert into test_stg ( col1, col2, col3, col4, col5, col6, col7)
    Values ( test_cur_rec. col1,
    test_cur_rec .col2,
    test_cur_rec .col3,
    test_cur_rec .col4,
    test_cur_rec .col5
    -- col6, col7 );
    create view test2 (
    select f.col6, g.col7 from tableF f,tableG g);
    I m trying to insert values into the table test_stg but for col6 and col7 i need to get the data from the view test2.
    In simple word, all i need to do is get the 2 columns data from view and insert into a table through procedure. The above code is the example which looks very much like my actual code.
    How do i accomplish this task ??

    well there is joining condition for a, b,c ,d, e tables, i have not mentioned here. The where condition has nothing to do with the other two columns of the view.
    There is no relation ship between the these tables the view. The col 6 and 7 i m inserting from view is sysdate timestamp and the job_id number.
    so its pretty straight forward insertion into the table from view columns. These two columns has just one row with id number and timestamp. so i need to insert these data into the the table when i run a procedure.
    Thank you so much!!!

  • Update table from SM30 with automatic Time Stamp

    Hi,
    I have created a table maintenance generator for updating table from SM30.
    Now there are fields in my table which are CRETING TIME and CHANGING TIME. Both being TIMESTAMP field (datatype: RSDDTZNTSTMPS).
    Is it possible while user updates records/create new record in the table from SM30, these time stamp field to automatically get populated.
    Also is there any F4 help available for TIMESTAMP field?
    ags.

    Hi,
    You need to do two things inorder to get the desired results.
    1) Go to Screen Layout of the Screen created by table maintenance generator and make the date/time columns to DISPLAY ONLY. This will ensure that user is not able to modify the values at runtime
    2) Write the code in PAI of the Module pool program to populate the values at runtime using Sy-datum/sy-uzeit. (Hint : Search for INSERT/MODIFY statements which will show the location before which you need to write your logic)
    Regards,
    Kshitija

  • How to get internal table from SAP Data Provider C#

    Hello.
    ABAP:
       DATA: lt_t001 TYPE TABLE OF t001.
       DATA: url(1000) TYPE c.
      SELECT * INTO TABLE lt_t001 FROM t001.
      CALL FUNCTION 'DP_CREATE_URL'
        EXPORTING
          type                 = 'APPLICATION'
          subtype           = 'X-R3TABLE'
        TABLES
          data                 = lt_t001
        CHANGING
          url                    = url
        EXCEPTIONS
          OTHERS           = 4.
    C#:
    using SAPDataProvider;
    using SAPTableFactoryCtrl;
    public void SetDataFromUrl(string url)
                SAPDataProviderClass p = new SAPDataProviderClass();
                p.SetDataFromURL("APPLICATION", "X-R3TABLE", url);
                ISapDPR3Table tbl = p.GetDataAsR3Table("APPLICATION", "X-R3TABLE");
                SAPTableFactoryClass tf = new SAPTableFactoryClass();
                Table tb = (Table)tf.NewTable();
                tb.ISAPrfcITab = tbl.DataTable; // Exception !!!!!!
    How to get internal table from SAP Data Provider ?

    Hi Sergey,
    I'm trying to do the same, have you found a solution to solved it?
    thanks for your help.
    Regards.
    Jonathan

  • Updating table from stored procedure in TimesTen

    Hi experts,
    I am unable to update table from procedure; here is what I did -
    Created and populated table -
    Command> create table test_table(key integer,value integer);
    Command> insert into test_table values(1,10);
    1 row inserted.
    Command> insert into test_table values(2,20);
    1 row inserted.
    Command> insert into test_table values(3,30);
    1 row inserted.
    Command> select * from test_table
    > ;
    < 1, 10 >
    < 2, 20 >
    < 3, 30 >
    created procedure -
    Command> create or replace procedure testtable_update(key integer,value integer) as
    > begin
    > update test_table set test_table.value = value where test_table.key = key;
    > end;
    > /
    Procedure created.
    Executed procedure -
    Command> begin
    > testtable_update(3,60);
    > end;
    > /
    PL/SQL procedure successfully completed.
    Command> select * from test_table
    > ;
    < 1, 10 >
    < 2, 20 >
    < 3, 30 >
    I am not seeing update, in underlying table. What could be the reason for this?
    If I do following it works -
    Command> update test_table set test_table.value = 60 where test_table.key = 3;
    1 row updated.
    Command> select * from test_table;
    < 1, 10 >
    < 2, 20 >
    < 3, 60 >
    3 rows found.
    Am I missing something?
    Any pointers or help will be greatly appreciated.
    Thanks

    The problem is that the parameter names in your procedure are the same as the column names, hence the columns are being updated with the same values. You have two options:
    1. Change the names of the parameters by adding a prefix. For example:
    create or replace procedure testtable_update( p_ key integer,*p_* value integer)
    begin
    update test_table set test_table.value = p_ value where test_table.key = p_ key;
    end;
    2. Qualiflying the parameters with the procedure name.
    create or replace procedure testtable_update(key integer,value integer)
    begin
    update test_table set test_table.value = testtable_update. value where test_table.key = testtable_update. key;
    end;
    Simon

  • Load / Update Table from a .csv file

    Hi All,
    I thought I would just throw this out there..be kind.
    I have a requirement to build a page that allows the user to upload a excel (well I'll have them save it as a .csv) and upate an existing table in their schema.
    I have successfully created a similar page for inserting into an existing table however my update is not working. Then I realized what the Oracle Application Express Tool does that for me on, LOAD DATA page. The feature I like best is that after browsing for the file and clicking next it shows the column header and the row data underneath. I would really like to duplicate the functionality of this page.
    I looked into the flows schema found related procedures , for example wwv_flow_load_excel_data,but I'm lost on how to use them.
    Is there a way to duplicate the LOAD DATA Page and fit it to meet the users requirement?
    Also I have included my coding attempt :
    CREATE OR REPLACE PROCEDURE exceltotable2
    AS
    NAME: exceltotable
    PURPOSE:
    REVISIONS:
    Ver Date Author Description
    1.0 11/17/2008 1. Created this procedure.
    NOTES:
    Automatically available Auto Replace Keywords:
    Object Name: exceltotable
    Sysdate: 11/17/2008
    Date and Time: 11/17/2008, 2:02:03 PM, and 11/17/2008 2:02:03 PM
    Username: (set in TOAD Options, Procedure Editor)
    Table Name: (set in the "New PL/SQL Object" dialog)
    v_blob_data BLOB;
    v_blob_len NUMBER;
    v_position NUMBER;
    v_raw_chunk RAW (10000);
    v_char CHAR (1);
    c_chunk_len NUMBER := 1;
    v_line VARCHAR2 (32767) := NULL;
    v_data_array APEX_APPLICATION_GLOBAL.VC_ARR2;
    v_rows NUMBER;
    v_asset_id NUMBER;
    v_new_location GINOS_LOCATION.ID_LOCATION%TYPE ;
    sql_stmt VARCHAR2 (2000);
    --delete from data_upld;
    BEGIN
    -- Read data from wwv_flow_files</span>
    SELECT blob_content
    INTO v_blob_data
    FROM wwv_flow_file_objects$
         WHERE NAME = 'F32700/scannedforrdc.csv';
         --(used this for testing)
    -- WHERE last_updated = (select max(last_updated) from WWV_FLOW_FILE_OBJECTS$ where UPDATED_BY
    -- = 'ADMIN')
    --and id = (select max(id) from WWV_FLOW_FILE_OBJECTS$ where UPDATED_BY = 'ADMIN');
    v_blob_len := DBMS_LOB.getlength (v_blob_data);
    v_position := 1;
    -- Read and convert binary to char</span>
    WHILE (v_position <= v_blob_len)
    LOOP
    v_raw_chunk := DBMS_LOB.SUBSTR (v_blob_data, c_chunk_len, v_position);
    v_char := CHR (hex_to_decimal(RAWTOHEX(v_raw_chunk)));
    v_line := v_line || v_char;
    v_position := v_position + c_chunk_len;
    -- When a whole line is retrieved </span>
    IF v_char = CHR (10)
    THEN
    -- Convert comma to : to use wwv_flow_utilities </span>
    v_line := REPLACE (v_line, ',', ':');
    -- Convert each column separated by : into array of data </span>
    v_data_array := APEX_UTIL.string_to_table (v_line);
    -- Update assets with RDC location
    -- First get the current location id of the RDC
    -- Next take each serial number from the spreadsheet and update the location and rack details </span>
    Select id_location into v_new_location from ginos_location gl, ginos_site gs, ginos_agency ga
    where nm_office = 'OCFS Resource Distribution Center' and gl.id_site = gs.id_site
    And gl.id_agency = ga.id_agency And ga.nm_agency ='Office of Children and Family Services';
    -- test with only the serial number/location
    UPDATE GINOS_ASSET SET ID_LOCATION = v_new_location WHERE NM_SERIAL = v_data_array(1);
    -- Clear out
    v_line := NULL;
    v_rows := v_rows + 1;
    END IF;
    END LOOP;
    END;
    Any advice/assistance is always appreciated
    Thanks
    Moe

    Dan
    Thank You for your reply, I actually bookmark your site yesterday when googling this problem.
    I am going to give it a try. I have ran through steps 1 through 4. Step 4 , I modified to my page.
    Just a little more help..
    do I put my update table code in the procedure (step 4) - how do I view and extract the information from the collection?
    DECLARE
    l_blob BLOB;
    PROCEDURE cleanup
    IS
    BEGIN
    DELETE FROM WWV_FLOW_FILES
    WHERE name = :P103_UPLOAD;
    END cleanup;
    BEGIN
    SELECT blob_content
    INTO l_blob
    FROM WWV_FLOW_FILES
    WHERE name = :P103_UPLOAD;
    csv.create_collection_from_blob(l_blob, 'CSV_UPLOAD', 'Y');
    -- I looked in the ginodba schema (the ref schema for the app) for this collection but it's not there
    cleanup;
    EXCEPTION
    WHEN OTHERS
    THEN
    cleanup;
    RAISE;
    END;
    Thanks Again
    MOe

  • Insert and update tables from SQL server to oracle database tables

    Hi,
    I am having problem while update data from sql server to oracle database tables.
    I am doing one way insert +updates that is from SQL Server tables ==> Oracle database tables
    I am using tools Sql server Integration service. I can insert data from sql server to oracle but update can't. Please help me how can I update + insert from sql server to oracle database tables easily.
    Thanks in advance.

    Hi,
    What about using Oracle SQL Developer for migration
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html
    HTH

  • ADF BC creating table from view

    This is plain stupid all this crap of IDE's and Frameworks and things alike. I just loose a few days of work trying to do the simplest thing, create a table from a BC view. I did what the tutorials say, just drag&drop a %$$/& data control from the data control pallete and so on...
    The IDE just add a lot of libraries to my project, changed a bunch of things in web.xml and God knows where more, and the result is this:
    java.lang.ClassCastException: oracle.adfinternal.view.faces.uinode.UIComponentUINode     at oracle.adfinternal.view.faces.uinode.UIXComponentUINode.__getAdapter(UIXComponentUINode.java:435)     at oracle.adfinternal.view.faces.uinode.UINodeRendererBase.encodeBegin(UINodeRendererBase.java:29)     at oracle.adf.view.faces.component.UIXComponentBase.encodeBegin(UIXComponentBase.java:528)     at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:584)     at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:471)     at oracle.adf.view.faces.webapp.UIXComponentTag.doStartTag(UIXComponentTag.java:82)     at loginPage.jspService(_loginPage.java:70)     [loginPage.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:298)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:42)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:205)     at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)     at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)     at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)     at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:134)     at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:264)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:151)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:123)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)     at oracle.adfinternal.view.faces.webapp.FacesFilter.doFilter(FacesFilter.java:89)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)
    What's the use of these tools? If i were to made this on my one i had my work done by know instead of loosing some days of work...
    Anybody could help here

    So basically that means that instead of being me, the programmer, that tells the machine what to do, it's the machine, by means of a framework, that tells me what to do... So much for the fun and criativity of being a programmer, now we're supposed to be some simple technocrats that assemble code in a production-line instead of artists that create some nice piece of work that not only works but it's beautifull too. I think i'm getting too old for this, maybe it's time to move up onto management...
    I don't resist to tell this little story:
    Once upon a time, in mid-ages Rome, a wise bishop was walking down the lane when he sees two workers laying down bricks. He ask one of then;
    - Good men , what are you doing?
    - Laying down bricks, the man answers...
    And then asks the second man,
    - And you, my good man, what are you doing?
    - I'm building a Cathedral...
    I allways think of myself as "building Cathedrals", now after all these years i have to just "lay out bricks"?

  • Update Table with xml data

    Hi,
    I have to update Table by reading Xml data.
    I have written a procedure which is given below.
    PROCEDURE Sp_Set_File_Permission
    p_i_v_xml_data  IN VARCHAR2,
    Cur_Out_Col_Nm    OUT Typ_Icon_Out
    IS 
    XmlDataset   XMLTYPE;
      BEGIN
    /* This is my xml
    <xmldata>
    <newdataset>
    <fileid>99</fileid>
    <add>TRUE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    <newdataset>
    <fileid>100</fileid>
    <add>FALSE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    </xmldata>*/
    xmldataset := Xmltype.Createxml(p_i_v_Xml_Data);
    --error occured on this line while executing procedure
    FOR i IN (SELECT
                   Dt.Extract('//newdataset/fileid/text()').Getstringval() AS Fileid,
                   Dt.Extract('//newdataset/add/text()').Getstringval() AS Add,
                   Dt.Extract('//newdataset/edit/text()').Getstringval() AS Edit,
                   Dt.Extract('//newdataset/del/text()').Getstringval() AS d,
                   Dt.Extract('//newdataset/ex/text()').Getstringval() AS e,
                   Dt.Extract('//newdataset/im/text()').Getstringval() AS I
                    FROM TABLE(Xmlsequence( xmldataset.Extract('//xmldata/newdataset'))) Dt)
        LOOP
        UPDATE t_object_master
      SET add_view=i.Add
      ,edit_view=i.Edit,
      delete_view=i.D,
      export_view=i.E,
      import_view=i.I
      WHERE objct_id=i.Fileid;
      COMMIT;
      END LOOP;
      END Sp_Set_File_Permission;
    When I am trying to exceute this procedure with the above mentioned xml ,getting error ORA-00923 ,FROM keyword not found where expected.
    Please help me out in this.
    Thanks,

    Something like this (no commit inside loop, no row per row)
    create table t_object_master as
    with myxml as (
    select xmltype(
    '<xmldata>
    <newdataset>
    <fileid>99</fileid>
    <add>TRUE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    <newdataset>
    <fileid>100</fileid>
    <add>FALSE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    </xmldata>') doc from dual
    select
    fileid
    ,add_view
    from
    myxml
    ,xmltable('//newdataset'
    passing myxml.doc
    columns
    Fileid number      path 'fileid'
    ,add_view varchar2(5) path 'add'
    table created
    select
    from t_object_master
    FILEID
    ADD_VIEW
    99
    TRUE
    100
    FALSE
    update t_object_master t
    set add_view = (
    with myxml as (
    select xmltype(
    '<xmldata>
    <newdataset>
    <fileid>99</fileid>
    <add>FALSE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    <newdataset>
    <fileid>100</fileid>
    <add>TRUE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    </xmldata>') doc from dual
    , myextract as (
    select
    fileid
    ,add_view
    from
    myxml
    ,xmltable('//newdataset'
    passing myxml.doc
    columns
    Fileid number      path 'fileid'
    ,add_view varchar2(5) path 'add'
    select
    add_view
    from myextract
    where
    fileid = t.fileid
    select *
    from  t_object_master
    FILEID
    ADD_VIEW
    99
    FALSE
    100
    TRUE

  • Can not insert or update [TABLE] from internal table in method

    I've faced a problem with OO abap. I've tried to insert into [ TABLE ] from internal table, but i've got error msg after i compiled.
    "An explicit work area is necessary in the OO context. Use "INSERT wa INTO [TABLE] itab""
    After  i changed to loop in work area and INSERT INTO  [TABLE] VALUES gw_data., everything is fine, can compile and run.
    This is error code.
      METHOD set_data_to_table.
        REFRESH gi_data.
        CLEAR gi_data.
        IF gi_file[] IS NOT INITIAL.
    * Set data for modify table
          LOOP AT gi_file INTO gw_file.
            MOVE-CORRESPONDING gw_file TO gw_data.
            me->conversion_input( EXPORTING im_vendor = gw_data-vendor
                                  CHANGING  ch_vendor = gw_data-vendor ).
            APPEND gw_data TO gi_data.
          ENDLOOP.
          INSERT [TABLE] FROM TABLE gi_data.
    *      LOOP AT gi_data INTO gw_data.
    *        INSERT INTO  [TABLE] VALUES gw_data.
    *        IF sy-subrc = 0.
    *          COMMIT WORK.
    *        ELSE.
    *          ROLLBACK WORK.
    *        ENDIF.
    *      ENDLOOP.
        ELSE.
          MESSAGE 'No data found' TYPE 'I'.
        ENDIF.
      ENDMETHOD.                    "set_data_to_table

    Hi Matthew,
    I think there is no difference in database insert between OO and non-OO.
    The correct syntax according to ECC600 online documentation is
    [Inserting Several Lines|http://help.sap.com/saphelp_erp2005vp/helpdata/en/fc/eb3a6d358411d1829f0000e829fbfe/content.htm]
    To insert several lines into a database table, use the following:
    INSERT target FROM TABLE itab \[ACCEPTING DUPLICATE KEYS].
    This writes all lines of the internal table itabto the database table in one single operation. If one or more lines cannot be inserted because the database already contains a line with the same primary key, a runtime error occurs. You can prevent the runtime error occurring by using the addition ACCEPTING DUPLICATE KEYS.
    Whenever you want to insert more than one line into a database table, it is more efficient to work with an internal table than to insert the lines one by one.
    I think the syntax
    INSERT my_dbtable FROM TABLE gi_data.
    should work, your suggestion may lead to syntax error.
    Regards,
    Clemens

  • Update 0funct_loc from 2 data source

    Dear all,
    i am filling 0funct_loc from 2 data source, one is 0funct_loc_attr, and the other is 1cl** from characteristics data source.
    My problem is both data sources work fine, however after uploading 0funct_loc, and try to upload run1cl**, it finds records but does not update specific fields of 0funct_loc as that funct_loc exists.
    My data flow is 2 data sources(0funct_loc_attr, and the other is 1cl** ) in the bottom, one info source joining that and update rule to 0funct_loc.
    Any help?
    Thanks..

    Hi John,
    What are you trying to do here? In case each datasource will deliver different data (characteristics) of the function location, I would suggest to create two infosources (one for each datasource) and update the available characteristics.
    In the monitor of the function location, you will still see that no records have been added, but still the attributes that are solely delivered by one datasource should be updated in that case.
    hope this helps.
    best regards,
    Arno

  • Need a Query to update table from another table.

    I have two tables Table A and Table B , till now in table “A”. I have a column which consist of IDs and duplicate IDs( which are basically formed by Original Ids) , I have another table i.e. table “B” , which gives a mapping between original ids and duplicate Ids
    TABLE A:
    ID/DUPLICATEID      NAME
    1     Rahul
    1_CAD     Pawan
    2     Nikhil
    3     TOM
    3_CAD     Ravi
    3_MQ     Puneet
    TABLE B:
    ORIGINALID     DUPLICATEID
    1     1_CAD
    3     3_CAD
    3     3_MQ
    Now I want to have another column in Table “A” , which will give me the mapping between the original Id and duplicate Id as shown in updated table “A”.
    UPDATED TABLE A:
    ID/DUPLICATEID     NAME     ORIGINAL_ID
    1     Rahul     
    1_CAD     Pawan     
    2     Nikhil     
    3     TOM     
    3_CAD      Ravi     
    3_MQ     Puneet     
    Now I want to write a Query in which I can update this column (ORIGINAL_ID) of Table “A”, from the table B(basically want to update mulitple rows using single query), because table B already has this mapping. Can any one help me in this. I am basically a Java guy , so I don’t know much about it. I hope to get a positive response from you people, Thanks in advance!

    Here you go...
    <pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%">
    <code>
    SQL&gt; CREATE TABLE A (ID VARCHAR2(10), NAME VARCHAR2(10), NEW_ID VARCHAR2(10));
    Table created.
    SQL&gt; INSERT INTO A VALUES ('1', 'Rahul', '');
    1 row created.
    SQL&gt; INSERT INTO A VALUES ('1_CAD', 'Pawan', '');
    1 row created.
    SQL&gt; INSERT INTO A VALUES ('2', 'Nikhil', '');
    1 row created.
    SQL&gt; INSERT INTO A VALUES ('3', 'TOM', '');
    1 row created.
    SQL&gt; INSERT INTO A VALUES ('3_CAD', 'Ravi', '');
    1 row created.
    SQL&gt; INSERT INTO A VALUES ('3_MQ', 'Puneet', '');
    1 row created.
    SQL&gt; CREATE TABLE B (ID VARCHAR2(10), NAME VARCHAR2(10));
    Table created.
    SQL&gt; INSERT INTO B VALUES ('1', '1_CAD');
    1 row created.
    SQL&gt; INSERT INTO B VALUES ('3', '3_CAD');
    1 row created.
    SQL&gt; INSERT INTO B VALUES ('3', '3_MQ');
    1 row created.
    SQL&gt; COMMIT;
    Commit complete.
    SQL&gt; UPDATE A
    2 SET NEW_ID = NVL((SELECT B.ID FROM B WHERE A.ID = B.NAME),A.ID)
    3 /
    6 rows updated.
    SQL&gt; COMMIT;
    Commit complete.
    SQL&gt; SELECT * FROM A;
    ID NAME NEW_ID
    1 Rahul 1
    1_CAD Pawan 1
    2 Nikhil 2
    3 TOM 3
    3_CAD Ravi 3
    3_MQ Puneet 3
    6 rows selected.
    </code></pre>
    Note: While asking question do give us DML/DDL script. It will make peoples life better.
    Karthick.
    http://www.karthickarp.blogspot.com/

  • Updating tables based on Dates

    In my application I use some tables with a date field.
    table: employee
    period date (e.g. 01-01-2004, 01-02-204, 01-03-2004)
    target money
    result money
    table: project
    date date (e.g. 15-01-2004, 20-01-2004, 03-02-2004)
    revenue money
    If I book a new project the table employee should be updated with result = result + revenue. If there is a new project on 15-01-2004 the record in employee where period = 01-01-2004 should be updated.
    Can someone help me with a sample code for this problem?

    Assuming you have a block in the form call PROJ with fields DATE, REVENUE and EMP_NO. Also that a record exists for the employee and period date.
    Create PRE-INSERT and PRE-UPDATE triggers on the block PROJ containing
    begin
    update employee
    set result=result+:PROJ.REVENUE
    where period_date=trunc(:PROJ.DATE,'Mon')
    and emp_no=:PROJ.EMP_NO;
    end

Maybe you are looking for

  • My Macbook pro is not even a month old, do I need a new battery?!

    I bought this laptop THIS month. It started acting up by shutting down with no warning. Just out of nowhere, a black sceen, and when I went to turn it back on, it would struggle to boot up.  I fixed this by resetting the PRAM, and then after that the

  • Goods Receipt PO--Copy From

    Hi friends,                  Filtration:                                 I need to filter list of purchase order in  Goods Receipt PO--Copy From.  is it possible? Help me..... Regards, Silambu

  • No AUC shown on settlement for WBS

    The WBS shows status of AUC but when you go to the the WBS and check the settlement rule, there is none shown.  If you go from the project WBS to the AUC (Extras>Asset under construction)the AUC was created.  The account assignment indicator is set a

  • Is there a firefox that works with google chrome os I have a samsung chrome book

    I recently purchased a google chrome book and would like to know if you have a version that works with the google chrome os The unit I purchased was the samsung chromebook I have used firefox for as long as i can remember and would like to continue R

  • HT201359 can i talk to a person

    i have been billed and i need to know what that was for? and i would like to be able to log in and see charges on my account with apple?