Updated hierarchical attribute table

I have a hierarchical table called menus. As you can see he ara two branches (63 and 64) that depend on branch 7:

SELECT id, pid, access by order of menus in 2.1;
PID ID access
1-0-3
2 0 3
7-2-1
1-7-63
1 7 64

I want to update access for 63 and 64 branches, if I change the access of their parent branch. Lets say I change plug Access 7-0, then branches 63 and 64 should update its access level 0.

I tried this in a trigger to update after:
create or replace
TRIGGER "SISTEMAS". "" MENU_BU ".
after update to access on "MENUS".
for each line
Start
If: new. "" ACCESS "! =: old. "' ACCESS ' then
update of the set MENUS ACCESO =: new. ACCESO
where id in (select id from (select id, the nest of the menus
connect by prior id = pid
Start with pid =:old.id));
end if;
end;

If I get an Ora-04088. What I am doing wrong? And what would be the best way to do this?

What I am doing wrong

With the help of a trigger and in addition using UPDATE to update at the same table in a trigger

And what would be the best way to do this?

Use a stored procedure that performs all the updates you need. Call this stored procedure instead of issuing a direct update against the table.

Tags: Database

Similar Questions

  • Update an attribute XML in a CLOB to a table column

    Hello world

    I have a CLOB column in my table that carries a date XML. In which I need to update the attributes of the child when they repeat with the same parents several times in the data.

    For example:

    Say my XML data as follows.

    <? XML version = "1.0"? >

    " < sample xmlns =" https://www.ABC.com "> "

    < a > < b > detail first line < /b >

    second line of detail/< c >/< c >

    < /a >

    < d > < c > Paris/< c > < / d >

    < d > < c > France/< c > < / d >

    Japan < d > < c >/< c > < / d >

    < /sample >


    I want to update as

    <? XML version = "1.0"? >

    < sample xmlns = " https://www.ABC.com "> "

    < a > < b > detail first line < /b >

    second line of detail/< c >/< c >

    < /a >

    < d > < c1 > Paris < / c1 > < / d >

    < d > < c2 > France < / c2 > < / d >

    Japan < d > < c3 > < / c3 > < / d >

    < /sample >


    I have tried to identify the repetition of my parent attribute using the sub query and I tried updating their attribute by extracting the XML data for each attribute parent in a loop. But it does not work


    Select xml_load where xml_name = "sample1"; regexp_count (xml_val,' <d> ') -Giving more than 10K as County


    Identified the attributes of the parent for help,

    Select

    Count (1)

    of xml_load x

    where existsNode (extract (xmltype (xml_val),'/ * [local - name () = "sample"]'),)

    (' / d ') = 1 - he never returned me 1. I couldn't understand why as there is an attribute called < d >.

    Please provide your help in achieving my requirement. Any help would be greatly appreciated.

    I guess you want to insert an attribute in the existing xml document. So my suggestion is, instead of UPDATEXML you can just use INSERTCHILDXML. The following code works correctly. Hope this will be the final XML format

    -Code

    DECLARE

    l_col1 XMLTYPE.

    Nt_xml TYPE TABLE IS NUMBER;

    l_ntxml nt_xml: = nt_xml();

    BEGIN

    XMLTYPE (xt.xml_val) SELECT col1 INTO l_col1

    OF xml_test xt

    WHERE xt.xml_name = 'file sample.xml ";

    SOME pos

    LOOSE COLLECTION l_ntxml

    OF xml_test xt.

    XMLTABLE (xmlnamespaces (DEFAULT "http://www.abc.com'),

    "/ Report/identifier/area/CodeCategory.

    PASSAGE xmltype (xt.xml_val)

    COLUMNS pos for ORDINALITE

    )

    WHERE xt.xml_name = 'file sample.xml ";

    BECAUSE me IN 1.l_ntxml. COUNTY

    LOOP

    SELECT INSERTCHILDXML (l_col1,'/ report/identifier/area/CodeCategory ['| l_ntxml (i) |'] /Code','@id',l_ntxml (i) ','xmlns = "http://www.abc.com" ' ")

    IN l_col1

    DOUBLE;

    END LOOP;

    -DBMS_OUTPUT. Put_line (l_col1. GetClobVal());

    UPDATE xml_test SET xml_val is l_col1. GetClobVal() WHERE xml_name = "sample.xml";

    COMMIT;

    END;

    -After insertion

    http://www.ABC.com">

    CC5

    I48c2

    5

    65445

    5

    2c653

    5

    4c28

    5A

    55635

    5

    I5cc

    5

    65645

    5

    4555

    2

    I483

    5

    e558

    5

    I482

    5

    5563c

    5

    76526

    5

    64885

    2

    76524

    5

    e55c

    5

    e556c

    5

    C5cc52

    5

    45c7c

    2

    45c75

    2

    2c64c

    2

    77585

    5

    65455

    5

    e5565

    5

    2c644

    2

    667c2

    5

    2c643

    5

    7655c

    5

    O8c

    5

    V3cc5

    2

    V3ccc

    3

    73c27

    5

    3c4cc

    5

    24c7c

    5

    V275

    5

    V27c

    5

    e25

    5

    e5cc

    5

    76556

    5

    64825

    2

    2c57c

    5

    252c5

    5

    75cc

    5

    V5867

    2

    4c32c

    5

    25c8c

    5

    C5c555

    5

    V245

    5

    V242

    3

    2c75

    5

    65665

    5

    J452c

    5

    765c3

    5

    252cc

    5

    34545

    5

    555

    5

    4c4c

    5

    64855

    5

    I27c

    5

    F84c

    5

    27735

    5

    25cc3

    2

    27cc

    2

    556c

    5

    I5c32

    5

    3c4c5

    5

    25ccc

    54

    585

    5

    25cc2

    5

    25cc5

    5

    648c5

    2

    64425

    5

    3c4cc

    5

    O42c2

    5

    65c65

    5

    77c3

    5

    77c7

    5

    Pc735

    5

    27c4

    5

    c38c

    5

    J45cc8

    5

    2c68c

    5

    cc5c5

    5

    343c

    5

    2c68c

    2

    4c3c5

    5

    57c3

    5

    4c3c2

    2

    e37c

    5

    Mc57c

    5

    4c3cc

    8

    57cc

    5

    42735

    4

    42732

    2

    345c5

    5

    O6c85Xc

    5

    4283c

    5

    2c8c

    5

    25c6c

    3

    ec42

    5

    25c62

    5

    25c63

    5

    4568

    5

    345cc

    5

    2c632

    4

    65425

    3

    2c63c

    2

    5745

    5

    2c635

    5

    F3553

    5

    754c

    4

    45c85

    5

    78c3c

    3

    5748

    5

    73cc7

    5

    76c

    5

    66455

    5

    657c5

    5

    66cc5

    5

    V42c

    2

    V425

    5

    7767

    5

    66624

    5

    42822

    5

    57c8

    5

    Mc54c

    5

    2c634

    5

    e7c4

    5

    J845c

    5

    2c62c

    5

    45cc5

    2

    2c622

    5

    64765

    5

    e554c

    5

    3572

    3

    e3c2

    5

    5c6c

    5

    73c5c

    5

    7467

    5

    V426

    5

    65c

    3

    7463

    5

    F35c

    5

    64664

    5

    7464

    5

    73c57

    5

    c383

    5

    4c5c

    5

    66652

    5

    F5525

    5

    F552c

    5

    25c4c

    5

    2c626

    5

    428c

    2

    65225

    5

  • EO can update the attributes

    Hello

    I am facing a strange problem in a production environment. One of my OS is updated to an incorrect value and it affecting the value null. The business logic must update the field 'A' and it does, but it updates the field 'B' on a null value too. I have already increased the newspaper on the weblogic (- Djbo.debugoutput = console - Djbo.logging.show.function = true - Djbo.logging.show.timing = true) to check the SQL command and the command just SQL update the field to the right ('A').

    Other information:

    • The B field is 'required', so null is not activated and no Houston exception was thrown before the doDML method.
    • This only in production. Acceptance or development this situation is not arrive with the same data and database (dump).
    • My first suspicion was that certain triggers (before the update) was running on Oracle and update this field to null, but there is no trigger in doing so.
    • If I try to run the SQL directly on Oracle, it works very well.
    • The B field is of type char (1 byte) to the database and in the SQL command on the console the UPDATE is B's RETURN in a variable. I did not understand why this has happened but an other EO which has the same attribute (char (1 byte)) did the same thing when it has been updated.

    I'm under options, any help would be appreciated.

    WebLogic journal:

    [210511] (0) OracleSQLBuilderImpl.bindWhereAttrValue (2218) where binding param 1:130593

    [210512] (4) OracleSQLBuilderImpl.doEntityDML (322) OracleSQLBuilder execution, lock DML 2 on: TABLE (driver)

    [210513] (0) OracleSQLBuilderImpl.buildUpdateStatement (1786) UPDATE buf Reporteoperadora > #u SQLStmtBufLen: 255, real = 125

    [210514] (1) table OracleSQLBuilderImpl.doEntityDML (408) START UPDATE TABLE SET A =: 1 WHERE PK =: 2 INTO VOTING B: 3; END;

    [210515] (0) OracleSQLBuilderImpl.bindUpdateStatement (2106) update binding param 1:5109570

    [210516] (1) OracleSQLBuilderImpl.bindWhereAttrValue (2218) where link param 2:130593

    [210517] (18) OracleSQLBuilderImpl.doEntityDML (540) OracleSQLBuilderImpl.doEntityDML failed...

    [210518] (1) OracleSQLBuilderImpl.doEntityDML (541) X / Open SQL State is: 72000

    [210519] (1) Diagnostic.printStackTrace (410) java.sql.SQLException: ORA-01407: cannot update ('USER'. "TABLE '." ("' B ') with the NULL value

    Thanks in advance,

    Alexandre Rocco

    I discovered what the problem was... The version of the Oracle production database has been changed and that causes a problem with the command "BACK IN" in the update.

    All fields with char (1 byte) has been installed with "Refresh after" update and insert in the OT, create this command in update. Remove this option fixes the problem. By default, this field is created with this configuration on Jdeveloper.

  • dimension of the hierarchical attribute with Essbase Studio

    Hello world

    I need to load the product dimension that is organized in a parent-child relational table like this:
    (parent_code, member_code, member_alias, mark, consolidation, formula)

    Each product has a mark and I need to load brand as a dimension of the attribute. The thing is the brand isn't flat, but it has its own hierarchy. For the brand, I have another relational table, where the data are organized parent-child like this:
    (brand_parent, brand_child, brand_alias).

    I do this load with Essbase Studio but I know is not how to create the Product hierarchy in the cube schema in order to load the parent-child hierarchical attributes. Documentation and tutorials only show examples of dishes attributes. I thought of these two ways, but do not know if will work:

    hierarchy of case 1) product like this:

    Parent_code
    Member_code
    Brand_parent
    Brand_child
    Member_code

    hierarchy of case 2) product like this:

    Parent_code
    Member_code
    Brand_parent
    Brand
    Member_code

    Someone had to do this? How did you do?
    Any help will be much appreciated.

    Thank you
    Daniela

    Hello Daniela,
    Please see the following post. One of my colleagues ran into the same issue, and his post was answered in the post below.
    ESBase Studio question - how to set up the dim attribute?

    Thank you
    Daniel
    http://dvepm.com

  • Update an attribute VO

    For jdev pro 11g

    Can some tell me what wrong with this code. I'm trying to update an attribute VO using the RowClass Impl of the VO.

    {} public void modifyRefDesSpaces (view ViewObject)
    {while (View.hasNext ())}
    Table_ViewObjRowImpl line = view.getCurrentRow ((Table_ViewObjRowImpl));
    String refDes = row.getRefdeshj ();
    String newRefDes = refDes.replaceAll ("", "& nbsp");

    row.setRefdeshj (newRefDes); <-this line cause the next line to fail
    View.Next (); <-error on this line

    }

    }


    This is the error message...

    Root cause]] of ServletException.
    javax.el.ELException: oracle.jbo.PersistenceException: Houston-26035: secondary use entity PtdDetailView missing parts of the description of the association.
    at javax.el.BeanELResolver.getValue(BeanELResolver.java:266)
    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
    at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:73)
    at com.sun.el.parser.AstValue.getValue(AstValue.java:118)
    at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
    Truncated. check the log file full stacktrace


    That's how the view object is defined before calling the method above.


    See ViewObject = service.findViewObject("Table_ViewObj1");
    view.setWhereClause ("PtdDetailView.EIACODXA =: AND PtdDetailView.PCCNUMXC of the project: NCFA");
    view.defineNamedWhereClauseParam ('project', null, null);
    view.defineNamedWhereClauseParam ("NCFA", null, null);

    view.setNamedWhereClauseParam ('project', enterProj);
    view.setNamedWhereClauseParam ("pccn", enterPccn);

    view.executeQuery ();
    modifyRefDesSpaces (view); <-calls above the method

    I think you are using the wrong approach to the problem.

    I guess there is a follow-up to your previous question (several spaces are compressed to one in the user interface).

    You want to change the attributes permanently in the table (assuming that the VO is based EO)?

    I would only change the appearance of the data for the user interface. It is best done using a transient attribute in the VO. The Get accessor of this transient attribute method gets the value of the DB and returns the content changed to the user interface.

    Doing it this way, that you don't need to iterate over the result set, you can simply use the transitional attribute in the user interface (i.e. in the form of a column in the table) and only the visible rows in the user interface are changed when the transient attributes Get accessor method is called. It also gives a much better memory usage if your result contains several lines.
    Your implementation (if make you it work) load all lines in memory, even if they are never presented to the user.

    To add a transition attribute to your VO go to the secxtion of the attribute of the VO and click Add. The appropriate attribute name (i.e. NameDisplay). Go to line of customer interfaces, if they are not already created their creation. mix all the methods getter/setter available for selection.
    In the file VORowImpl.java find the accessor method Get is getNameDisply(), and change the implementation of

    public String getNameDisplay()
    {
        String refDes = row.getName();
        String newRefDes = refDes.replaceAll(" ","&_nbsp;"); // remove the _ before nbsp
        return newRefDes;
    }
    

    Now, if you drag-and - drop the VO on a page, you get another attribute NameDisply, which should appear correctly in the user interface.

    Furthermore, if you need to iterate over a set of results the code looks like this:

    view.executeQuery();
    while (view.hasNext())
    {
        // get a row and move the pointer to the next one to fetch
        Row row = view.next();
        // do something with the row
    }
    

    Timo

  • is it possible to transfer a record to update another database table?

    Hi all.

    Is it possible to transfer the registration updated in a database table to another table in the database in MS access?

    For example. An updated record of Table "Student", transfer this record to the Table of "Present" and delete the record at the Table "student".

    Which means the file is moved to 'Student' Table to Table "Presence".

    Yes.

    You must INSERT in the other table and REMOVE them from the original table. Two of these capitalized words are T - SQL commands.

    There is no command of 'transfer '.

  • UPDATE to update trigger another table

    I am trying to write a trigger to the table (AFTER UPDATE) in which I want to update the same table in a different pattern. Notice that both tables has no unique or primary key constraint, so I am forced to compare the values in the column all the to the place where the condition.

    Update OTHERSCHEMA. T1

    the value =:NEW.c1 c1, c2 is:NEW.c2...

    where c1 =:OLD.c1

    AND c2 =:OLD.c2

    Problem is when a column is null, it would seem that it is not comparable. I even tried

    Update OTHERSCHEMA. T1

    the value =:NEW.c1 c1, c2 is:NEW.c2...

    where NVL (c1, NULL) = NVL (:OLD.c1, NULL)

    AND NVL (c2, NULL = NVL (:OLD.c2, NULL)

    Nothing helps. Can someone help me to write the correct statement?

    Hello

    eyap wrote:

    I am trying to write a trigger to the table (AFTER UPDATE) in which I want to update the same table in a different pattern. Notice that both tables has no unique or primary key constraint, so I am forced to compare the values in the column all the to the place where the condition.

    Update OTHERSCHEMA. T1

    the value =:NEW.c1 c1, c2 is:NEW.c2...

    where c1 =:OLD.c1

    AND c2 =:OLD.c2

    Problem is when a column is null, it would seem that it is not comparable. I even tried

    Update OTHERSCHEMA. T1

    the value =:NEW.c1 c1, c2 is:NEW.c2...

    where NVL (c1, NULL) = NVL (:OLD.c1, NULL)

    AND NVL (c2, NULL = NVL (:OLD.c2, NULL)

    Nothing helps.

    Naturally.  NVL (x, NULL) is always x, no matter what x is.

    Can someone help me to write the correct statement?

    x = is returns TRUE if (and only if) x and have the same value, and it returns FALSE if (and only if) x and have 2 different values.

    NULL is not a value; in fact, it's quite the opposite.  NULL means that there is no value.  If x or is NULL, then x = y returns UNKNOWN.

    DECODE allows to compare values or NULL values, so you can do something like

    Update OTHERSCHEMA. T1

    the value of c1 =: NEW.c1

    , c2 =: NEW.c2

    ,       ...

    where LESS (DECODE (c1,:OLD.c1, 1, 0)

    , DECODE (c2,:OLD.c2, 1, 0)

    )

    ;

    If you would care to a full test script so that I can reproduce the problem, then I could test this.

    Triggers often indicate a bad table design.  Why do you need to replicate the data in another table?

    As you do, why not add a primary key?

  • update a linked table

    Hello

    I have two drawings, one design, get a table, the second design with a copy of the table as a related table. The two designs are unther SVN version control.

    I update the original table, and magically copy it the table shows the changed data. Everything is ok.

    I drop the design taking into the original table. Because it is versioned, this isn't a problem.

    If I now open the design taking the copy table, the contents of the table does not display the updated information. This is not correct.

    If it is detected that the original is updated the copy table needs to be updated too. And stored in the model. Always the latest information from the copy table is available.

    Best regards

    Joop

    Hello Philippe,

    It also works well in version 4.0.3

    19438446 - status update the remote table (linked) is not saved

    Thank you

    Joop

  • Can we do a direct update on fnd_concurrent_programs table

    Hi team,

    Can someone help me with this.

    I have a requirement where I need to put the print_flag = "n" for all concurrent programs including Pavilion printer is "O".

    to do this, can I use a direct update statement or is there a standard API to update the column in the fnd_concurrent_programs table.

    My update statement:

    Update fnd_concurrent_programs set print_flag = ' no where print_flag = 'Y ';

    Can I go ahead with above the sql statement to update or do I need to use the api.

    at the same time I just want to check, can I do a direct update on fnd_concurrent_requests table too?

    Can someone help me on this.

    Can I go ahead with above the sql statement to update or do I need to use the api.

    at the same time I just want to check, can I do a direct update on fnd_concurrent_requests table too?

    Yes you can, for the two tables.

    Here are some examples:

    For FND_CONCURRENT_PROGRAMS:

    (Doc ID 419432.1)

    (Doc ID 427963.1)

    (Doc ID 837615.1)

    For FND_CONCURRENT_REQUESTS, see (Doc ID 134007.1).

    Thank you

    Hussein

  • How to upgrade the parent table and child by updating the parent table

    I have a parent EMPLOYEE table that includes columns (sysid, serviceno, employeename...) sysid is the primary key, serviceno is the Unique key and I have DEPENDENT child table includes columns (sysid, employee_sysid, name, date of birth...) there still SYSID is a primary key for the table of dependants, employee_sysid is a foreign key in the EMPLOYEE table.

    Now I want to change SYSID (with the help of the sequence) in the EMPLOYEE table that they want an update in the table of people dependent

    Note: I have 10000 records in the EMPLOYEE table as I have 5 more children tables that need to update new SYSID.

    Please help me

    first disable FOREIGN KEY constraints.
    You can update Parent and child record with the help of the trigger.
    Here I give you an examlpe... It can help u.

    create a parent (id number primary key, name varchar2 (100)) table
    /
    create table child_1 (primary key id, p_id number number, date of birth, date)
    CONSTRAINT FK_id FOREIGN KEY (p_id) REFERENCES parent (ID))
    /
    create table child_2 (key primary id, p_id2, addr varchar2 number number (1000))
    CONSTRAINT FK_id2 FOREIGN KEY (p_id2) REFERENCES parent (ID))
    /

    Insert some test data for the parent tables and children.

    change the constraint to disable child_2 table FK_id2
    /
    change the constraint to disable child_1 table FK_id2
    /

    CREATE OR REPLACE TRIGGER delete_child
    BEFORE parent UPDATE ON
    FOR EACH LINE
    BEGIN
    UPDATE CHILD_1
    P_ID =:NEW.ID SET
    WHERE P_ID =:OLD.ID;
    UPDATE CHILD_2
    SET = P_ID2: NEW.ID
    WHERE P_ID2 =:OLD.ID;
    END;
    /

    then Upadte parent table primary key col and check the children tables.
    do enable constraints...

  • How to write the trigger for update of 2 tables

    Hi all
    I have 2 tables,

    1.lv_data,
    It contains the following fields,
    emp_name        tot_days
     guru                    18
                
    2.leave_data
    It contains the following fields,
     emp_name          From_date              to_date            no_of_days       remaining_days
     guru                    02/05/2012          03/05/2012           2                         
    In the second table, if the data is inserted.
    the no_of_days will be calculated automatically (from to_date - From_date) + 1,

    Here, I need to write the trigger to update the remaining_days column,

    First table for all tot_days emp_name is 18 days,
    Thus, in the second table every time that the record is inserted.
    the remaining_days must be calculated as follows,

    remaining_days: = tot_days - no_of_days and this (calculated) value should be updated in the tot_days column in the first table (lv_data).

    Example:
    emp_name        tot_days
    guru                    18
                
    2.leave_data
     emp_name          From_date              to_date            no_of_days        remaining_days
     guru                    02/05/2012          03/05/2012         2                          16
    [/code  
    
    Now the first table should be updated like,
    emp_name tot_days
    Guru 16


    So I need to update to 2 tables,
    can someone help me to update these 2 tables through TRIGGER?

    Thank you
    Kind regards
    gurujothi

    Edited by: Gurujothi may 1, 2012 19:54

    It is generally considered bad practice to store the value even in 2 places. You are having the kind of problems that you are experiencing now. It is much easier to store in the main table and get the value from there where you need to show in your forms.

  • How update the relational table with XML data?

    I get XML messages that include a bunch of data items to be updated in a table. An arbitrary subset of rows is updated for each message received.

    The output of the following example is correct, but the use of the intermediate table that bothers me. The temporary table can be eliminated somehow? Or is the most reasonable way to loop just explicitly and parse the XML message and then update each row separately?

    I'm under 11.2.0.1.0.
    create table otn9test (
      id number not null primary key,
      data xmltype
    );
    
    insert into otn9test values (1, xmltype('<data>default for 1</data>'));
    insert into otn9test values (2, xmltype('<data>default for 2</data>'));
    insert into otn9test values (3, xmltype('<data>default for 3</data>'));
    
    create table otn9input (
      id number,
      data xmltype
    );
    
    column data format a30
    
    declare
      updata constant xmltype := xmltype('<root>
      <item>
        <id>1</id>
        <data>Id 1 updated.</data>
      </item>
      <item>
        <id>3</id>
        <data>Id 3 updated.</data>
      </item>
      <item>
        <id>4</id>
        <data>Id 4 updated.</data>
      </item>
    </root>');
    
    begin
      insert into otn9input
        select * from
        xmltable('/root/item' passing updata
              columns
              id number path 'id',
              data xmltype path 'data');
    
      update otn9test t set data = (
        select data from otn9input i
        where t.id = i.id
      ) where t.id in (select id from otn9input);
    
      commit;
    end;
    /
    
    select * from otn9input;
    
    /*
         ID DATA
    ---------- ------------------------------
          1 <data>Id 1 updated.</data>
          3 <data>Id 3 updated.</data>
          4 <data>Id 4 updated.</data>
    */
    
    select * from otn9test;
    
    /*
         ID DATA
    ---------- ------------------------------
          1 <data>Id 1 updated.</data>
          2 <data>default for 2</data>
          3 <data>Id 3 updated.</data>
    */
    
    drop table otn9input;
    drop table otn9test;

    The temporary table can be eliminated somehow?

    You can do it with the MERGER:

    merge into otn9test t
    using (
      select id, data
      from xmltable('/root/item' passing updata
            columns
              id   number  path 'id',
              data xmltype path 'data'
           )
    ) x
    on ( t.id = x.id )
    when matched then update
     set t.data = x.data
    ;
    

    However, if you are looking for performance on large data sets, I think that the best is to use an intermediate table of XMLType (binary storage) to maintain the XML instance.

    create table otn9input of xmltype
    xmltype store as securefile binary xml;
    
    insert into otn9input values(
    xmltype('
      
        1
        Id 1 updated.
      
      
        3
        Id 3 updated.
      
      
        4
        Id 4 updated.
      
    ')
    );
    
    merge into otn9test t
    using (
    select id, data
    from otn9input,
         xmltable('/root/item' passing object_value
              columns
                id number path 'id',
                data xmltype path 'data'
         )
    ) x
    on ( t.id = x.id )
    when matched then update
     set t.data = x.data
    ;
    

    A structured XMLIndex could also help.

  • Insert and update the nested table

    Hello

    I created a nested table containing the following columns. I need to insert records into the nested table. And also I have to update the nested table. Please find below my table and get error message.

    Please advose...!
    SQL> create type details as object(
      2  basic number(7,2),
      3  da number(6,2),
      4  hra number(6,2),
      5  pf number(6,2),
      6  it number(6,2),
      7  gross number(7,2),
      8  ded number(6,2),
      9  net number(8,2));
     10  /
    
    Type created.
    
    SQL> create type details_t is table of details;
      2  /
    
    Type created.
    
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  create table emp_tab(empno number(4),name varchar2(10),details_tab details_t)
      2* nested table details_tab store as empl_details
    SQL> /
    
    Table created.
    
    
    SQL> ed
    Wrote file afiedt.buf
    
      1* insert into emp_tab values(&empno,'&name',details_t(details(&da,&hra,&pf,&it,null,null,null)))
    SQL> /
    Enter value for empno: 1
    Enter value for name: asdf
    Enter value for da: 120
    Enter value for hra: 130
    Enter value for pf: 120
    Enter value for it: 120
    old   1: insert into emp_tab values(&empno,'&name',details_t(details(&da,&hra,&pf,&it,null,null,null
    new   1: insert into emp_tab values(1,'asdf',details_t(details(120,130,120,120,null,null,null)))
    insert into emp_tab values(1,'asdf',details_t(details(120,130,120,120,null,null,null)))
                                                 *
    ERROR at line 1:
    ORA-02315: incorrect number of arguments for default constructor
    Can I use '&' while inserting records in the nested table? Yes / No?

    I do need to update also net gross, ded, columns... !!

    Please help me... !!

    Concerning
    A
    $ sqlplus scott/tiger
    
    SQL*Plus: Release 10.2.0.2.0 - Production on Thu Apr 21 16:18:16 2011
    
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    
    SQL> CREATE TYPE details AS OBJECT(
     basic NUMBER(7,2),
     da NUMBER(6,2),
     hra NUMBER(6,2),
     pf NUMBER(6,2),
     it NUMBER(6,2),
     gross NUMBER(7,2),
     ded NUMBER(6,2),
     net NUMBER(8,2));  2    3    4    5    6    7    8    9
     10  /
    
    Type created.
    
    SQL> CREATE TYPE details_t IS TABLE OF details;
      2  /
    
    Type created.
    
    SQL> CREATE TABLE emp_tab(empno NUMBER(4),name VARCHAR2(10),details_tab details_t)
     NESTED TABLE details_tab store as empl_details  2
      3  /
    
    Table created.
    
    SQL> INSERT INTO emp_tab VALUES(7001,'Saubhik',details_t(details(100,100,50,10,10,null,null,null)));
    
    1 row created.
    
    SQL> SELECT * FROM TABLE (SELECT details_tab FROM emp_tab WHERE empno=7001);
    
         BASIC         DA        HRA         PF         IT      GROSS        DED
    ---------- ---------- ---------- ---------- ---------- ---------- ----------
           NET
    ----------
           100        100         50         10         10
    
    SQL> ^C
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  UPDATE TABLE (SELECT details_tab FROM emp_tab WHERE empno=7001)
      2     emp_sal
      3*    SET emp_sal.net=emp_sal.basic+emp_sal.da+emp_sal.hra
    SQL> /
    
    1 row updated.
    
    SQL> SELECT * FRM emp_tab;
    SELECT * FRM emp_tab
             *
    ERROR at line 1:
    ORA-00923: FROM keyword not found where expected
    
    SQL> SELECT * FROM emp_tab;
    
         EMPNO NAME
    ---------- ----------
    DETAILS_TAB(BASIC, DA, HRA, PF, IT, GROSS, DED, NET)
    --------------------------------------------------------------------------------
          7001 Saubhik
    DETAILS_T(DETAILS(100, 100, 50, 10, 10, NULL, NULL, 250))
    
    SQL>
    
  • Update Boolean attribute custom Active Directory by IOM

    The adapters supplied with the connector AD support updated standard attributes (string) and multivalued attributes, but I can't seem to understand how to upgrade a Boolean custom attribute in AD through IOM. All delivered Boolean fields seem to have custom adapters (IE account locked, password never expires, etc.).

    I tried to use the adapter to adpADCSCHANGEATTRIBUTE delivered, but it fails (as expected) with:
    + com.thortech.XL.Integration.ActiveDirectory.tcUtilADTasks: updateDetails: cannot update attributes: [LDAP: error code 21-00000057: LdapErr: IDDM-0C090B73, comment: error in the conversion of attribute operation, data 0, v1772] +.

    Suggestions?

    I think that the problem lies in the fact that IOM Boolean values are 0 or 1, while the Boolean values of directory server can most likely to be true or false. I tried supply quite a few attributes OID and AD should be no different.

    You would need to have an adapter to prepopulate that converts 0 false and 1 to true or to retain the values true/false to IOM.

    Let me know if still encounter you problems with this approach.

    Hope this helps,
    Sagar

  • Recent update of DB table

    Hello

    I have connected to a database (oracle 11g) through Toad, an i working with a Client on it.
    in the Client to make a few changes to data, I want to know is there a way of knowing
    which table has been recently updated or the table has been affected by the last
    Shares of the customer.

    concerning

    MDK.

    Published by: MDK on Jan 28, 2010 16:08

    Published by: MDK on Jan 28, 2010 16:12

    You may be able to use characteristic flame to get what you need, if auditing is not enabled:

    SELECT  TABLE_OWNER
    ,       TABLE_NAME
    ,       OPERATION
    ,       LOGON_USER
    FROM    FLASHBACK_TRANSACTION_QUERY
    WHERE   COMMIT_TIMESTAMP = (
                                    SELECT  MAX(COMMIT_TIMESTAMP)
                                    FROM FLASHBACK_TRANSACTION_QUERY
                               );
    

Maybe you are looking for

  • Portege R700 - Touch Pad, ecoUtility and presentation of the key does not

    Hello I got a Portege R700 with Windows 7 64 bit.This machine starts very slowly after the log in user mode only.The system is waiting for 1 to 2 Minutes before you can work. In administrator mode erverything is fine and fast. Thus our directors thou

  • After clicking on one of the results of Google search Firefox displays wrong web page

    If I click on any of the results of a Google search, I am taken to the wrong web page. When I go back and click again on everything is fine. It started a week ago. Re-loading of Firefox but its actually not difference. URL of affected sites http:// U

  • Support for Perkin Elmer 16PC FT - IR

    LabVIEW support a spectrophotometer Perkin Elmer of FT - IR 16PC?  I do not have the original software and need something to communicate with the instrument and make the %T and %R basic plots.

  • HP probook 455 G1: my fingerprint doesn't woork

    I got my probook with WIN 7 and I downloaded 8 WIN but I want to know how to activate the sensor printing prints.What should I do?what application or the thing I have to donwload to activate it?Help me please! Thank you!

  • Replace the Volume keys?

    Hi, is it possible to replace the volume keys (three keys on the side z10) I create a photo app, and I would like to take a photo when users press the volume keys. Thank you