Why ORA-06519 ?

I have shown my proc at high level below. While executing this proc for some reason i get Primary key violation on table my_tab_mf during insert, so the procedure as expected jumps to EXCEPTION block. When it comes to proc My_PKG_MF.LOG_ERROR in the exception block i get the error: ORA-06519: active autonomous transaction detected and rolled back. The proc My_PKG_MF.LOG_ERROR is an autonomous proc which has COMMIT inside it. Can somebody help me understand why i get this error though i have a COMMIT in the autonomous proc? The proc My_PKG_MF.LOG_ERROR calls another proc: MASTER.my_pkg_master.log_db_err in another schema called MASTER.
Im in 10gR2 version.
procedure proc_mf
as
v_proc_name varchar2(50) := 'proc_mf';
Err_Code varchar2(50);
Err_Desc varchar2(500)
begin
delete from table my_tab_mf;
insert into my_tab_mf (col1,col2)
select col1, col2 from a,b;
EXCEPTION
WHEN OTHERS
THEN
       ROLLBACK;
       Err_Code := SQLCODE;
       Err_Desc := SUBSTR(SQLERRM, 1, 256);
       My_PKG_MF.LOG_ERROR(v_proc_name
                                         ,To_Char(Err_Code)
                                         ,Err_Desc
end proc_mf;
-- Contents of AUTONOMOUS proc My_PKG_MF.LOG_ERROR
procedure LOG_ERROR(proc_name in varchar2 ,err_code in varchar2 ,err_desc in varchar2)
is
PRAGMA AUTONOMOUS_TRANSACTION;
begin
--logging the error into the log table
insert into my_log_mf
values(proc_name ,err_code,err_desc);
--calling another Error logging proc which is in another schema called Master
MASTER.my_pkg_master.log_db_err(proc_name ,err_code,err_desc);
COMMIT;
end LOG_ERROR;Edited by: michaelrozar17 on Mar 20, 2013 2:31 AM

MASTER.my_pkg_master.log_db_err is not an autonomous proc and it does not have a commit in it. The calling autonomous procedure My_PKG_MF.LOG_ERROR has commit in it, which commits the transaction happened in MASTER.my_pkg_master.log_db_err.
-- Contents of MASTER.my_pkg_master.log_db_er
procedure log_db_er(proc_name in varchar2 ,err_code in varchar2 ,err_desc in varchar2)
as
begin
insert into master_err_log(col1, col2,col3)
values(proc_name,err_code ,err_desc );
end log_db_er;

Similar Messages

  • ORA-06519 while doing transactions

    Hi,
    I have created a trigger on my transaction table. When a service is booked it is being inserted into two seperate tables. It is working fine, but at some times I am getting following error while recording the transactions.
    ORA-06519 Active autonomous transactions detected and rolled back.
    Following is the trigger code:
    create or replace trigger glstrip_audit
    after INSERT or update ON jeevadb.ipservice
    for each row
    declare
    pragma autonomous_transaction;
    nurstcode pbswardmast.nurstcode%type;
    roomno pbsipregist.currroomno%type;
    BEGIN
    select b.nurstcode,a.currroomno into nurstcode,roomno from pbsipregist a,pbswardmast b where a.currroomno=b.wardno and a.regno=:new.ipno;
    if :new.servcode='006013' then
    if inserting then
    insert into phindenthd(indentno,indentdate,indenttime,regno,storecd,nurstcode,doctcode,userid,edituser,editdate,status)
    values (:new.servslno,:new.servdate,:new.servtime,:new.ipno,'94',nurstcode,:new.orderedby,:new.createdby,:new.editedby,:new.editedon,'P');
    insert into phindentdt(indentno,itecode,indentqty)
    values (:new.servslno,'OPTGS01',:new.servqty);
    elsif updating then
    update phindenthd set indentno=:old.servslno,indentdate=:old.servdate,indenttime=:old.servtime,regno=:old.ipno,
    storecd='94',nurstcode=nurstcode,doctcode=:old.orderedby,userid=:old.createdby,edituser=:new.editedby,editdate=:new.editedon,status='P'
    where regno=:old.ipno and indentno=:old.servslno;
    update phindentdt set indentno=:old.servslno,itecode='OPTGS01',indentqty=:new.servqty where indentno=:old.servslno;
    end if;
    end if;
    end;
    can you help me in finding the problem?
    thanks
    satya

    Hi and welcome to the forum.
    "ORA-06519: active autonomous transaction detected and rolled back
    Cause: Before returning from an autonomous PL/SQL block, all autonomous transactions started within the block must be completed (either committed or rolled back). If not, the active autonomous transaction is implicitly rolled back and this error is raised.
    Action: Ensure that before returning from an autonomous PL/SQL block, any active autonomous transactions are explicitly committed or rolled back"
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10880/e4100.htm#sthref2110
    As mentioned by Bartek, Justin and Adrian you've probably forgotten to commit your autonomous transaction and you're abusing the automomous transaction here, don't use 'autonomous triggers', they're nothing but bugs in your code.
    My $0.02: you're trying to avoid a mutating table error.
    If so, then see: http://asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551198119097816936
    (Here you can read more FAQ's: http://tkyte.blogspot.com/2009/10/httpasktomoraclecomtkyte.html )
    and:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2212445691154

  • Pipeline function raised ORA-06519: active autonomous transaction detected

    Hi All,
    My name is John and I've got a problem which I need to share with all of you guru and experts. I've created the following pipeline function under the Oracle user ABC:
    CREATE OR replace FUNCTION SomeFunction(p_from_date DATE, p_to_date DATE) RETURN T_TAB_A pipelined
    IS
    PRAGMA autonomous_transaction;
    BEGIN
    DELETE FROM temp_rcm;
    INSERT INTO temp_rcm
    SELECT * FROM int.facility fd,
    int.capacity co
    WHERE co.resource_name = fd.resource_name
    AND co.trade_date = fd.trade_date
    AND co.trade_date BETWEEN p_from_date AND p_to_date;
    COMMIT;
    FOR rec IN (SELECT co.*
    FROM temp_rcm co
    left join int.outage o
    ON ( o.flag = 'Y'
    AND o.reason_flag = 'F'
    AND o.INTERVAL = co.INTERVAL
    AND co.resource_name = o.resource_name )
    ORDER BY co.INTERVAL,
    co.name) LOOP
    pipe ROW (T_A( rec.INTERVAL, rec.trade_date,
    rec.resource_name,rec.day_of_week_long, rec.working_day, rec.peak));
    END LOOP;
    RETURN;
    END SomeFunction;
    I was able to compile and create the SomeFunction function successfully but when I executed it using the following command:
    select * from table(SomeFunction(to_date('01/01/2010',to_date('01/01/2010')));
    I was returned with the Oracle error - ORA-06519: active autonomous transaction detected and rolled back
    I have searched through the web, such Oracle error occurs whenever the function has a missing 'COMMIT' or 'ROLLBACK' command inside an autonomous_transaction. But the fact is I have already included the 'COMMIT;' in the function. I suspected that the error was caused by the tables which I queried against (like int.facility and int.capacity) were all views that belonged to another schema called int. Or is that something that I miss in the function? Thank you for your time and assistance.
    Regards,
    John

    johnwanng wrote:
    Hi Guys,
    Thank you for all your feedback. In addition to your reply, Bill, can you spare some time and provide us a simple example of the steps involved to implement the 'correct' implementation based on the queries that I've used. As I do not understand your vanilla approach. Much appreciated and thank you for the time again.
    Regards,
    JohnIf I had to guess, Billy may have meant something like this (untested):
    CREATE OR REPLACE FUNCTION SomeFunction
    ( p_from_date IN int.facility.trade_date%TYPE
    , p_to_date   IN int.facility.trade_date%TYPE
    RETURN SYS_REFCURSOR
    AS
         rcur     SYS_REFCURSOR;
    BEGIN
         OPEN rcur FOR
              SELECT co.interval
                   , co.trade_date
                   , co.resource_name
                   , co.day_of_week_long
                   , co.working_day
                   , co.peak
              FROM   int.capacity co
              JOIN   int.facility fd        ON fd.resource_name = co.resource_name
                                           AND fd.trade_date    = co.trade_date
              LEFT OUTER JOIN int.outage o  ON o.interval       = co.interval
                                           AND o.resource_name  = co.resource_name
              WHERE  co.trade_date BETWEEN p_from_date AND p_to_date
              AND    o.reason_flag = 'F'
              AND    o.flag        = 'Y'
              ORDER BY co.interval
                     , co.name
         RETURN rcur;
    END;
    /I made the following modifications:
    1. I set the input parameter data types to match that of the table column you are checking against. A good practice to get into.
    2. Removed the autonomous transaction and inserting into a temp table. In Oracle it's a good practice to perform everything in a single SQL statement if possible.
    3. Changed the return data type to a SYS_REFCURSOR
    Hope this helps and provides a good example.

  • ORA-06519: active autonomous transaction detected and rolled back

    I am getting this error. when i am doing insert from my package Any solution to reslove this issue
    ORA-06519: active autonomous transaction detected and rolled back . thanks
    I am doing select - insert...

    Also, if you have any exception handler sections in the code,
    then you have to add a commit or rollback statement for
    every exception that is handled.

  • Why ORA-01555 (Snapshot too old) occures on an unchanged table

    Hello,
    we have to add a not null column into a large table. The simple update is not good, due to UNDO space.
    alter table T add F INTEGER default 0 not null;
    ORA-30036: unable to extend segment by  in undo tablespace ''It is OK. (We cannot use create + insert + drop + rename due to not enough free space. The table is not partitioned current) So we try this script:
    --create the column without default and not null
    alter table T add F INTEGER;
    --create temp table with the rowids of T (nologging -> minimal log)
    create table TMP (row_id rowid) nologging;
    --save the rowid-s. (direct -> minimal undo usage)
    insert /*+APPEND*/ into TMP(row_id) select rowid from T;
    commit;
    --the "insert method"
    --set the column to "0" with frequently commit
    declare
      i integer := 0;
      commit_interval integer := 10000;
    begin
      for c in (select * from TMP) loop
        update T set F=0 where rowid=c.row_id;
        i := i + 1;
        if( mod(i,commit_interval)=0) then commit;
        end if;
      end loop;
      commit;
    end;
    --set to not-null
    alter table T modify F default 0 not null;
    --drop the temp table
    drop table TMP;the insert method occures
    ORA-01555: Snapshot too old (in row 5)The row 5 is the cursor "select * from TMP" in the insert method. The undo usage of this method is below 2 MB.
    My question is:
    Why oracle need snapshot, while the TMP table does not change during the insert method? The TMP table was populated and commited before the insert method. Why oracle try to read the rows of the TMP table from the undo tablespace?
    Thx: lados.

    Thank, I have read this article, but there is something, what I don't understand.
    As I see, the DML does not clear all the modified datablock header, but it clears only the rollback segment slots. Only the next SQL (even if this is a query) clears the datablock header. This next SQL can clear only when the info is still available in the rollback segment, else ORA-1555 occures.
    My question is:
    What happens when the next SQL comes only one year later on this block? I don't believe that oracle doesn't handle this situation, but I didn't find how it is handled.
    Thx: lados.

  • Cannot figure out why "ORA-01000 Maximum open cursors" is shown...

    Hello there ...
    I am programming a PL/SQL Code that is throwing 0RA-01000 Maximum Open Cursors Exceeded.
    Having already read quite a lot about ORA-01000 errors, I know I should be closing cursors, and have already tried setting OPEN_CURSORS parameter to a high number (1000).
    I declared a lot of procedures in my pl/sql, each of which uses one cursor since i am working with a non-Oracle table linked by ODBC ... and each procedure sometimes does thousands of inserts -- but all WITHIN the explicit cursors. The explicit cursors are not declared within each loop.
    I already checked the code many times, and made sure all open cursors are closed. In addition, I also verified the numberopen cursors generated by the PL/SQL by running the following SQL after every procedure i run... and outputting it... and it appears the value just keeps on increasing, even though I had explicitly closed all the cursors in all the earlier procedures.
    What is funny is that the most number of cursors reported by the code below only hits 150+ cursors. Nowhere near the 1000 open_cursors limit per session.
    select a.value into strtxt --, b.name        
            from v$mystat a, v$statname b
            where a.statistic# = b.statistic#
            and a.statistic#= 3;When I run the procedures separately though, all the procedures run smoothly (even when I had not yet updated the open_cursors parameter).
    I was thinking of the following, but maybe you have some other ideas?
    Does this have anything to do with my procedures not being stored procedures?
    Or should i be committing records within my procedures instead of out of it?
    I really have run into a wall and would really appreciate any tips or helps on this. Thanks in advance!
    My basic pl/sql code looks like below. I did not give the actual details cause it will be too long (up to 5000 lines).
    DECLARE
    PROCEDURE proc1
    IS
        CURSOR cur_hca
           is
               select ...from..where;
       TYPE cur_hca_fetch
            Is TABLE OF cur_hca%ROWTYPE
                INDEX BY PLS_INTEGER;
        temp_collect cur_hca_fetch;
    BEGIN
       open cur_hca;         --cur_hca is the cursor name.
                                      --i use exactly the same cursor name in the other procedures
          loop
             fetch cur_hca bulk collect into temp_collect LIMIT 1000;
             exit when temp_collect.count=0
             for indx in 1 .. temp_collect.count
                loop
                  ...run some sql
                end loop;
          end loop;
      close cur_hca;
    END proc1;
    PROCEDURE proc2   --almost the same as above the only changes are the query for the
                                 -- cursor and the sql that happens for each record
    IS
    BEGIN
       open cur_hca;         --cur_hca is my cursor name
          loop
          end loop;
      close cur_hca;
    END proc2;
    ... up to 40 other very similar procedures
    BEGIN
       proc1;
       commit;
       select a.value into strtxt
            from v$mystat a, v$statname b
            where a.statistic# = b.statistic#
            and a.statistic#= 3;
      DBMS_OUTPUT.PUT_LINE('Number of Cursors After STATUSproc1: ' || strtxt); 
       proc2;
       commit;
       select a.value into strtxt
            from v$mystat a, v$statname b
            where a.statistic# = b.statistic#
            and a.statistic#= 3;
       DBMS_OUTPUT.PUT_LINE('Number of Cursors After STATUSproc2: ' || strtxt); 
       ... 40 other procedures
    END;Edited by: user4872285 on May 6, 2013 6:49 PM
    Edited by: user4872285 on May 6, 2013 7:01 PM
    Edited by: user4872285 on May 6, 2013 8:02 PM
    Edited by: user4872285 on May 6, 2013 8:03 PM

    PL/SQL code usually leaks reference cursors and DBMS_SQL cursors - as the ref cursor/DBMS_SQL interface used has a global (session static) scope.
    PL/SQL has an intelligent garbage collector that will close local implicit and explicit cursors, when the cursor variable goes out of scope.
    If you define an explicit cursor globally (package interface), then it can only be opened once. The 2nd attempt results in a ORA-06511: PL/SQL: cursor already open exception. So code cannot leak explicit cursors as code cannot reopen an existing opened explicit cursor.
    I have never seen Oracle leaking cursors internally. So I would be hesitant to call what you are seeing, a bug. If your code is using explicit cursors (even static/global ones), your code cannot leak these cursors, even if your code does not close them. Worse case - the cursor remains open, however new copies cannot be created while it is open.
    So I think your are looking at the wrong thing - explicit cursors. These are not the cursors that are leaking in my view (simply because code cannot reuse and open an already opened explicit cursor). Here is an example:
    SQL> show parameter cursors
    NAME                                 TYPE        VALUE
    open_cursors                         integer     300
    session_cached_cursors               integer     50
    // procedure that seems to "leak" an explicit cursor handle
    // as it does not explicitly closes the handle
    SQL> create or replace procedure CursorUse is
      2          cursor c is select e.* from emp e;
      3          empRow  emp%RowType;
      4  begin
      5          open c;
      6          fetch c into empRow;
      7          --// not closing explicit cursor handle
      8          --// and going out-of-scope
      9  end;
    10  /
    Procedure created.
    // current session stats
    SQL> select b.name, a.value from v$mystat a, v$statname b where a.statistic# = b.statistic# and b.name like '%open%cursor%';
    NAME                                  VALUE
    opened cursors cumulative                91
    opened cursors current                    2
    // execute proc that "leaks" a cursor, 10000 times
    SQL> begin
      2          for i in 1..10000 loop
      3                  CursorUse;
      4          end loop;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    // no errors due to cursor leakage
    // session stats: no cursor leakage occurred as
    // PL/SQL's garbage collector cleaned (and closed)
    // cursor handles when these became out-of-scope
    SQL> select b.name, a.value from v$mystat a, v$statname b where a.statistic# = b.statistic# and b.name like '%open%cursor%';
    NAME                                  VALUE
    opened cursors cumulative            10,095
    opened cursors current                    2
    SQL> So the cursor leakage you are seeing is caused by something else... so what else is part of the code, or the session, that you have not yet mentioned?

  • A newbie problem - Why 'ORA-00942: table or view does not exist'

    Hi,
    I am a newbie having a very basic problem.
    I have just created a table by reading in a CSV file.
    However when I try to SELECT from it, I get an error message saying :-
    ORA-00942: table or view does not exist
    How can this be when I can see the table name ?
    I have tried a couple of things that I found in the Discussion Forum, like 'ALTER SCHEMA' and 'GRANT SELECT'.
    Neither seemed sensible because I have just created a table, and sure enough, neither helped.
    It's disappointing that something so basic can go wrong.
    I will be very grateful for any advice.
    Barry

    This tool and forum is awesome. I'm a developer that was never touched HTMLDB and now with in a month I'm developing applications quickly and when I have a question I have this active forum to ask my sometimes stupid and othertimes valid questions! This is great! I don't know where you all find the time to help out so much!
    It is a little addicting though... I find myself sitting down Saturday morning just to spend a couple of minutes reading the posts and next thing I know hours have gone by as I use what I read because I can't wait until Monday...
    Thank you all for everything!!!! HTMLDB, APEX, Javascript and now in another post I'm learning about "Fine Grained Access Control" or "Virtual Private Database".
    Enjoy, BillC :>)

  • Can't figure out why: ORA-00911 on dynamic SQL

    Hi everyone,
    I have a report that is generated with the HTMLDB_ITEM toolkit. The report generates a checkbox, a hidden field, a text field, two select lists, and a select field.
    There is a button in the region that activates a process to update two tables with the values in the fields. I have simplified the generated code by putting in variables that allow me to print a meaningful debug statement. The generated statement causes an ORA-00911; invalid character error. However, running the generated statement in the SQL Workshop works fine.
    Here is the code (only slightly sanitized):
    DECLARE
    v_update_string varchar2(2000);
    v_project_name  varchar2(2000);
    v_IT_dependant varchar2(1);
    v_gxp_relevant  varchar2(1);
    v_project_id    varchar2(10);
    v_pm_id         varchar2(10);
    BEGIN
    for i in 1..HTMLDB_APPLICATION.G_F01.COUNT
    loop
    v_update_string := null;
    v_project_name  := HTMLDB_APPLICATION.G_F03(HTMLDB_APPLICATION.G_F01(i));
    v_IT_dependant := HTMLDB_APPLICATION.G_F04(HTMLDB_APPLICATION.G_F01(i));
    v_gxp_relevant   := HTMLDB_APPLICATION.G_F05(HTMLDB_APPLICATION.G_F01(i));
    v_project_id    := HTMLDB_APPLICATION.G_F02(HTMLDB_APPLICATION.G_F01(i));
    v_pm_id         := HTMLDB_APPLICATION.G_F06(HTMLDB_APPLICATION.G_F01(i));
    v_update_string := 'update abc_project set ';
    v_update_string := v_update_string || 'project_name = '''   || v_project_name || ''',';
    v_update_string := v_update_string || ' it_dependant = '''  || v_IT_dependant|| ''',';
    v_update_string := v_update_string || ' gxp_relevant = '''  || v_gxp_relevant|| '''';
    v_update_string := v_update_string || ' where id = '      || v_project_id || ';' ;
    -- This statement is debug output.
    wwv_flow.debug('UPDATE_PROJECT_DATA v_update_string for ABC_PROJECT:' || v_update_string);
    execute immediate v_update_string;
    v_update_string := null;
    v_update_string := 'update abc_project_monthly set ';
    v_update_string := v_update_string || 'project_manager = ' || v_pm_id;
    v_update_string := v_update_string || ' where project_id = ' || v_project_id || ' and ';
    v_update_string := v_update_string || 'trunc(record_date, ''MON'') = trunc(SYSDATE, ''MON'');';
    -- This statement is debug output.
    wwv_flow.debug('UPDATE_PROJECT_DATA v_update_string contents for
    ABC_PROJECT_MONTHLY:' || v_update_string);
    execute immediate v_update_string;
    end loop;
    END;Here is the generated statement from the wwv_flow.debug statement:
    0.05: UPDATE_PROJECT_DATA v_update_string for ABC_PROJECT:update abc_project set project_name = 'Test Project 4', it_dependant = 'N', gxp_relevant = 'N' where id = 425;
    The next statement is "SHOW ERROR page..."
    I have the feeling that I'm barking up the wrong tree. I've not been able to find anything helpful regarding the ORA-00911 error and wonder if I've been mislead and am looking in the wrong place.
    As mentioned, running the generated SQL works fine in the SQL Worksop and in SQL Developer, just cut and paste. Could this have something to do with the "execute immedate"? You might have noticed that two statements should be generated, but we never get past the first one.
    I would greatly appreciate any thoughts.
    Thanks,
    Petie
    Message was edited by:
    Petie

    Hi Vikas and Vishal,
    Thanks so much for your time in responding to my question.
    Removing the extraneous semicolon indeed solved the problem. It was clear, with only a little thought, that with the semicolon in the generated statement the result was something like:
    execute immediate update this set that = the_other;;which clearly is a problem.
    I will look at the bind variables, Vikas, and start migrating the code in that direction. Thanks for your suggestion.
    Yours,
    Petie

  • Why ORA-00907?

    Sorry for my english, I've tried the following query in TOAD and it works OK, but i try the same from vb.net using oraoledb and error ORA-00907 appears.
    select M.NRO_ASIENTO as N_Asiento ,
    (select count(ASI.NRO_ASIENTO) FROM dgo_asientos ASI WHERE ASI.NRO_ASIENTO <= A.NRO_ASIENTO and ASI.TIPO_ASIENTO='002') as ordenAsiento
    FROM dgo_movimientos M, dgo_asientos A
    WHERE A.EJERCICIO= M.EJERCICIO and A.NRO_ASIENTO= M.NRO_ASIENTO
    any ideas??
    thank you

    I also get the ORA-00907 with the query show below. It fails in both 9.2.0.2 and 9.2.0.4. It works fine using SQL*PLus and Micrcosoft's MSDAORA driver (!) against a 9.2.0.1 database and Microsoft .NET Framework v1.0.3705.
    Tony Bravo
    SQL> r
    1 select SUM(case when emad.EMAD_ADJUSTMENT_CD = 'GI'
    2 then empo.EMPO_BASIC_PAY * cora.CORA_MAX_ADJUSTMENT / 100
    3 else 0 end) as SumGIAvailable,
    4 SUM(case when emad.EMAD_ADJUSTMENT_CD = 'MI'
    5 then empo.EMPO_BASIC_PAY * cora.CORA_MAX_ADJUSTMENT / 100
    6 else 0 end) as SumMIAvailable,
    7 SUM(case when emad.EMAD_ADJUSTMENT_CD = 'MI'
    8 then empo.EMPO_BASIC_PAY * emad.EMAD_ADJUSTMENT_VALUE / 100
    9 else 0 end) as SumMISpent,
    10 SUM(case when emad.EMAD_ADJUSTMENT_CD = 'CAD'
    11 then emad.EMAD_ADJUSTMENT_VALUE else 0 end) as SumCADSpent
    12 from PBCS_EMPLOYEE_POSITIONS empo,
    13 PBCS_EMPL_COMP_REVIEWS emco,
    14 PBCS_EMPL_COMP_ADJUSTMENTS emad,
    15 PBCS_COMP_ADJUSTMENT_RANGES cora
    16 where empo.EMPO_EMPLOYEE_ID = emco.EMCO_EMPLOYEE_ID
    17 and empo.EMPO_PERIOD_ID = emco.EMCO_PERIOD_ID
    18 and emco.EMCO_REVIEW_ID = emad.EMAD_REVIEW_ID
    19 and emad.EMAD_ADJUSTMENT_CD = cora.CORA_ADJUSTMENT_CD
    20 and emco.EMCO_PERIOD_ID = cora.CORA_PERIOD_ID
    21* and empo.EMPO_PERIOD_ID = 4
    SUMGIAVAILABLE SUMMIAVAILABLE SUMMISPENT SUMCADSPENT
    10813.14 27726 9460 17002

  • Problem with ora:addChildNode()

    Hi,
    in wsdl file i have such a xml element defined
    <types>
    <schema attributeFormDefault="qualified" elementFormDefault="qualified"
    targetNamespace="http://ntu.ac.uk/bpel/travelagency/"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="intArray">
    <complexType>
    <sequence>
    <element name="ind" type="int" maxOccurs="unbounded" />
    </sequence>
    </complexType>
    </element>
    </schema>
    </types>
    when i try to add a new element to intArray i get fault message that there is an error in xpath query while executing ora:addChildNode(bpws:getVariableData('sortedIndexes','/tns:intArray'), bpws:getVariableData('no-of-results'))
    Here are fragments of my bpel file
    <variable name="no-of-results" type="xsd:int"/>
    <variable element="tns:intArray" name="sortedIndexes"/>
    <copy>
    <from expression="ora:addChildNode(bpws:getVariableData('sortedIndexes','/tns:intArray'), bpws:getVariableData('no-of-results'))"></from>
    <to variable="sortedIndexes" query="/tns:intArray"/>
    </copy>
    where tns is "http://ntu.ac.uk/bpel/travelagency/"
    Why ora:addChildNode() is not able to add new element to array of integers? Mayby I use it in wrong way? Do you have any suggestions?

    Hi Jedrzej,
    Please don't use the addChildNode() function, this function is going to deprecated, instead use the new bpel extension insert/append (bpelx:append):
    Syntax:
    <bpel:assign>
    <bpelx:append>
    <bpelx:from ... />
    <bpelx:to ... />
    </bpelx:append>
    </bpel:assign>
    The from-spec within <append> yields a single node or a node list. (Please note: the from-spec of <bpel:copy> still MUST yield ONLY one node.) The node list will be appended as child nodes to the target node specified by to-spec. If the from-spec yields zero node, "bpel:selectionFailure" fault will be generated.
    The to-spec MUST yield one single L-Value element node. Otherwise, "bpel:selectionFailure" fault will be generated. The to-spec cannot refer to a partnerLink.
    See: http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/Node.html#appendChild(org.w3c.dom.Node)
    Example: (XSD details at end of the document)
    Consolidating multiple bills of material into one single bill of material by appending multiple "b:part" for one BOM to "b:parts" the consolidated BOM.
    <bpel:assign>
    <bpelx:append>
    <from variable="billOfMaterialVar"
    query="/b:bom/b:parts/b:part" />
    <to variable="consolidatedBillOfMaterialVar"
    query="/b:bom/b:parts" />
    </bpelx:append>
    </bpel:assign>
    2. Insert
    2.1 insertBefore
    Syntax:
    <bpel:assign>
    <bpelx:insertBefore>
    <bpelx:from ... />
    <bpelx:to ... />
    </bpelx:insertBefore>
    </bpel:assign>
    The restriction and semantics of from-spec under insertBefore is similar to those in the case of <bpelx:append>.
    The to-spec under <insertBefore> MUST points to one or more single L-Value nodes. If more than one nodes are returned, the first node will be used as the reference node. The reference node MUST be an element node. The parent of the reference node MUST be an element node also. Otherwise, "bpel:selectionFailure" fault will be generated. The to-spec cannot refer to a partnerLink.
    The node list generated by the from-spec will be inserted before the reference node.
    See:
    http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/Node.html#insertBefore(org.w3c.dom.Node,%20org.w3c.dom.Node)
    Example: (XSD details at end of the document)
    Say before the execution of <insertBefore>, the value of "addrVar" is:
    <a:usAddress>
    <a:state>CA</a:state>
    <a:zipcode>94065</a:zipcode>
    </a:usAddress>
    After the execution of the following:
    <bpel:assign>
    <bpelx:insertBefore>
    <from>
    <a:city>Redwood Shore></a:city>
    </from>
    <to "addrVar" query="/a:usAddress/a:state" />
    </bpelx:insertBefore>
    </bpel:assign>
    The value of "addrVar" becomes:
    <a:usAddress>
    <a:city>Redwood Shore</a:city>
    <a:state>CA</a:state>
    <a:zipcode>94065</a:zipcode>
    </a:usAddress>
    2.2 insertAfter
    Syntax:
    <bpel:assign>
    <bpelx:insertAfter>
    <bpelx:from ... />
    <bpelx:to ... />
    </bpelx:insertAfter>
    </bpel:assign>
    <insertAfter> is very similar to <insertBefore>. Except:
    If more than one L-Value nodes are returned by the to-spec, the last node will be used as the reference node.
    Instead of inserting nodes "before" the reference node, the source nodes will be inserted after the "reference" node.
    This operation can also be considered a macro of conditional-switch + (append or insertBefore).
    Example: (XSD details at end of the document)
    Say before the execution of <insertAfter>, the value of "addrVar" is:
    <a:usAddress>
    <a:addressLine>500 Oracle Parkway</a:addressLine>
    <a:state>CA</a:state>
    <a:zipcode>94065</a:zipcode>
    </a:usAddress>
    After the execution of the following:
    <bpel:assign>
    <bpelx:insertAfter>
    <from>
    <a:addressLine>Mailstop 1op6</a:addressLine>
    </from>
    <to "addrVar" query="/a:usAddress/a:addressLine[1]" />
    </bpelx:insertAfter>
    </bpel:assign>
    The value of "addrVar" becomes:
    <a:usAddress>
    <a:addressLine>500 Oracle Parkway</a:addressLine>
    <a:addressLine>Mailstop 1op6</a:addressLine>
    <a:state>CA</a:state>
    <a:zipcode>94065</a:zipcode>
    </a:usAddress>

  • Cold Backup ERROR ORA-01113

    Hi Friends,
    Oracle 10g R2 DB
    I have taken a cold backup pf my database.
    I shutdown the db, and copy all the datafile,logfile,controlfile to /u01/BACKUP_DB.
    Then I tried to test my backup by pointing all the dbfs to /u01/BACKUP_DB.
    startup mount
    alter database rename file ... to ...;
    alter database open;
    ORA-01113: file 1 needs media recovery
    ORA-01110: data file 1 '/u01/BACKUP_DB/system01.dbf'
    Where did I go wrong? :(
    I am sure I shutdown the database.
    Thanks a lot

    Why do I get ORA-01113 for the cold backup?
    To get some clue why ora-01113 error comes during backup and recovery review following link.
    I  recreated controlfile, but recover database failed!
    Khurram                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • ORA-03113 not recorded as error in procedure

    Hi all,
    we are running several materialized view refreshes from a procedure. When the procedure encounters error ORA-03113 on one view it doesn't go to exception but just stops.
    The refresh part of the procedure is as follows:
    begin
    dbms_snapshot.refresh ('USR.USRH_SNAPSHOT');
    exception
    when others then
    log_error('USRH_SNAPSHOT');
    end;
    Is there any reason why ORA-03113 doesn't behave as error when run from procedure?
    Is there any special way how to capture this error in the procedure?
    We found this error code only when we ran the command manually from SQL Developer.
    Thanx for help.

    $ oerr ora 3113
    03113, 00000, "end-of-file on communication channel"
    // *Cause: The connection between Client and Server process was broken.
    // *Action: There was a communication error that requires further investigation.
    //          First, check for network problems and review the SQL*Net setup.
    //          Also, look in the alert.log file for any errors. Finally, test to
    //          see whether the server process is dead and whether a trace file
    //          was generated at failure time.ORA-03113 likely means that corresponding Oracle session has crashed: in this case no exception handler can be called. You need to check this on database side.

  • No Data Found when Sum in Report is checked?

    Does anyone have an Idea why ora-1403 error occurs when you select sum a numeric column in report? It goes away when I deselect it. I have run several reports and this is the first time I experienced this in version 2.0.

    report error: ORA-01403: no data found when SUM columns
    This person has the Error also, any suggestions?? A Bug??

  • How can I save the first dept. for an employee in a transport table?

    Hi All,
    I have created a table to store the transports to an employee from department to another department.
    the first department number to every employee is stored at the parent table called employees.
    when I insert a new record to the transports table (which is the child for the parent employees) for an employee and the manager agrees for this transport the original value of department number in employees table will be changed to the new one. I done this process through a db trigger on the transport table.
    Now the problem is that the original value of the first department number will be lost cause of the db trigger that changes this value after manager agreement!
    I looked to solve the problem by adding a new column in employees table to save the first dept. no. for each employee only if Count of records = 1 for that employee like this:
    -- Before Update DB Trigger on Transports Table:
    DECLARE
    pragma autonomous_transaction;
    N NUMBER;
    BEGIN
    SELECT count(EMP_SID) -- emp-sid is the FK referenced from employeess.emp_sid
    INTO N
    FROM TRANSPORT_TRANS
    where emp_sid=:NEW.EMP_SID
    GROUP BY EMP_SID;
         IF :NEW.AGREE_FLG = 1 AND N = 1 THEN -- If the manager agrees and this record is the first one for that employee
         UPDATE EMPLOYEESS E
         SET E.FST_AD=E.ADMINISTRATION_SID, -- E.ADMINISTRATION_SID has the oroginal value for admin no. and FST_AD is the new column to save the first value
                E.FST_HE=E.HEADQUARTERS_SID,
                E.ADMINISTRATION_SID = :OLD.ADMIN_SID, -- changing the value with then new one added on the table
                E.HEADQUARTERS_SID = :OLD.HEAD_SID
               WHERE E.EMP_SID = :OLD.EMP_SID;
         ELSIF :NEW.AGREE_FLG = 1 AND N != 1 THEN -- if the manager agrees but the record is not the first record for that employee
         UPDATE EMPLOYEESS E
            SET   E.ADMINISTRATION_SID = :OLD.ADMIN_SID, -- only change the original  values
                     E.HEADQUARTERS_SID = :OLD.HEAD_SID
                     WHERE E.EMP_SID = :OLD.EMP_SID;
         END IF;
    END;But the form gives me this error if I deleted (pragma autonomous_transaction;) st. :
    ORA-04091: table transports is mutating, trigger/function may not see it
    But when I keep it, the form gives me this error:
    ORA-06519: active autonomous transaction detected and rolled back
    Edited by: Dev. Musbah on Aug 18, 2009 2:09 AM

    Dev. Musbah,
    First make sure that the insert statement executes. And check whether other error messages are getting. Currently you are checking only NO_DATA_FOUND. so change the exception part with
    EXCEPTION
         WHEN NO_DATA_FOUND THEN NULL;
         WHEN OTHERS THEN MESSAGE('Some Error Occured');Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • Problem when using utl.http package

    hello,as subject above,i have a problem with that package
    set serveroutput on
    DECLARE
    req   utl_http.req;
    resp  utl_http.resp;
    value VARCHAR2(32000);
    BEGIN
    req := utl_http.begin_request('http://www.psoug.org');
    resp := utl_http.get_response(req);
    value := utl_http.request('http://www.psoug.org/');
    dbms_output.put_line(value);
    utl_http.end_response(resp);
    EXCEPTION
    WHEN utl_http.end_of_body THEN
    utl_http.end_response(resp);
    END;
    i tried to create ACL
    BEGIN
    DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl         => 'www.xml',
    description => 'WWW ACL',
    principal   => 'SYSTEM',
    is_grant    => true,
    privilege   => 'connect');
    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl       => 'www.xml',
    principal => 'SYSTEM',
    is_grant  => true,
    privilege => 'resolve');
    DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(acl  => 'www.xml',
    host => '127.0.0.1');
    END;
    COMMIT;
    but it still show error
    Error report:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1722
    ORA-29270: too many open HTTP requests
    ORA-06512: at line 9
    *29273. 00000 - "HTTP request failed"*
    **Cause: The UTL_HTTP package failed to execute the HTTP request.*
    **Action: Use get_detailed_sqlerrm to check the detailed error message.*
    Fix the error and retry the HTTP request.
    Thank

    check
         Why ORA-29270 'Too Many Open HTTP Requests' occurs with UTL_HTTP? [ID 961468.1]
    The database server has a hardcoded limit of 5 open HTTP connections per session.

Maybe you are looking for