Updating XML thru view table

Given the following view table that i created
CREATE OR REPLACE VIEW PO_DETAIL_VIEW ( PAYLOADID,
ORDERNUMBER, LINENUMBER, SHIPPEDITEMQTY, COST,
ORDEREDITEMQTY, ACTION, UOM, DESCRIPTION,
SKU, STATUS, CURRENCY, PLANNEDRECEIPTDATETIME
) AS select extractValue(value(p),'/OrderMessage/MessageHeader/@payloadId'),
          extractValue(value(p),'/OrderMessage/Order/@orderNumber'),
          extractvalue(value(i),'/OrderLine/@lineNumber'),
extractvalue(value(i),'/OrderLine/@shippedItemQty'),
extractvalue(value(i),'/OrderLine/@cost'),
extractvalue(value(i),'/OrderLine/@orderedItemQty'),
extractvalue(value(i),'/OrderLine/@action'),
extractvalue(value(i),'/OrderLine/@uom'),
extractvalue(value(i),'/OrderLine/@description'),
          extractvalue(value(i),'/OrderLine/@sku'),
          extractvalue(value(i),'/OrderLine/@status'),
          extractvalue(value(i),'/OrderLine/@currency'),
          extractvalue(value(i),'/OrderLine/@plannedReceiptDateTime')
from PURCHASEORDER p, table(xmlsequence(extract(value(p),'/OrderMessage/Order/OrderLine'))) i
when i executed the following command:
UPDATE po_detail_view
SET ORDERNUMBER = '500001' where PAYLOADID='1'
I get end of file error which disconnect me from my oracle database.
but when i update my another view table it is fine.
CREATE OR REPLACE VIEW PO_MASTER_VIEW ( VERSION,
PAYLOADID, TIMESTAMP, SENDERNAME, SENDERCOMPONENT,
DOCUMENTREFERENCEID, SINGLETRANSACTION, INDEX0, INDEX1,
INDEX2, INDEX3, CLOSED, ORDERNUMBER,
ORDERTYPE, UNIQUEBUSINESSKEY, HANDLINGCODE, BUYERID,
BUYERPARTYNAME, BUYERROLE ) AS select extractValue(value(p),'/OrderMessage/MessageHeader/@version'),
extractValue(value(p),'/OrderMessage/MessageHeader/@payloadId'),
extractValue(value(p),'/OrderMessage/MessageHeader/@timeStamp'),
extractValue(value(p),'/OrderMessage/MessageHeader/@senderName'),
extractValue(value(p),'/OrderMessage/MessageHeader/@senderComponent'),
extractValue(value(p),'/OrderMessage/MessageHeader/@documentReferenceId'),
extractValue(value(p),'/OrderMessage/MessageHeader/@singleTransaction'),
extractValue(value(p),'/OrderMessage/MessageHeader/HeaderIndexedAttribute[1]/@content'),     
extractValue(value(p),'/OrderMessage/MessageHeader/HeaderIndexedAttribute[2]/@content'),               
extractValue(value(p),'/OrderMessage/MessageHeader/HeaderIndexedAttribute[3]/@content'),
extractValue(value(p),'/OrderMessage/MessageHeader/HeaderIndexedAttribute[4]/@content'),
extractValue(value(p),'/OrderMessage/Order/@closed'),
extractValue(value(p),'/OrderMessage/Order/@orderNumber'),
extractValue(value(p),'/OrderMessage/Order/@orderType'),
extractValue(value(p),'/OrderMessage/Order/@uniqueBusinessKey'),
extractValue(value(p),'/OrderMessage/Order/@handlingCode'),
extractValue(value(p),'/OrderMessage/Order/Buyer/@Id'),
extractValue(value(p),'/OrderMessage/Order/Buyer/@PartyName'),
extractValue(value(p),'/OrderMessage/Order/Buyer/@Role')
from PURCHASEORDER p
UPDATE po_master_view
SET VERSION = '2.0' where PAYLOADID='1'
i can see that the problem lies with
table(xmlsequence(extract(value(p),'/OrderMessage/Order/OrderLine'))) i
is there any better way or solutions to work ard with it?
Thanks.

Thanks Mark,
That's what i suspected the case, will log the itar later when i am free.
Actually my main issue is that I am using forms 9i to view and edit the view tables that are based on the xml schema. Forms is giving me problem in accessing complicating views.
I think my only solution is to:
1)create a custom table updated by the view table.
2)Create my form block based on custom table.
3)update the xml data using updateXML() from the custom table.

Similar Messages

  • Inserting/updating XML output to tables

    Hi,
    I have a nested XML master details record(2 or 3 table). I want to breaking into different columns and insert/update corresponding table.
    How I parsed in XML.
    Thanks
    Reena

    You need to use extractValue() sql function

  • ORA-02070: Error when updating a SQL Server table thru an Oracle View

    I have a SQL Server table TIMESHEET which contains a number of VARCHAR and NUMERIC columns plus a DATETIME column.
    Only the DATETIME column is giving me trouble.
    On the ORACLE side I have a view which selects from the SQL Server table but in order to get the SELECT to work, I had to either put a CAST or TO_DATE function call around the DATETIME field
    Below is the relevant part of the 2 view definitions I have tried
    create view TIMESHEET as
    SELECT
    "TsKeySeq" as TS_KEY_SEQ,
    "EmployeeNo" as EMPLOYEE_NO,
    CAST("PeriodEnding" AS DATE) as PERIOD_ENDING,
    . . . (more columns - not relevant)
    FROM [email protected];
    An update to the view generates this message
    ORA-02070: database OLEMSQLPSANTDAS6 does not support CAST in this context
    create view TIMESHEET as
    SELECT
    "TsKeySeq" as TS_KEY_SEQ,
    "EmployeeNo" as EMPLOYEE_NO,
    TO_DATE("PeriodEnding") as PERIOD_ENDING,
    . . . (more columns - not relevant)
    FROM [email protected];
    An update to the view generates this message
    ORA-02070: database OLEMSQLPSANTDAS6 does not support TO_DATE in this context
    If I don't include either the TO_DATE() or CAST() then I get
    Select Error: ORA-28527: Heterogeneous Services datatype mapping error
    ORA-02063:preceding line from OLEMSQLSANTDAS6
    Does anyone have any idea how to update a SQL Server DATETIME column thru an ORACLE view?

    You can't cast accross heterogenious databases and there is no need to. HSODBC treats SQL Server DATETIME column as DATE. For example, I have SQL Server table:
    CREATE TABLE [Ops].[T_JobType](
         [JobType] [varchar](50) NOT NULL,
         [JobDesc] [varchar](200) NULL,
         [InsertDt] [datetime] NOT NULL CONSTRAINT [InsertDt_00000006]  DEFAULT (getdate()),
         [InsertBy] [varchar](128) NOT NULL CONSTRAINT [InsertBy_00000006]  DEFAULT (user_name()),
         [LastUpdated] [datetime] NOT NULL CONSTRAINT [LastUpdated_00000006]  DEFAULT (getdate()),
         [LastUpdatedBy] [varchar](128) NOT NULL CONSTRAINT [LastUpdatedBy_00000006]  DEFAULT (user_name()),
    CONSTRAINT [T_JobType_PK] PRIMARY KEY CLUSTERED
         [JobType] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 100) ON [DATA01FG]
    ) ON [DATA01FG]Now on Oracle side I do:
    SQL> desc "Ops"."T_JobType"@pbods
    Name                                      Null?    Type
    JobType                                   NOT NULL VARCHAR2(50)
    JobDesc                                            VARCHAR2(200)
    InsertDt                                  NOT NULL DATE
    InsertBy                                  NOT NULL VARCHAR2(128)
    LastUpdated                               NOT NULL DATE
    LastUpdatedBy                             NOT NULL VARCHAR2(128)
    SQL> select "InsertDt" from "Ops"."T_JobType"@pbods;
    InsertDt
    18-AUG-08
    09-OCT-08
    22-OCT-09
    18-AUG-08
    19-NOV-08
    SQL> SY.

  • Select from table and Update to a view

    Hi,
    Can anybody let me if this is possible.
    I have a Master(single record)/detail(multi record) form. I would want to query/select the details from the base table but when I update/delete I would want to update/delete the details to a view.
    Is this doable?
    Thanks
    KAvitha

    Hi Kavitha,
    Solution 1 :-
    Why cann't you trap the ON-TRIGGERS (like ON-INSERT /On-update/ON-DELETE) of that block and put your piece of code to update/delete the view.
    SOlution 2 (I didn't try this ,so please try)
    I am not sure whether it will help you but can try !!Sorry if not working and let me know if you have a solution
    Create a package with Insert /Update/Delete sub procedures which does DML on view (as per ur requirement).
    Call this Procedure on DML Target Name of Advanced Database .
    Regards

  • Is it possible to update attributes in all tables in a multi entity view

    Hi I have a view based on 4 entities, all of which are a 3 of which are 1 to many relationship with the 4th. The 3 additional entities have 2 or 3 attributes, Id, name, and one entity has a foreign key relating to a different table which I do not care about. The IDs are all updatable in the entity, and none of them are generated from a sequence but are inserted manually, except for the 4th (Master?) which is generated from a sequence.
    I create the view and all the entities are updatable, but in the view when I go to attributes from the other tables, it says updatable never and is grayed out so I cannot change it, even though in the entities tab, it is updatable always.
    So I was wondering if this was possible to do???

    I do not understand really, if it is 2 different tables, it is 2 different primary keys. Why would this even happen? What does it matter if EmployeeID and DepartmentID is both 1??? It just seems that there has to be a simpler way to do this but ok.
    So I go to the AppModule, Java tab and go generate Java class. The original code was
    public ViewObjectImpl getObjektiCRUDView1()
    return (ViewObjectImpl)findViewObject("ObjektiCRUDView1");
    I then copy your code to the best of my limited knowledge and get this
    public ViewObjectImpl getObjektiCRUDView1()
    this.getObjektiCRUDView1().executeEmptyRowSet();
    {Row yourRow = this.getObjektiCRUDView1().createRow();
    this.getObjektiCRUDView1().insertRow(yourRow );
            return (ViewObjectImpl)findViewObject("ObjektiCRUDView1");
    On the first row the getObjektiCRUDView1() is underlined and it says missing method body or declare as abstract.
    I know I did something wrong here but I have no idea what as I am not very good with Java
    Also it is not a jsf page, I create a single jspx page and divided it using the panel splitter so on one side we have an adf table for updating the Objekti database table, and on the other side I have an adf form for updating the Positions table (and later on other tables, I hope to have many forms there)
    Edited by: Dino2dy on Jun 10, 2010 12:02 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • View Table to update Physical Inventory Number Range.

    Hi,
    I am looking for the 'View Table' Name to update Physical Inventory Number Range in OMMB transaction.
    I will have to do it using SM30 as OMMB is display only.
    Thanks

    Hi,
    OMBT still cant help me because I dont have write access on this client.
    Are you aware on how to get the View Table to Maintain Number Ranges for Physical Inventory?
    Thanks,
    Rohit.

  • Can xsu not be used to update more than one table at a time.

    I would like to update two or more tables using the same XML package. However when I use XML that contains tags using column names from both tables I get an error that the second table's columns names can not be found in the first table even if I use setUpdateColumnList and build an array that contains only columns from the first table.
    Xsu does not do me a lot of good if only one table at a time can be updated.

    Assuming you are using Oracle 8i you may want to bone up on 'Object Views' and 'instead of' triggers. This is the functionality that is commonly used to perform multiple table updates from a single data source such as XML.
    An object view can be based on a query such as 'select a.col1, a.col2, b.col1, b.col2 from a, b where a.key1 = b.key1'.
    The object view is then used by the XSU to perform the XML query/update rather than using tables a and b.
    You would then write an 'instead of' trigger on the object view. The trigger would update the appropriate table (a or b) based on the columns provided in the update list.
    Steve's book 'Building Oracle XML Applications' in Chapter 12 explains how to do it and has sample code that demonstrates the process.
    The book is available everywhere and you can download the sample code from the book at o'reilly's web site.
    Good luck!

  • Loading xml into relational tables.

    I was wondering if anyone knows of a product/libraries which does the following:
    -Read data from a relational Database (multiple tables) and generate XML files based upon an XML Schema or DTD file?
    -Read XML files and load data into a relational Database.
    -Graphical Interface for performing the maps (perhaps based upon .xslt). ie.... Mapping of the XML Schema to Multiple Database Tables, Performing Joins etc...
    -Ability to connect to any type of Relational database (not just Oracle). Which rules out XML DB.

    This product does look to be ok, however it is missing a couple features that I would like the product to have.
    I would like this product to be able to insert/update data across multiple tables. Being able to do such things as generate foreign key relationships.
    It doesn't seem as though the XML being generated can be customized very easily. Some XML formats I deal with are very complex (such as X12/EDI).
    I would really like a graphical mapper.
    Here is a note from the doc:
    Storing XML Data Across Tables
    Currently the XML SQL Utility (XSU) can only store data in a single table. It maps a canonical representation of an XML document into any table or view. But there is a way to store XML with XSU across tables. You can do this using XSLT to transform any document into multiple documents and insert them separately. Another way is to define views over multiple tables (using object views if needed) and then do the insertions into the view. If the view is inherently non-updatable (because of complex joins), then you can use INSTEAD OF triggers over the views to do the inserts.
    This product looks really good, I was hoping that Oracle had something comparable:
    http://www.hitsw.com/products_services/xml_platform/allora.html

  • Update a maintenance view.

    Hi ,
    I want to update a maintenance view.
    Data is coming from a text file which i am uplaoding.
    Which function module should I use to update the maintenence view.
    Thanks,
    Ram.

    hi,
    use this FM VIEW_MAINTENANCE_CALL
    hope it will work.
    use this code .
    &----& Report  Z_TEST_PROGRAM&--*& Demo program for blog http://abap-explorer.blogspot.com/&--
    REPORT  z_test_program.DATA:i_sellist TYPE STANDARD TABLE OF vimsellist INITIAL SIZE 0,i_header  TYPE STANDARD TABLE OF vimdesc INITIAL SIZE 0,i_namtab  TYPE STANDARD TABLE OF vimnamtab INITIAL SIZE 0.PARAMETERS: p_view TYPE viewname MATCHCODE OBJECT viewmaint OBLIGATORY.AT SELECTION-SCREEN.CALL FUNCTION 'VIEW_GET_DDIC_INFO' EXPORTING   viewname                    = p_view     VARIANT_FOR_SELECTION       = ' ' TABLES   sellist                     = i_sellist   x_header                    = i_header   x_namtab                    = i_namtabEXCEPTIONS  no_tvdir_entry              = 1  table_not_found             = 2  OTHERS                      = 3         .IF sy-subrc <> 0. data: l_message type NATXT. CONCATENATE 'Table/View' p_view INTO l_message SEPARATED BY space. MESSAGE e001(00) WITH l_message ' not in the Dictonary'.ENDIF.START-OF-SELECTION.CALL FUNCTION 'VIEW_MAINTENANCE_CALL' EXPORTING action                               = 'S' view_name                            = p_viewEXCEPTIONS  client_reference                     = 1  foreign_lock                         = 2  invalid_action                       = 3  no_clientindependent_auth            = 4  no_database_function                 = 5  no_editor_function                   = 6  no_show_auth                         = 7  no_tvdir_entry                       = 8  no_upd_auth                          = 9  only_show_allowed                    = 10  system_failure                       = 11  unknown_field_in_dba_sellist         = 12  view_not_found                       = 13  maintenance_prohibited               = 14  OTHERS                               = 15         .IF sy-subrc <> 0. MESSAGE i001(00) WITH 'Error while calling the view'. LEAVE LIST-PROCESSING.ENDIF.
    Edited by: katigiri linganna on Apr 20, 2009 4:31 PM

  • How to update fields in multiple tables ?

    Dear all,
    What is the fastest way to update fields in multiple tables... from a single change table...as below is my code to update the fields but it is taking long time to update as i need to keep log file if any one update fails....
    CREATE OR REPLACE
    package body DO_DC_NAME_UPDATE_OTHER_TAB
    as
    type rowidArray is table of rowid index by binary_integer;
    type custRec is record
    n_cust_ref_no dbms_sql.number_table,
    v_name dbms_sql.varchar2_table,
    v_name_chg dbms_sql.varchar2_table,
    rowid rowidArray,
    changed dbms_sql.varchar2_table
    procedure VALIDATE_CUST_NAME( p_n_cust_ref_no in number,p_v_name_chg in out NOCOPY varchar2, p_changed in out NOCOPY varchar2 )
    is
    begin
    FOR cr_cust IN (SELECT --a.n_cust_ref_no,a.v_name,UPD_V_NAME, a.n_weight,a.V_LASTUPD_INFTIM
    from GNMT_CUSTOMER_MASTER_CHG where n_cust_ref_no=p_n_cust_ref_no)
         loop
    -- v_name
    if nvl(trim(cr_cust.v_name),0) != nvl(p_v_name_chg,0)
    then
              p_v_name_chg := p_v_name_chg;
              --p_v_name := p_v_name;
              p_changed := 'Y';
    end if;
         end loop;
    end;
    procedure DO_NAME_UPDATE_OTHER_TAB
    is
    l_record custRec;
    l_array_size number default 20000;
    l_done boolean;
    l_cnt number default 1;
    cursor c is select a.n_cust_ref_no, a.v_name,a.v_name_chg, a.rowid, 'N'
                        from GNMT_CUSTOMER_MASTER_CHG a--,GNMT_CUSTOMER_MASTER b
                        where a.v_name <> trim(a.v_name_chg); --and  a.n_cust_ref_no in (1434775,1561181,1601870);
    begin
    open c;
    loop
    dbms_application_info.set_client_info
    ( 'processing ' || l_cnt || ' thru ' || (l_cnt+l_array_size-1) );
    fetch c bulk collect into l_record.n_cust_ref_no, l_record.v_name,l_record.v_name_chg,l_record.rowid, l_record.changed
    LIMIT l_array_size;
    l_done := c%notfound;
    --dbms_output.put_line ('message10');
    for i in 1 .. l_record.n_cust_ref_no.count
    loop
    VALIDATE_CUST_NAME(l_record.n_cust_ref_no(i),l_record.v_name_chg(i),l_record.changed(i) );
    end loop;
    --dbms_output.put_line (l_record.n_cust_ref_no(i)||','||l_record.V_OCCUP_CODE(i)||','||l_record.CHANGED(i));
    /*forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_CUSTOMER_MASTER q
    set q.v_name = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y';*/
    -- update v_name in all the related tables
    forall i in 1 .. l_record.n_cust_ref_no.count
    update ADE_CUSTOMER_MASTER q
    set q.v_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_POLICY_DETAIL q
    set q.v_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_QUOTATION_DETAIL q
    set q.v_NAME =l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_name) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update NBDT_BENEFICIARY q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSDT_NOMINATION_TRANSACTION q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_POLICY_BENEFICIARY q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_POLICY_TRUSTEE q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_QUOTATION_BENEFICIARY q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PSMT_QUOTATION_TRUSTEE q
    set q.V_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNDT_BLACKLIST_DETAIL q
    set q.v_FNAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_FNAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_FNAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update INDT_LIAM_DETAIL q
    set q.v_FNAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.v_FNAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.v_FNAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_POLICY q
    set q.V_PAYER_NAME = l_record.v_name_chg(i)
    where q.N_PAYER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PAYER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PAYER_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_QUOTATION q
    set q.V_PAYER_NAME = l_record.v_name_chg(i)
    where q.N_PAYER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PAYER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PAYER_NAME is not null;
    commit;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_QUOTATION q
    set q.V_PROPOSER_NAME = l_record.v_name_chg(i)
    where q.N_PROPOSER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PROPOSER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PROPOSER_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update GNMT_POLICY q
    set q.V_PROPOSER_NAME = l_record.v_name_chg(i)
    where q.N_PROPOSER_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_PROPOSER_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PROPOSER_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update CLMT_CLAIM_MASTER q
    set q.V_CLIENT_NAME = l_record.v_name_chg(i)
    where q.N_CLIENT_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_CLIENT_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_CLIENT_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update CLMT_CLAIM_MASTER q
    set q.V_INTIMATOR_NAME = l_record.v_name_chg(i)
    where q.N_CLIENT_REF_NO = l_record.n_cust_ref_no(i)
    and trim(q.V_INTIMATOR_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_INTIMATOR_NAME is not null;
    forall i in 1 .. l_record.n_cust_ref_no.count
    update PYMT_VOU_MASTER q
    set q.V_PAYEE_NAME = l_record.v_name_chg(i)
    where q.n_cust_ref_no = l_record.n_cust_ref_no(i)
    and trim(q.V_PAYEE_NAME) = l_record.v_name(i)
    and l_record.changed(i) = 'Y'
    and q.V_PAYEE_NAME is not null;
    /*forall i in 1 .. l_record.n_cust_ref_no.count
         INSERT INTO GNMT_CUSTOMER_MASTER_LOG
              (N_CUST_REF_NO, V_TITLE_CODE, V_NAME, D_BIRTH_DATE, V_SEX, V_RELIGION_CODE, V_NATION_CODE, V_OCCUP_CODE, V_ALIVE, V_SMOKER,
              N_NO_STICKS, D_DEATH_DATE, V_BUMI_NON_BUMI, V_AGE_ADMITTED, V_SHORT_NAME, V_FIRST_NAME, V_LAST_NAME, V_EMAIL, V_DESIGNATION,
              N_HEIGHT,N_WEIGHT,V_TITLE_CODE_CHG, V_NAME_CHG, D_BIRTH_DATE_CHG, V_SEX_CHG,V_RELIGION_CODE_CHG,V_NATION_CODE_CHG, V_OCCUP_CODE_CHG, V_ALIVE_CHG,
              V_SMOKER_CHG, N_NO_STICKS_CHG, D_DEATH_DATE_CHG,V_BUMI_NON_BUMI_CHG, V_AGE_ADMITTED_CHG, V_SHORT_NAME_Chg, V_FIRST_NAME_Chg,
              V_LAST_NAME_Chg, V_EMAIL_Chg, V_DESIGNATION_Chg,N_HEIGHT_Chg,N_WEIGHT_Chg, V_UPD_STATUS_DC,-- V_LASTUPD_PROG, V_LASTUPD_INFTIM,
              V_LASTUPD_USER_DC, V_LASTUPD_PROG_DC,V_LASTUPD_INFTIM_DC
              SELECT N_CUST_REF_NO, V_TITLE_CODE, V_NAME, D_BIRTH_DATE, V_SEX, V_RELIGION_CODE, V_NATION_CODE, V_OCCUP_CODE, V_ALIVE, V_SMOKER,
              N_NO_STICKS, D_DEATH_DATE, V_BUMI_NON_BUMI, V_AGE_ADMITTED, V_SHORT_NAME, V_FIRST_NAME, V_LAST_NAME, V_EMAIL, V_DESIGNATION,
              N_HEIGHT,N_WEIGHT,V_TITLE_CODE_CHG, V_NAME_CHG, d_birth_date_chg, V_SEX_CHG, V_RELIGION_CODE_CHG,V_NATION_CODE_CHG, V_OCCUP_CODE_CHG, V_ALIVE_CHG,
              V_SMOKER_CHG, N_NO_STICKS_CHG, D_DEATH_DATE_CHG, V_BUMI_NON_BUMI_CHG, V_AGE_ADMITTED_CHG, V_SHORT_NAME_Chg, V_FIRST_NAME_Chg,
              V_LAST_NAME_Chg, V_EMAIL_Chg, V_DESIGNATION_Chg,N_HEIGHT_Chg,N_WEIGHT_Chg--, V_LASTUPD_USER, V_LASTUPD_PROG, V_LASTUPD_INFTIM
              ,'PROCESSED'
              ,user,--P_USER,
              'DC_PAKAGE',
              sysdate--P_DATE
              FROM GNMT_CUSTOMER_MASTER_CHG where n_cust_ref_no =l_record.n_cust_ref_no(i)
              --and n_cust_ref_no not in (select n_cust_ref_no from GNMT_CUSTOMER_MASTER_LOG);*/
    exit when (l_done);
    l_cnt := l_cnt + l_array_size;
    end loop;
    commit;
    end;
    end;
    thank You

    Dear SeánMacGC thanks for reply,
    But "a.changed" is not a field in GNMT_CUSTOMER_MASTER_CHG. what i am doing in this procedure is i am collecting bulck data and validating field by field from GNMT_CUSTOMER_MASTER_CHG with GNMT_CUSTOMER_MASTER table as their structure is same.. if v_name is not same as v_name_chg then i am setting changed flag to "Y" changed is "changed dbms_sql.varchar2_table" and updating GNMT_CUSTOMER_MASTER in bluck where changed flag ='Y'...
    type custRec is record
    n_cust_ref_no dbms_sql.number_table,
    v_name dbms_sql.varchar2_table,
    v_name_chg dbms_sql.varchar2_table,
    rowid rowidArray,
    *changed dbms_sql.varchar2_table*
    i cannot use simple SQL as i need to validate field for each records with GNMT_CUSTOMER_MASTER_CHG and insert into log file as well.....
    to run this procedure:
    execute DO_DC_NAME_UPDATE_OTHER_TAB.DO_NAME_UPDATE_OTHER_TAB;
    Thanks...

  • I have iTunes open in Windows XP and get an error 45048 message when I try to update apps thru the store. How can I fix this? I have reinstalled iTunes twice.

    I have iTunes, latest version, open in Windows XP and get an error 45048 message when I try to update apps thru the store. How can I fix this? I have reinstalled iTunes twice but problem continues.

    Try contacting iTunes via email to check if there is an issue with the account. go to apple.com/support/itunes
    Click on iTunes Store account and billing and select inquiries. On the right side click on "email us".
    Before doing that trying viewing your account information first. Open the iTunes on you mac, look at the menu and select store and select view my account. Try removing the card (this is only applicable if you don't have a pending charges with iTunes) and hit done. Sign out, quit iTunes and sign back in and try updating the apps again.

  • True about updates through a view

    hi frds
    i just need the right answer for the choices mentioned below with explanation
    plz help me
    What is true about updates through a view?
    A. You cannot update a view with group functions.
    B. When you update a view group functions are automatically computed.
    C. When you update a view only the constraints on the underlying table will be in effect.
    D. When you update a view the constraints on the views always override the constraints on the underlying tables.

    And a very tricky only it is.
    Peter, you are correct that view constraints are not enforced in the sense of PKs and FKS, but there are two other view constraints that are enforced.
    SQL> CREATE TABLE t AS
      2  SELECT rownum id, object_name
      3  FROM all_objects
      4  WHERE rownum < 11;
    Table created.
    SQL> CREATE VIEW t_read AS
      2  SELECT * FROM t
      3  WITH READ ONLY;
    View created.
    SQL> CREATE VIEW t_check AS
      2  SELECT * FROM t
      3  WHERE mod(id,2) = 0
      4  WITH CHECK OPTION;
    View created.
    SQL> CREATE VIEW t_nocheck AS
      2  SELECT * FROM t
      3  WHERE MOD(id, 2) = 0;
    View created.
    SQL> INSERT INTO t_read VALUES (100, 'READ ONLY');
    INSERT INTO t_read VALUES (100, 'READ ONLY')
    ERROR at line 1:
    ORA-01733: virtual column not allowed here
    SQL> INSERT INTO t_check VALUES (100, 'EVEN ID');
    1 row created.
    SQL> INSERT INTO t_check VALUES (101, 'ODD ID');
    INSERT INTO t_check VALUES (101, 'ODD ID')
    ERROR at line 1:
    ORA-01402: view WITH CHECK OPTION where-clause violation
    SQL> INSERT INTO t_nocheck VALUES(100, 'EVEN ID');
    1 row created.
    SQL> INSERT INTO t_nocheck VALUES(101, 'ODD ID');
    1 row created.
    SQL> UPDATE t_check SET id = 201
      2  WHERE id = 2;
    UPDATE t_check SET id = 201
    ERROR at line 1:
    ORA-01402: view WITH CHECK OPTION where-clause violation
    SQL> UPDATE t_nocheck SET id = 201
      2  WHERE id = 2;
    1 row updated.The WITH READ ONLY constraint bars all changes to the view. The WITH CHECK OPTION stops any changes that would make the record invisible to the view. It is essentially a CHECK constraint on the view.
    John

  • How to edit data from a "View Table"?

    I am importing data from a "table view" where in sql it joins several tables into one view. When I passed it in using the template it doesnt have the "Edit command column" like other direct link tables. Is there anyway I could make a view table editable? Can I manually try to do it or I have to edit the individual ables? thanks

    oh sorry about that.The "template" I mean in HTMLDB when I start building a new application I used "Based on existing tables" method and with single tables it generates everything fine with search fields and edit column to the left. I have a table view that combines about 4 tables together and I used the same template (Based on existing tables) and it has the search and create but it doesnt have the "edit" column on the left. Is there a way I can edit the view table's information so that the other tables that the view combines will be updated/edited?
    The reason is that lets say I dont know this person's ID number but I know his name. I search for his name on table A and it returns some general data including his ID number. Instead of going to another Table B with the person's ID number and edit that table I really want to see the information just from one search (Table A)- if a global search can be implemented that would be great too. Thanks Sergio.

  • How to insert the data from XML to a table

    Hi,
    I'm using Oracle 10g Express Edition
    I need help in How to insert the data from XML file into the table.
    Below is the example i'm working on..
    I have create ridb user with below mentioned privileges:
    Account Status Locked Unlocked
    Default Tablespace: USERS
    Temporary Tablespace: TEMP
    User Privileges :
    Roles:
    CONNECT
    RESOURCE
    Direct Grant System Privileges:
    CREATE DATABASE LINK
    CREATE MATERIALIZED VIEW
    CREATE PROCEDURE
    CREATE PUBLIC SYNONYM
    CREATE ROLE
    CREATE SEQUENCE
    CREATE SYNONYM
    CREATE TABLE
    CREATE TRIGGER
    CREATE TYPE
    CREATE VIEW
    & table is created TRIALZIPCODES below mentioned is the DDL:
    CREATE TABLE TRIALZIPCODES
    STATE_ABBR VARCHAR2(20) NOT NULL
    , ZIP_CODE NUMBER(10, 0) NOT NULL
    , ZIP_CODE_EXT VARCHAR2(20)
    Below is the XML FILE: which is stored in C:\OracleProject Folder
    File name: trial.xml
    <?xml version="1.0" ?>
    <metadata>
    - <Zipcodes>
    - <mappings Record="4">
    <STATE_ABBREVIATION>CA</STATE_ABBREVIATION>
    <ZIPCODE>94301</ZIPCODE>
    </mappings>
    - <mappings Record="5">
    <STATE_ABBREVIATION>CO</STATE_ABBREVIATION>
    <ZIPCODE>80323</ZIPCODE>
    <ZIP_CODE_EXTN>9277</ZIP_CODE_EXTN>
    </mappings>
    </Zipcodes>
    </metadata>
    PL/SQL Procedure:which i'm trying to execute from SQLDeveloper
    create or replace
    PROCEDURE TRIAL AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    begin
    -- DBMS_XMLGEN.setRowTag ( ctx IN ctxHandle, rowTag IN VARCHAR2);
    -- DBMS_XMLGEN.setRowSetTag ( ctx IN ctxHandle, rowSetTag IN VARCHAR2);
    -- the name of the table as specified in our DTD
    DBMS_XMLGEN.SETROWSETTAG(l_context_handle,'zipcodes');
    -- the name of the data set as specified in our DTD
    DBMS_xmlgen.setRowTag(l_context_handle,'mappings');
    -- for getting the output on the screen
    dbms_output.enable(1000000);
    -- open the XML document in read only mode
    v_FileHandle := utl_file.fopen('c:/OracleProject','trial.xml', 'r');
    loop
    BEGIN
    utl_file.get_line(v_FileHandle, charString);
    exception
    when no_data_found then
    utl_file.fclose(v_FileHandle);
    exit;
    END;
    dbms_output.put_line(charString);
    if finalStr is not null then
    finalStr := finalStr || charString;
    else
    finalStr := charString;
    end if;
    end loop;
    -- for inserting the XML data into the table
    insCtx := DBMS_XMLSTORE.NEWCONTEXT('RIDB.TRIALZIPCODES');
    insCtx := DBMS_XMLSTORE.INSERTXML(insCtx, finalStr);
    dbms_output.put_line('INSERT DONE '||TO_CHAR(rowsp));
    DBMS_XMLStore.closeContext(insCtx);
    END;
    END TRIAL;
    For the first time when i complied i got the errors as :
    Procedure RIDB.PROCEDURE1@RIDB
    Error(16,14): PLS-00201: identifier 'UTL_FILE' must be declared
    Error(16,14): PL/SQL: Item ignored
    Error(29,1): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    Error(29,1): PL/SQL: Statement ignored
    Error(33,1): PL/SQL: Statement ignored
    Error(33,19): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    Error(36,1): PL/SQL: Statement ignored
    Error(36,17): PLS-00320: the declaration of the type of this expression is incomplete or malformed
    So i logged in as sys & grant the permission to execute on UTL_FILE to ridb (user):
    SQL Statement:
    grant execute on utl_file to ridb
    So, it got compiled successfully but when i execute it gives me error as:
    Source does not have a runnable target.
    What does this mean?
    So I browse through forum & i got to know that i need to initial the UTL_FILE_DIR ="C:/OracleProject" in init.ora
    So can i edit the init.ora with notepad.When i tried to do that it says permission denied
    In my system it shows the init.ora file in path C:\oraclexe\app\oracle\product\10.2.0\server\config\scripts
    but there is also other file initXETemp in the same path do i need to do the changes in it.
    I have tried even editing the SPFILE as mentioned below:
    C:\oraclexe\app\oracle\product\10.2.0\server\dbs\SPFILEEXE - I had edit this file using notepad & set the value of UTL_FILE_DIR ="C:/OracleProject". So next time when i restarted i'm unable to log on to the database.
    So i had reinstall the software again.
    Could you please let me know how to proceed..

    hi,
    I have created the directory from sys database
    CREATE or replace DIRECTORY XML_DIR2 AS 'C:\OracleProject';
    & grant read,write access to the user
    grant read,write on directory XML_DIR2 to RIDB;
    & i had change the tag name in the xml file as shown below:
    <?xml version = '1.0'?>
    <metadata>
    <Zipcodes>
    <mappings Record="4">
    <STABBRE>CA</STABBRE>
    <ZIPCODE>94301</ZIPCODE>
    </mappings>
    <mappings Record="5">
    <STABBRE>CO</STABBRE>
    <ZIPCODE>80323</ZIPCODE>
    <ZIPCODEEXT>9277</ZIPCODEEXT>
    </mappings>
    </Zipcodes>
    </metadata>
    TRIALZIPCODE table as shown below:
    CREATE TABLE "RIDB"."TRIALZIPCODE"
    (     "STABBRE" VARCHAR2(20 BYTE),
         "ZIPCODE" NUMBER(*,6) NOT NULL ENABLE,
         "ZIPCODEEXT" NUMBER
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    I have tried two methods as shown below:
    Procedure 1:
    create or replace
    PROCEDURE TRIAL_V2 AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    cnt NUMBER;
    xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
    --XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
    BEGIN
    insCtx := DBMS_XMLStore.newContext('DEV.TRIALZIPCODES');
    DBMS_XMLStore.setUpdateColumn(insCtx, 'STABBRE');
    DBMS_XMLStore.setUpdateColumn(insCtx, 'ZIPCODE');
    DBMS_XMLStore.setUpdatecolumn(insCtx, 'ZIPCODEEXT');
    DBMS_XMLStore.setRowTag(insCtx, 'mappings');
    cnt := DBMS_XMLStore.insertXML(insCtx, xmldoc);
    DBMS_XMLStore.closeContext(insCtx);
    END;
    Procedure 1 was compiled with out errors but when i execute i got the error as :
    Source does not have a runnable target.
    Procedure 2_
    CREATE OR REPLACE PROCEDURE TRIAL_V3 AS
    BEGIN
    DECLARE
    -- declare attributes
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    v_FileHandle UTL_FILE.FILE_TYPE;
    l_context_handle dbms_xmlgen.ctxHandle;
    insCtx DBMS_XMLStore.ctxType;
    cnt NUMBER;
    xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
    --XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
    BEGIN
    INSERT INTO trialzipcode (STABBRE, ZIPCODE, ZIPCODEEXT)
    SELECT extractvalue(x.column_value, 'mappings/STABBRE'),
    extractvalue(x.column_value, 'mappings/ZIPCODE'),
    extractvalue(x.column_value, 'mappings/ZIPCODEEXT')
    FROM TABLE(
    XMLSequence(
    EXTRACT(
    xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') ),
    'metadata/Zipcodes/mappings'
    ) x
    END;
    END TRIAL_V3;
    Procedure 2 was complied without errors but when i execute i got the error as:
    Connecting to the database RIDB.
    ORA-22288: file or LOB operation FILEOPEN failed
    The system cannot find the file specified.
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    ORA-06512: at "RIDB.TRIAL_V3", line 12
    ORA-06512: at line 2
    Process exited.
    Disconnecting from the database RIDB.
    Could you please let me know how to proceed...

  • Update XML data stored in CLOB Column

    Hi All,
    i am new to Oracle and new to SQL
    i am trying to update XML data stored in CLOB cloumn,data is stored with the follwoing format
    <attrs><attr name="name"><string>Schade</string></attr></attrs>
    i am using the following query for updating the value
    UPDATE PRODUCT p SET ATTRIBUTES_nl_nl=UPDATEXML(XMLTYPE.createXML(ATTRIBUTES_nl_nl),'/attrs/attr[@name="name"]/string/text()','Schade').getClobVal() WHERE p.sku='000000000000040576_200911-5010057'
    this query is working fine but it changing the data to the following format
    <attrs><attr name="name">Schade</attr></attrs>
    some how it is ommiting the <string> tag from it, i am unable to figure it out whats the reason.
    any help in this regard will b e much appriciated
    Thanks in Advance
    -Umesh

    Hi,
    You should have created your own thread for this, and included database version.
    This works for me on 11.2.0.2 and 10.2.0.5 :
    SQL> create table t_org ( xml_clob clob );
    Table created
    SQL>
    SQL> insert into t_org
      2  values(
      3  '<Message>
      4  <Entity>
      5  <ASSIGNMENT>
      6  <OAVendorLocation> </OAVendorLocation>
      7  <Vendorid>1</Vendorid>
      8  </ASSIGNMENT>
      9  </Entity>
    10  </Message>'
    11  );
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> select '*' ||
      2         extractvalue(xmltype(xml_clob),'/Message/Entity/ASSIGNMENT/OAVendorLocation')
      3         || '*' as result
      4  from t_org;
    RESULT
    SQL> update t_org set xml_clob =
      2  updatexml(xmltype(xml_clob),
      3  '/Message/Entity/ASSIGNMENT/OAVendorLocation/text()','LONDON').getClobVal()
      4  ;
    1 row updated
    SQL> select '*' ||
      2         extractvalue(xmltype(xml_clob),'/Message/Entity/ASSIGNMENT/OAVendorLocation')
      3         || '*' as result
      4  from t_org;
    RESULT
    *LONDON*
    Does the OAVendorLocation really have a whitespace value?
    If not then it's expected behaviour, you're trying to update a text() node that doesn't exist. In this case, the solution is to use appendChildXML to create the text() node, or update the whole element.
    Is it your real document? Do you actually have some namespaces?

Maybe you are looking for

  • Audio to hdmi after W 8.1 update

    After fixing audio in windows on my laptop with your solution (thanks so much!)....I still had no audio to hdmi cable and tv display.  Playback devices showed only Speakers/HP in listing.  I tried adding a second display device to no avail.  At one p

  • HT204053 Multiple accounts are a headache!!

    I have two issues, 1. I have two accounts or apple IDs if you will. One was set up by me and the other was a mobileme account which became an apple ID when mobileme converted into iCloud. I want to deactivate one account, the one that was previously

  • Playing aps on TV.

    I bought instructional videos which were installed as APS.  They play ok on the ipod but when I use an AV cable to play them on TV there is sound but no picture.  Other videos and photos look fine on TV using the same cable.

  • Syncing Ring Tones to iPhone

    I have synced my iPhone with iTunes; the tones show up both in my "Tone" section of iTunes, as well as the "Tones" section of my iPhone....but are not on my actual phone when I look at it.  I've tried unchecking the Sync Tones box, then syncing, then

  • System Preferences can't set date and time and other odd behaviour

    I have a 2008 Macbook Air, which is beginning to show signs of age, but now appears to have taken on a terminal problem.  I can't set the date and time in the system preferences, even when connected to the internet - the pane just comes up as faded o