Insert rows in table (A) in tab. (B) a table (C) update?

I have a table (C) if one of the columns (C1) of this table is updated, I want to insert all the rows of the table (A) in table (B).

If I could use the trigger, it would look like this:

CREATE OR REPLACE TRIGGER cn1_c2s_intr_trg
AFTER the UPDATE OF protocols WE of call_no1
WHEN (call_no1 IS NOT NULL)
BEGIN
INSERT INTO call2sites (protocol_id, site_id, site_relation_id)
SELECT: P76_PROTOCOLID_1, rsnumber, 1
OF researchsite
ORDER BY 1;
END;
/

But the database trigger side would not know what ": P76_PROTOCOLID_1" (the application page element) is. How the above can be achieved by APEX?

Thank you for your time.

Daniel

Triggers are just use specified PL/SQL, but yes, you can certainly call a function or a procedure to manage cela and have this pulled by a process page of the APEX. I've done it before, and it works fine. I have read your initial post and understood that you were looking for a solution based on the trigger, but if a procedure call works fine. Here's what it might look like:

--(APEX : PL/SQL Procedure firing On Submit - After Validations and Computations)
begin
  PROC_UPDATE_ABC(:P76_PROTOCOLID_1, :P76_CALL_NO1);
end;

Your procedure could then be something like:

create or replace PROCEDURE PROC_UPDATE_ABC(prot NUMBER, call NUMBER)
IS
  v_prot       NUMBER  := prot;
  v_call         NUMBER  := call;
begin
  INSERT INTO c VALUES (v_prot, 1, v_call);
  INSERT INTO c VALUES (v_prot, 2, v_call);
  INSERT INTO c VALUES (v_prot, 3, v_call);
  ...
end;

Tags: Database

Similar Questions

  • Newly inserted row in Table not visible until scroll us - question of ease of use

    Hello

    JDeveloper 11.1.1.5

    I have a table in a page and an Add button which will add a new row in the table.
    I just add the line before the current line.
    After you have added the line, I put new line on the current line in the View object.

    When there are a number of lines in the table and we have a scroll bar on the table to display the rows preceding and following, the question of ease of use, I am facing.

    Steps to follow:
    -Select the first row in the table
    -Scroll downwards several times so that the first line is not visible in the table
    -Added a new line

    This will add the line before the first line, but the problem is we cannot see it as the selected active line and is not ready for data entry.
    Users need to scroll upwards or downwards to find where the row is inserted.

    Is there a way we can set the focus on a particular point on the new line in the table?
    Or is there a way that we can make the new line to shown during creation, regardless of the current visibility of the rows in the table?
    Or can we get handle for the current line or any component of the current line so that we can try to set the focus?

    I observed the same behavior in the ADF components demo
    http://jdevadf.Oracle.com/ADF-richclient-demo/faces/components/table/updateableTable.JSPX

    Thanks for any help
    Concerning
    Sameer

    >
    Or is there a way that we can make the new line to shown during creation, regardless of the current visibility of the rows in the table?
    >
    try to set the property DisplayRow of the selected table

  • Insert row into table 2D retaining the previous values

    Amendment of data entered in a 2D array and also displayed a table. When the time rolls 3 columns of data are held and then created line. Problem is the line moves downwards, but the previous data is not stored. I tried using shift register, but that only auto markings lines table to fill as the iteration of the loop. Looks like a basic really simple problem but going round in circles on this one there...

    In this case, the function 'Replace table subset' is what is needed to replace the last values in line with the current values of the user interface.

    On the evolution of the time, an addition occurs.

    An update of the VI is attached.

  • Insert rows in the PL/SQl table

    Hello
    I have a PL/SQl table that I filled through bulk collect and now I'm trying to loop through the table (actually quite a few nested loops)... Now in one of my curls, I might need to insert a new row by splitting the field in the existing row in the table. Can I insert the line in the pl/sql table in the loop without affecting the "FOR i IN tab.first... Tab.Last' loop?
    Also, what would be the index of such a line inserted into the table. Can I access it with tab.last + 1 (doesn't look like it can be done if I insert into various levels of loops).
    OR
    If I insert the lines insde loops nested, then I can access the new lines as soon as I close all the loops and open a new loop? The new lines will be at the last table.

    Any help will be appreciated...

    The expression v_arr. LAST gives the index of the last entry, so you can refer to this element as

    v_arr(v_arr.LAST)
    

    Then the attributes of this element will be

    v_arr(v_arr.LAST).attr
    

    for example

    DECLARE
        TYPE table_defs_tt IS TABLE OF user_tables%ROWTYPE INDEX BY PLS_INTEGER;
        v_mytables table_defs_tt;
    BEGIN
        SELECT * BULK COLLECT INTO v_mytables
        FROM   user_tables
        WHERE  ROWNUM <= 100;
    
        DBMS_OUTPUT.PUT_LINE(v_mytables(v_mytables.LAST).table_name);
    END;
    
  • Need help to insert rows in the table to a custom table area

    Hi all

    I have a requirement as below.

    I have a page of the i invoke a popup search page and displaying the table data in the area of the table, this table I select lines and pressing the button and given in the basic page in the region of the table being filled, of data, I need to insert these lines into a custom table. Please help me how to achieve this. Basically, I need to insert rows from one table to a custom table region.

    Thnaks

    Hello

    Review the link, below, may be it will help you:

    https://forums.Oracle.com/thread/953885

    https://forums.Oracle.com/thread/2151775

    Please share your solution here, it will help others.

    Concerning

    Mahesh

  • Insert rows checked in the table

    Hi all
    How to insert rows checked in another table. I've created an interactive report with the query as follows
    Select apex_item.checkbox(1,id,'unchecked') ", Column1, Column2 from table. Now when I check the boxes to check off and hit the Insert button it should get stored in another table in DB (table1).

    Process:
    DECLARE
    IDX number;
    BEGIN
    BECAUSE me in 1.APEX_APPLICATION. G_F01. COUNTY
    LOOP
    IDX: = apex_application. G_F01 (i);
    Insert into step3_table (ID, TASK_NAME, TASK_DESCRIPTION, CATEGORY, TASK_INFO, TASK_STATUS, TO_WORKGROUP, IMPACT, FILE)
    values (apex_application. G_F02 (idx), apex_application. G_F03 (idx), apex_application. G_F04 (idx), apex_application. G_F05 (idx), apex_application. G_F06 (idx), apex_application. G_F07 (idx), apex_application. G_F08 (idx), apex_application. G_F09 (idx), apex_application. G_F10 (idx));
    END LOOP;
    END;

    Thanks for the help!

    Hello

    You don't have a F02 - F04 berries in your query.
    Even you, your insert statement do not have enough source columns.
    Also I do not know you could get all the data tables in this way... table F01 value maybe not array index value.

    Try

    BEGIN
      FOR i in 1..APEX_APPLICATION.G_F01.COUNT
      LOOP
    
        INSERT INTO step3_table (ID,TASK_NAME,TASK_DESCRIPTION,CATEGORY,TASK_INFO,TASK_STATUS,TO_WORKGROUP,IMPACT,FOLDER)
        SELECT id,column2,column2,column3,column4,column5,column6,column7,column8
        FROM table
        WHERE id = apex_application.G_F01(i)
        ;
    
      END LOOP;
    END;
    

    Kind regards
    Jari

  • Impossible to insert rows in the table

    My insert statement below is not correct, when I try to run, his encoutering error "table or view does not exist.

    Basically what I'm doing here collects the table name in THE variable that stores the name of the table in this variable. This variable, I use as a table. I know that's not the right way, please let me how can I insert rows in the complete table with the following code.

    DROP TABLE TEMP;
    CREATE TABLE TEMP AS SELECT * FROM model WHERE 1 = 2;
    DECLARE
    I HAVE INTEGER DEFAULT 1;
    S VARCHAR2 (50);
    Start
    for C (select TABLE_NAME IN s from USER_TABLES where TABLE_NAME like '% of the CABLE' and TABLE_NAME NOT like '% OLD' and the order of 0 > Num_ROWS by TABLE_NAME) loop
    INSERT INTO TEMP SELECT * FROM c.TABLE_NAME;

    dbms_output.put_line (c.table_name);
    end loop;
    end;



    The insert statement above is not correct. How can I write good way.

    Thank you.

    Best regards
    Arshad

    user13360241 wrote:
    My insert statement below is not correct, when I try to run, his encoutering error "table or view does not exist.

    Basically what I'm doing here collects the table name in THE variable that stores the name of the table in this variable. This variable, I use as a table. I know that's not the right way, please let me how can I insert rows in the complete table with the following code.

    DROP TABLE TEMP;
    CREATE TABLE TEMP AS SELECT * FROM model WHERE 1 = 2;
    DECLARE
    I HAVE INTEGER DEFAULT 1;
    S VARCHAR2 (50);
    Start
    for C (select TABLE_NAME IN s from USER_TABLES where TABLE_NAME like '% of the CABLE' and TABLE_NAME NOT like '% OLD' and order > 0 Num_ROWS of TABLE_NAME) loop
    INSERT INTO TEMP SELECT * FROM c.TABLE_NAME;

    dbms_output.put_line (c.table_name);
    end loop;
    end;

    The insert statement above is not correct. How can I write good way.

    Thank you.

    Best regards
    Arshad

    STMT: = "INSERT INTO TEMP SELECT * FROM ';"

    STMT: = STMT. S;
    IMMEDIATELY EXECUTE STMT;

  • Add more than 2 lines for a select statement without inserting rows in the base table

    Hi all

    I have a below a simple select statement that is querying a table.

    Select * from STUDY_SCHED_INTERVAL_TEMP
    where STUDY_KEY = 1063;

    but here's the situation. As you can see its return 7 ranks. But I must add
    2 rows more... with everything else, default or what exist... except the adding more than 2 lines.
    I can't insert in the base table. I want my results to end incrementing by 2 days in
    measurement_date_Taken on 01-APR-09... so big measurement_date_taken expected to
    end at study_end_Date...



    IS IT STILL POSSIBLE WITHOUT INSERT ROWS IN THE TABLE AND PLAYIHY ALL AROUND WITH
    THE SELECT STATEMENT?

    Sorry if this is confusing... I'm on 10.2.0.3

    Published by: S2K on August 13, 2009 14:19

    Well, I don't know if this request is as beautiful as my lawn, but seems to work even when ;)
    I used the "simplified" version, but the principle should work for your table, S2K.
    As Frank has already pointed out (and I fell on it while clunging): simply select your already existing lines and union them with the 'missing documents', you calculate the number of days that you are "missing" based on the study_end_date:

    MHO%xe> alter session set nls_date_language='AMERICAN';
    
    Sessie is gewijzigd.
    
    Verstreken: 00:00:00.01
    MHO%xe> with t as ( -- generating your data here, simplified by me due to cat and lawn
      2  select 1063 study_key
      3  ,      to_date('01-MAR-09', 'dd-mon-rr') phase_start_date
      4  ,      to_date('02-MAR-09', 'dd-mon-rr') measurement_date_taken
      5  ,      to_date('01-APR-09', 'dd-mon-rr') study_end_date
      6  from dual union all
      7  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('04-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
      8  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('09-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
      9  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('14-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
     10  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('19-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
     11  select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('23-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
     12  select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('30-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual
     13  ) -- actual query:
     14  select study_key
     15  ,      phase_start_date
     16  ,      measurement_date_taken
     17  ,      study_end_date
     18  from   t
     19  union all
     20  select study_key
     21  ,      phase_start_date
     22  ,      measurement_date_taken + level -- or rownum
     23  ,      study_end_date
     24  from ( select study_key
     25         ,      phase_start_date
     26         ,      measurement_date_taken
     27         ,      study_end_date
     28         ,      add_up
     29         from (
     30                select study_key
     31                ,      phase_start_date
     32                ,      measurement_date_taken
     33                ,      study_end_date
     34                ,      study_end_date - max(measurement_date_taken) over (partition by study_key
     35                                                                          order by measurement_date_taken ) add_up
     36                ,      lead(measurement_date_taken) over (partition by study_key
     37                                                          order by measurement_date_taken ) last_rec
     38                from   t
     39              )
     40         where last_rec is null
     41       )
     42  where rownum <= add_up
     43  connect by level <= add_up;
    
     STUDY_KEY PHASE_START_DATE    MEASUREMENT_DATE_TA STUDY_END_DATE
    ---------- ------------------- ------------------- -------------------
          1063 01-03-2009 00:00:00 02-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 04-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 09-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 14-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 19-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 23-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 30-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 31-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 01-04-2009 00:00:00 01-04-2009 00:00:00
    
    9 rijen zijn geselecteerd.
    

    Is there a simpler way (in SQL), I hope that others join, and share their ideas/example/thoughts.
    I feel that it is using more resources there.
    But I have to cut the daisies before now, they interfere my 'grass-green-ess";)

  • Error when inserting rows into a table

    Hello

    We have recently migrated to 9i and 10g. We have a scheduled task on our database who first removes all rows from a table and then inserts them back by selecting the lines of 5 tables. This table has a composite primary key based on 6 columns in it. In 9i, when I try to insert rows in the table after you remove all of the lines, I am able to insert the data successfully. However, in 10g, when I try to do the same operation, it fails with error ORA:

    ORA-00001: unique constraint violated

    The same query that works perfectly in 9i fails in 10g

    If anyone has some ideas on how to solve the same, kindly let me know.

    Thanks in advance.

    CrazyAnie wrote:
    Okay, so now the only option that remains is that I have load the data into a local table and then perform the loading.

    May not be the only option, but the safest and cleanest I would say.

    CrazyAnie wrote:
    Also, it would be very kind of you that you might suggest all other possible risk areas where this CHARSET conversion could be a concern.

    I imagine that the main areas of concern will be you are interfacing directly with other databases through database links and using string functions. Otherwise, as long as the manipulation of data is in the same database 10g should not be a problem.

    CrazyAnie wrote:
    I made the migration of my source 9i DB, which is on Solaris to my 10g database which is on Linux and a separate server (which resides in a completely different location) uses exp and IMP. So if I try to export my schema after you change the CHARACTER set and then import it into the target DB, should that help me to get rid of this error? What is an option that can be done?

    I don't think it would be that simple change your database character set, check out this link for discussions about the same:

    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:5783936214008]

  • Cannot insert rows in a table db to an element of the shuttle

    I'm a little puzzled. I created a shuttle element called P18_SELECTED_RESOURCES with the following LOV:
    SELECT sed.domain||'.'||
           sed.target||'.'||
           sed.skill||'/'||
           sed.skill_prof||'  '||
           r.first_name||' '||
           r.last_name "d",
           r.rsrc_id "r"
    FROM   ri_resource r, ri_skill_supply_eq_demand sed
    WHERE  r.rsrc_id = sed.rsrc_id
    AND    sed.work_id = :P18_WORK_ID
    It works properly and displays the correct data for: P18_WORK_ID.

    Then I created a page called SAVE_SHUTTLE_SELECTION triggered by button process called Submit with an action to submit the page. The button is located in the same region of the point of the shuttle. It looks like this:
    declare
    
     r_selected APEX_APPLICATION_GLOBAL.VC_ARR2;
    
    begin
    
     -- Convert the colon separated string from the shuttle into the array
     
     r_selected := APEX_UTIL.STRING_TO_TABLE(:P18_SELECTED_RESOURCES);
    
     -- the array should now contain rsrc_ids from the shuttle LOV
    
     -- Now insert those rsrc_ids into the RI_WORK_ASSIGNMENT table with the work_id from P18_WORK_ID
     FOR i IN 1..r_selected.count LOOP
        insert into RI_WORK_ASSIGNMENT (RSRC_ID, WORK_ID)
        values (r_selected(i), :P18_WORK_ID);
     END LOOP;
    
    end;
    The code executes and returns a success message, but no data is inserted into the table. The shuttle point and P18_WORK_ID are in different regions, but they are on the same page. I even tried to put a *' "commit"; * After the END of LOOP;. I didn't know who would do anything. There can be no. I use APEX 4.1.

    Thanks for any help.

    Hello people of the sea,

    I checked your code and the same replicated on my instance.it works fine.
    I thought that you didn't want seleceted any value from the left pane of the shuttle.

    so first change the value in the left pane to the right pane of the point of the shuttle, then click on submit .it definitely works.

    Kind regards
    Jitendra

  • How to perform an addition of column values in an insert query that would insert in the 3rd column, and the values how to insert into another table.

    I have two tables (2) RESULT TAB (1)

    CREATE TABLE TAB

    (

    NUMBER OF SNO

    A NUMBER,

    B THE NUMBER.

    NUMBER OF THE SUM

    );

    CREATE AN ARRAY OF RESULT

    (

    NUMBER OF SNO

    NUMBER OF THE SUM

    )

    my doubt is:

    (1) I want to insert a table TAB, my question is how to insert a column to the SUM using the column A AND B... Here im adding two values of the column and store result in the AMOUNT column.

    SNO   A  SUM           

    1 100 150 250

    2 300 100 400

    I want to like this, it is possible with single insert query?


    (2) at the time of the insertion TAB of values that SNO, and the values of table TAB $ insert in the table of RESULTS... is it possible these two inserts at the same time?

    in fact, im using another this table.fro TAB and easy to understand I write like that, please solve this problem

    First, you post in the wrong forum as this one is only for Oracle's SQL developer tool. So you might ask your question in the general forum of SQL.

    Second, you might solve your problems with bind variable:

    Insert tab

    (sno, a, b, sum)

    values

    (: SNO,: A: B: A + B :))

    You should not use sum as column name because it is a reserved word.

    More you cannot insert into two different tables with a single SQL, but you can use PL/SQL to do this:

    Start

    insert into tab values (: SNO,: A: B: A + B :);)

    insert into result values (: SNO,: A + B :);)

    end;

    If you meet sno from a sequence, you could do something like this:

    Start

    insert into values tab (seq_sno.nextval,:,: B,: A +: B) return sno in: SNO.

    insert into result values (: SNO,: A + B :);)

    end;

    Hope that helps,

    dhalek

  • How to identify the name of the procedure that inserts into a table in the TRIGGER

    Hello
    There are several procedures in my DB that perform the INSERT operation on a main table - MYTAB say.

    I created a trigger on the table MYTAB, to follow closely, what procedure is insert data in there. Is there a function that captures the name of this object?

    For example: PROC_A, PROC_B, PROC_C insert into the table MYTAB. And my query is - the trigger on table MYTAB should document these object names where the lines fit.
    Please let me know your suggestions...

    SQL> create table t (no integer, dt timestamp, who_inserted varchar2(4000));
    
    Table created.
    
    SQL> create or replace procedure p
      2  as
      3  begin
      4    insert into t (no, dt) values (1, systimestamp);
      5  end;
      6  /
    
    Procedure created.
    
    SQL> show err
    No errors.
    
    SQL> create or replace trigger t_trig before insert on t for each row
      2  begin
      3     :new.who_inserted := dbms_utility.format_call_stack;
      4  end;
      5  /
    
    Trigger created.
    
    SQL> show err
    No errors.
    
    SQL> begin
      2    p;
      3  end;
      4  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from t;
    
            NO DT                             WHO_INSERTED
    ---------- ------------------------------ ----------------------------------------
             1 31-OCT-14 04.58.53.668465 AM   ----- PL/SQL Call Stack -----
                                                object      line  object
                                                handle    number  name
                                              3a7ddbea0         2  KARTHICK.T_TRIG
                                              3ac979f30         4  procedure KARTHICK.P
                                              3a822deb8         2  anonymous block
    
  • Inserted row is the same as the deleted row

    Hello

    I have another weird behavior with ADF I don't understand... When I delete a line in an af:table and then I insert a line, the insert row is identical to the deleted row. Here is what I do

    1. Go to the page, the table is loaded with a record from the database
    2. Remove the line, using a button that triggers the delete of the iterator method in links
    3. Insert a new line using a method defined in the Application module implementation java class. He defines himself as a methodAction in links
      1. The insert in my interface button calls a method in my java bean

    public void insertNewVariableScheduleRow(ActionEvent ae) {
            insertNewVariableScheduleRow((DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry());   
    }
    
    private Row insertNewVariableScheduleRow(DCBindingContainer bindings) {
            OperationBinding        method = bindings.getOperationBinding("insertNewVariableScheduleRow");          
            Map                     paramsMap;
            Row                     newRow;
    
            paramsMap = method.getParamsMap();  
            paramsMap.put("defaultValues", scheduleDefaultValues.toArray());
            method.execute();
            
            logger.log("(method.getErrors().size(): " +(method.getErrors().size()));
            
            newRow = (Row)method.getResult();
            
            return newRow;
    }
    

    The method in the * class AMImpl do:

    public Row insertNewVariableScheduleRow(int scheduleNo, int scheduleVersion, String declId, String[] defaultValues) {
            ViewObject  vo          = this.getDeclSchedCellUpdView();
            int         displOrder  = getVariableScheduleNextDisplayOrder();
            Row         row         = vo.createRow();
            
            row.setAttribute("DisplOrder",  displOrder);        
            row.setAttribute("DeclId",      declId +"");
            row.setAttribute("SchedVrsnNo", scheduleVersion +"");
            row.setAttribute("ScheduleNo",  scheduleNo +"");
            
            for(int i=0; i<defaultValues.length; i++) {
                    if(defaultValues[i] != null) {
                            row.setAttribute("Col" +String.format("%03d", i+1) +"Value", defaultValues[i]);
                    }
            }
    
            vo.insertRow(row);
            
            return row;
    }
    

    I use JDev 11.1.1.7

    Thank you for all your help

    What is property changeEventPolicy on the iterator parameters in your pageDef? (try to define this 'None')

    In addition, you can try to run the managed bean delete operation and then reset the State of the component with:

    RicheTableau yourTable =...

    yourTable.resetStampState ();

    AdfFacesContext.getCurrentInstance () .addPartialTarget (yourTable);

    Dario

  • Need a logic sql to insert from one table to another

    I have a table ( TABLEA ) as follows:

    type_id level

    -------------

    1       7

    2       4

    I would like to insert above values in another table ( TABLEB ) through DML so it looks like so:

    seq_id type_id name    order level

    -----------------------------------

    1     1       display  1     7

    2     1       header   2    

    3     1       detail   3    

    4     2       display  1     4

    5          2          header    2

    6         2           detail      3   

    Looks like a very complex sql is necessary, for which I have no knowledge of :-).

    Hello

    97a5a09d-76e1-4fc7-8113-80b4705be7f4 wrote:

    I have a table ( TABLEA ) as follows:

    type_id level 
    -------------
    
    1       7 
    2       4 
    

    I would like to insert above values in another table ( TABLEB ) through DML so it looks like so:

    seq_id type_id name    order level 
    -----------------------------------
    
    1     1       display  1     7 
    2     1       header   2     
    3     1       detail   3
    4     2       display  1     4
    5          2          header    2
    6         2           detail      3    
    

    Looks like a very complex sql is necessary, for which I have no knowledge of :-).

    So, for each line in tablea, you want to INSERT 3 rows in tableb, is that at the time?

    One way to do that is to tablea to join of a table (or the result set) with 3 rows, like cntr below:

    INSERT INTO tableb (seq_id type_id, row_name, row_order, lvl)

    WITH cntr AS

    (

    SELECT LEVEL AS row_order

    OF the double

    CONNECT BY LEVEL<=>

    )

    SELECT ROW_NUMBER () OVER (ORDER BY a.type_id

    c.row_order

    ) - or sequence_name. NEXTVAL

    a.type_id

    Case c.row_order

    WHEN 1 THEN 'display '.

    WHEN 2 THEN 'head '.

    WHEN 3 THEN «details»

    END

    c.row_order

    Case c.row_order

    WHEN 1 THEN a.lvl

    END

    FROM tablea a

    CROSS JOIN cntr c

    ;

    If you would care to post CREATE TABLE and INSERT for your tables (as it exists before the UPDATE), then I could test this.

    NAME is not a very good column name, but it is nowhere near as bad as the ORDER or LEVEL.  I called ROW_NAME, ROW_ORDER and LVL columns instead.

  • [11g] ORA-31061/ORA-19202 - how to insert data xmltype table/validation of the schema (just well formed)

    Hello

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    Here's the demo program:

    ==============================

    create a global temporary table GTT_Test(data xmltype) validation delete rows;

    - and run this

    declare

    v_data xmltype.

    Start

    -It does not work

    /*

    v_data: = xmltype ("< itf:meta > < node / > < / itf:meta > '");

    */

    - but it works

    v_data: = xmltype)

    XMLDATA = > ' < my: meta > < node / > < / my: meta > ',

    schema = > null,

    validated = > 0,

    correct = > 1);

    - but try to insert into the table in the same way fails again:

    insert into GTT_Test (data)

    values (xmltype)

    XMLDATA = > ' < my: meta > < node / > < / my: meta > ',

    schema = > null,

    validated = > 0,

    correct = > 1));

    end;

    ==============================


    It translates errors ORA above and suspicion: "prefix 'my' is not declared".


    I need to create the TWG somehow different to accept without diagram validation?


    -Thanks!


    Kind regards

    Frank

    Hello.

    Try to declare to your XML namespace.

    for examplehttp://youaddress">

    "If you don't have a schema, try xmlns: my =" "(espace en blanc)."

Maybe you are looking for