Call  a function inside a function..

Hi..!
I have a function with 3 insert statements. The steps are..
1. insert into tab1 values(X);
2.Call function b ( having 2 insert statements);
3.insert into tab2 values(y); (fail statement)
4.insert into tab3 values(z);
What happens if the 3rd insert fails ??? Any idea !!!

Homework ?
The answer depends on does function b commit transaction or not.
If not - all changes made in the function will be rollbacked, including
changes in function B (PL/SQL behavoiur).
If yes - only 3 and 4 steps will be rollbacked.
See example:
SQL> create table tab1 (id number primary key);
Table created.
SQL> create or replace procedure foo
  2  is
  3  begin
  4   insert into tab1 values(2);
  5  end;
  6  /
Procedure created.
SQL> create or replace procedure foo1
  2  is
  3  begin
  4   insert into tab1 values(1);
  5   foo;
  6   insert into tab1 values(1);
  7   insert into tab1 values(3);
  8  end;
  9  /
Procedure created.
SQL> select * from tab1;
no rows selected
SQL> exec foo1
BEGIN foo1; END;
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.SYS_C0011444) violated
ORA-06512: at "SCOTT.FOO1", line 6
ORA-06512: at line 1
SQL> select * from tab1;
no rows selected
SQL> create or replace procedure foo
  2  is
  3  begin
  4   insert into tab1 values(2);
  5   commit;
  6  end;
  7  /
Procedure created.
SQL> exec foo1
BEGIN foo1; END;
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.SYS_C0011444) violated
ORA-06512: at "SCOTT.FOO1", line 6
ORA-06512: at line 1
SQL> select * from tab1;
        ID
         1
         2 Rgds.

Similar Messages

  • Dynamically call different functions inside a function

    Hi there,
    I was wondering if it is possible to dynamically define the function that you want to call. Almost like passing the function name that i want to call as a parameter.
    I am calling a function, but do not want to hardcode the function I am calling. I have different functions that all return a boolean value, and i want to call all of them at different times through the same procedure/function.
    Is this possible???
    Thank you in advance!
    Tanja

    Or combine your functions to use function overloading, then you can use the same name...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace package mypk as
      2    FUNCTION gen_function (param1 IN NUMBER, param2 IN NUMBER) RETURN BOOLEAN;
      3    FUNCTION gen_function (param1 IN VARCHAR2, param2 IN VARCHAR2) RETURN BOOLEAN;
      4    FUNCTION gen_function (param1 IN BOOLEAN, param2 IN BOOLEAN) RETURN BOOLEAN;
      5    PROCEDURE test;
      6* end;
    SQL> /
    Package created.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace package body mypk as
      2    FUNCTION gen_function (param1 IN NUMBER, param2 IN NUMBER) RETURN BOOLEAN IS
      3    BEGIN
      4      RETURN (param1*2) = param2;
      5    END;
      6    FUNCTION gen_function (param1 IN VARCHAR2, param2 IN VARCHAR2) RETURN BOOLEAN IS
      7    BEGIN
      8      RETURN param1 = param2;
      9    END;
    10    FUNCTION gen_function (param1 IN BOOLEAN, param2 IN BOOLEAN) RETURN BOOLEAN IS
    11    BEGIN
    12      RETURN NOT(param1) = param2;
    13    END;
    14    PROCEDURE test IS
    15    BEGIN
    16      IF gen_function(1,2) THEN
    17        DBMS_OUTPUT.PUT_LINE('Test1: True');
    18      ELSE
    19        DBMS_OUTPUT.PUT_LINE('Test1: False');
    20      END IF;
    21      IF gen_function('Fred','John') THEN
    22        DBMS_OUTPUT.PUT_LINE('Test2: True');
    23      ELSE
    24        DBMS_OUTPUT.PUT_LINE('Test2: False');
    25      END IF;
    26      IF gen_function(TRUE,FALSE) THEN
    27        DBMS_OUTPUT.PUT_LINE('Test3: True');
    28      ELSE
    29        DBMS_OUTPUT.PUT_LINE('Test31: False');
    30      END IF;
    31    END;
    32* end;
    SQL> /
    Package body created.
    SQL> exec mypk.test;
    Test1: True
    Test2: False
    Test3: True
    PL/SQL procedure successfully completed.
    SQL>;)

  • Function inside a function

    Hi All,
    I have an outer function and an inner function. i want to execute both simultaneously by passing corresponding parameters. i am giving my outer and inner function below.
    outer function
    CREATE OR REPLACE FUNCTION OGRDS_USER.f_hier_browser (v_prnt_chr_val_id IN number) RETURN varchar2
    IS
    v_breadcrumb varchar2(200);
    BEGIN
    SELECT h.hier_name || ' > ' ||
    ltrim(sys_connect_by_path(*OGRDS_USER.f_val_dscr(21,he.prnt_chr_val_id,4)*,' > '),' > ') path
    INTO v_breadcrumb
    FROM hier_t h
    INNER JOIN hier_dscr_t hd
    ON  hd.hier_id = h.hier_id
    INNER JOIN hier_defn_t hdef
    ON  hdef.hier_id = h.hier_id
    INNER JOIN hier_elmnt_t he
    ON  hdef.hier_defn_id = he.hier_defn_id
    WHERE he.prnt_chr_val_id = v_prnt_chr_val_id
    START WITH hdef.prnt_chr_id = (SELECT mh.prnt_chr_id FROM hier_defn_t mh WHERE mh.hier_id = hdef.hier_id AND lvl = 1)
    CONNECT BY PRIOR  hdef.chld_chr_id=hdef.prnt_chr_id;
    RETURN v_breadcrumb;
    END f_hier_browser;
    inner funciton:
    CREATE OR REPLACE FUNCTION OGRDS_USER.f_val_dscr(v_lang_id    IN number,
                                                     v_chr_val_id IN number,
                                                     v_dscr_id    IN number) RETURN varchar2
    IS
    v_val_dscr varchar2(50);
    BEGIN
    WITH chld_lang
    AS
      (SELECT OGRDS_USER.GRD_GLOBAL_PKG.GRD_OGRDS_LANG_REL(v_lang_id) from dual)
    SELECT distinct
          CASE
             WHEN vcl.chr_val_dscr IS NOT NULL THEN
                  vcl.chr_val_dscr
             WHEN vpl.chr_val_dscr IS NOT NULL THEN
                  vpl.chr_val_dscr
             ELSE
                  cl.chr_val_dscr
          END text INTO v_val_dscr  
    FROM   chr_val_dscr_t cl 
    LEFT OUTER JOIN (SELECT chr_val_id, chr_val_dscr, lang_id
                     FROM   chr_val_dscr_t vpl,chld_lang
                     WHERE  vpl.chr_val_id  = v_chr_val_id
                     AND    vpl.lang_id = (SELECT OGRDS_USER.GRD_GLOBAL_PKG.GRD_OGRDS_LANG_REL(v_lang_id) from dual)
                     AND    vpl.dscr_id = v_dscr_id
                    ) vpl
    ON vpl.chr_val_id = cl.chr_val_id
    LEFT OUTER JOIN (SELECT chr_val_id,cd.lang_id,chr_val_dscr,dc.dscr_name,dl.dscr_lbl,cd.dscr_id
                     FROM chr_val_dscr_t cd,dscr_config_t dc,dscr_lbl_t dl
                     WHERE dc.dscr_id=cd.dscr_id
                     AND   dc.dscr_id = dl.dscr_id
                     AND   cd.chr_val_id = v_chr_val_id
                     AND   cd.dscr_id    = v_dscr_id
                     )vcl
    ON    vcl.chr_val_id  = cl.chr_val_id
    AND   vcl.lang_id = v_lang_id
    AND   vcl.dscr_id = v_dscr_id
    WHERE cl.chr_val_id  = v_chr_val_id
    AND   cl.dscr_id = v_dscr_id
    AND   cl.lang_id = 0;
    return v_val_dscr;
    end f_val_dscr;
    right now i am able to call the outer function by passing paramter like this.
    select ogrds_user.f_hier_browser(10002) from dual
    but the irony is, i am not able to change/pass the parameters for the inner function(f_val_dscr) when i call outer function.
    can anyone please help?

    Hi,
    In your scenario, the inner function is called with the values fetched from the SELECT statement.
    So we need not explicitly pass values to the parameters of inner function.
    If your requirement is to explicitly pass the values to the inner function along with the outer function, then you can add additional parameters in the outer function and pass them to the inner function like
    CREATE OR REPLACE outer_func(of_param1 number
                                                  ,of_param2 number
                                                  ,if_param1  number
                                                  ,if_param2  varchar2
                                                  ) AS
    BEGIN
    variable:= inner_func(if_param1,if_param2);
    ...Regards,
    Sreekanth Munagala

  • Calling a function inside a function

    How does one do that? I am trying to call function 1 inside function 2. What is the corrct syntax?

    If this post answers your question or helps, please mark it as such.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          private function callFuncs():void{
            one();
          private function one():void{
            txt.text += "In function one()\n";
            two();
          private function two():void{
            txt.text += "In function two()\n";
            three();
          private function three():void{
            txt.text += "In function three()\n";
        ]]>
      </mx:Script>
      <mx:Button label="Call Functions" click="callFuncs();"/>
      <mx:TextArea width="500" height="500" id="txt"/>
    </mx:Application>

  • Can't call a function inside another function

    Hello,
    i have the following function :
    FUNCTION test_day_week (P_DATE DATE)
    RETURN VARCHAR2 IS
    BEGIN
    RETURN TO_CHAR(P_DATE ,'DAY');
    END;
    --it returns the day name of a given date
    FUNCTION TEST_DAY_NUMBER (P_DAY_NAME VARCHAR2)
    RETURN NUMBER IS
         V_RESULT NUMBER;
         V_RETURN_DAY VARCHAR2(30);
         P_DATE DATE;
    BEGIN
    V_RETURN_DAY := test_day_week (P_DATE );
    MESSAGE('V_RETURN_DAY'|| V_RETURN_DAY);
    MESSAGE('V_RETURN_DAY'|| V_RETURN_DAY);
    IF V_RETURN_DAY = 'MONDAY' THEN V_RESULT :=1;
         END IF ;
    IF V_RETURN_DAY = 'TUSEDAY' THEN V_RESULT :=2;
         END IF ;
    IF V_RETURN_DAY = 'WENDSDAY' THEN V_RESULT :=3;
         END IF ;
    IF V_RETURN_DAY = 'THURSDAY' THEN V_RESULT :=4;
         END IF ;
    IF V_RETURN_DAY = 'FRIDAY' THEN V_RESULT :=5;
         END IF ;                
    IF V_RETURN_DAY = 'SATURDAY' THEN V_RESULT :=6;
    END IF ;
    IF V_RETURN_DAY = 'SUNDAY' THEN V_RESULT :=7;
         END IF ;
    RETURN V_RESULT;
    END;
    --The above function returnds the day name in numbers
    The proble is that when i call test_day_week function it returns no value even it is tested separatly and works fine don't know where is my problem :
    1-number of argrments in function[b] TEST_DAY_NUMBER
    ?? and so ..!
    Regards,
    Abdetu..

    You could also cut the whole thing down to a simple function... (assuming you have a need to customise your start of week rather than use built in date functionality)
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE FUNCTION test_day_week (P_DATE DATE) RETURN NUMBER IS
      2  BEGIN
      3    RETURN (INSTR('MONTUEWEDTHUFRISATSUN',TO_CHAR(P_DATE,'DY'))+2)/3;
      4* END;
    SQL> /
    Function created.
    SQL> select test_day_week(sysdate) from dual;
    TEST_DAY_WEEK(SYSDATE)
                         1
    SQL> select test_day_week(sysdate+1) from dual;
    TEST_DAY_WEEK(SYSDATE+1)
                           2
    SQL> select test_day_week(sysdate+2) from dual;
    TEST_DAY_WEEK(SYSDATE+2)
                           3
    SQL> select test_day_week(sysdate+3) from dual;
    TEST_DAY_WEEK(SYSDATE+3)
                           4
    SQL> select test_day_week(sysdate+4) from dual;
    TEST_DAY_WEEK(SYSDATE+4)
                           5
    SQL> select test_day_week(sysdate+5) from dual;
    TEST_DAY_WEEK(SYSDATE+5)
                           6
    SQL> select test_day_week(sysdate+6) from dual;
    TEST_DAY_WEEK(SYSDATE+6)
                           7
    SQL> select test_day_week(sysdate+7) from dual;
    TEST_DAY_WEEK(SYSDATE+7)
                           1
    SQL>

  • Calling a Procedure inside a Function

    How to call procedure within the function. please help

    I called the procedure as u said but it is firing.. please help me out.. here is the code.
    This code is to generate the SEquence ids.
    *********** Procedure ***************
    create or replace procedure ExecImmd
    is
    Begin
         EXECUTE IMMEDIATE 'DROP SEQUENCE emplseqid';
         EXECUTE IMMEDIATE 'CREATE SEQUENCE emplseqid START WITH 1001 INCREMENT BY 1';
    END;
    CREATE OR REPLACE FUNCTION GenCustId RETURN VARCHAR2
    IS
    VEMPID VARCHAR2(6);
    ISEQID NUMBER(5);
    P1 VARCHAR2(10);
    P2 VARCHAR2(10);
    BIND2 VARCHAR2(10);
    BEGIN
         SELECT MAX(SUBSTR(EMPID,1,2)) INTO P1 FROM EMPL;     
         SELECT EMPLSEQID.NEXTVAL INTO ISEQID FROM DUAL;
         IF ASCII(SUBSTR(P1,2,1)) < ASCII('Z') THEN
              IF ISEQID <= 9999 THEN
              bind2 := SUBSTR(P1,1,2) || ISEQID;
              ELSE
              /* here i am calling a procedure.
              ExecImmd();
              SELECT EMPLSEQID.NEXTVAL INTO ISEQID FROM DUAL;
              bind2 := SUBSTR(P1,1,1) || CHR(ASCII(SUBSTR(P1,2,1))+1) || ISEQID;
              END IF;
         ELSE
              if p1 is null then
                   bind2 := 'AA' || ISEQID;          
              else
                   IF ISEQID <= 9999 THEN
                   bind2 := SUBSTR(P1,1,2) || ISEQID;
                   Else
                   bind2 := CHR(ASCII(SUBSTR(P1,1,1))+1) || 'A' || ISEQID;          
                   End If;
              End If;
         END IF;
         return bind2;
         END;

  • Calling custom screen inside a function module

    This is regarding calling a screen as a pop up from a function module.How do I capture the values that would be entered in the fields of that pop up screen?Do I use ABAP memory or SAP memory or is there any other alternative?Please suggest.

    Hi savitha,
    When you create the Custom Screen, you can attach that custom screen to the main program of the function module itslef.
    The TOP Include variables can be used as screen fields and hence you don't need to store the data entered in the screen, anywhere else.
    The data will be readily available in the global variables itself in the whole function group..
    Thanks and Regards,
    Kunjal Patel

  • Calling a variable in one function from another

    Okay so here's the situation:
    I have a function that has a For Loop inside it.  Inside that For Loop I am defining a button and calling to another function if clicked.  The issue is (since I shouldn't put functions inside other functions) how do I get the variable being processed in the For Loop to be considered in the function that was just activated by pressing the button.
    lol sorry.  Here's the code.
    All variable are defined elsewhere in the code.
    function populateBox(DataInput:XML)
              linkAmount = DataInput.country[boxPartNum - 1].link.length(); /// defines amount of links being made
              for (k=0; k<linkAmount; k++)
                        myLink = new LinkClass();
                        box.boxMC.linksMC.addChild(myLink);
                        // set functions for links //
                        myLink.addEventListener(MouseEvent.CLICK, linkFunction);
    /// now the function for when the button is pressed ///
    function linkFunction(event:MouseEvent)
      trace(k);
    I need to trace the "K" used in teh For Loop.
    What are my options?

    IF they are movieclips then you can assign the k value as a property of them dynamically.  Then you can retrieve that value in your event handler via the event argument that gets passed to the function.
    function populateBox(DataInput:XML)
              linkAmount = DataInput.country[boxPartNum - 1].link.length(); /// defines amount of links being made
              for (k=0; k<linkAmount; k++)
                        myLink = new LinkClass();
                        box.boxMC.linksMC.addChild(myLink);
                        // set functions for links //
                        myLink.addEventListener(MouseEvent.CLICK, linkFunction);
                        myLink.kValue = k;
    /// now the function for when the button is pressed ///
    function linkFunction(event:MouseEvent)
      trace(event.currentTarget.kValue);
    Note:  I am not surewhen it's needed, but it is possible you will need to cast the event.currentTarget as a MovieClip, so the line in the function might need to be...
    trace(MovieClip(event.currentTarget).kValue);

  • How do i call a Function from another Function ?

    When i press a button, i want a series of functions to execute one after another (they contain tweens, but its irrelevant), each of them waiting for the previous to be completed. I want to put the series of functions inside one function, so i can call just this function to execute all the others. The animations are working fine, but i dont know how call Functions from within another function. Also it would be necessary each function to wait until the previous has completed, to execute. Here is a clear example of what i need to do:
    boton.onPress = animate ;
    Function animate () {
         animation1 (onComplete: animation2);
         animation2 (onComplete: animation3);
         animation3 ;
    Function animation1 () { Tween 1};
    Function animation2 () { Tween 2};
    Function animation3 () { Tween 3};
    any suggestions ?

    I'd do something like this:
    boton.onPress = animation1 ;
    Function animation1 () {
         var Tween1 = new Tween();
        Tween1.onComplete =  animation2;
    Function animation2 () {
         var Tween2 = new Tween();
         Tween2.onComplete = animation3;
    Function animation3 () {
         var Tween3 = new Tween();

  • Call a functions within a function ?

    Hi
    Is there anyway to call my functions within a function ?
    function musicPlayer() {
         trace("Music");
         function pauseMusic(){
              trace("Pause");
    if i call musicPlayer function i will get Music in output now how can i call pauseMusic from outside of parent function !?
    is this possible ?
    thanks in advance

    You can call functions within other functions, but you don't want define functions inside other functions... they will only have scope within the function if they work at all.
    function pauseMusic(){
         trace("Pause");
    function musicPlayer() {
         trace("Music");
         pauseMusic();
    musicPlayer();

  • Call Trusted function insidd another function.

    Note: - In simple word all i want to do is to use different functions inside a function to improve the speed of my script.
    i have been reading through Adobe document since last a few days, but couldn't find answer to use object name "getPageNumWords" inside my trusted function. adobe script just simply does not recognize "this" object when it is inside trusted function. I understand that i have to use some document object but how, i am not sure. can someone please help me with this issue.
    var mytestfunc = app.trustedFunction(function()
    app.beginPriv();
    apnumWords = this.getPageNumWords(1); //for page # 2
            for (var z = 0; z < apnumWords; z++)
                apWord = this.getPageNthWord(1,z);
                   if (apWord == "Model")
                app.alert("The text is " + myWordFound)
    app.endPriv();
    var myfunccheck = app.trustedFunction(function()
    mytestfunc();
    app.addMenuItem({cName:"AMM Linker",cParent:"Tools",cExec:"myfunccheck()"});
    reff
    http://acrobatusers.com/forum/embeded-trusted-functions-function-embeded-functions#comment -71413

    i got it thanks, now how my function can through a value and how can my other function accept the value.
    in simple function 1 & 2 through a value and function 3 uses them to create a link.
    app.addMenuItem({cName:"Linker",cParent:"Tools",cExec:"mycheck_3()"});
    function mycheck_3 (doc)
    //my function mycheck_3 is creating link.
    //i want to use these key words to create link around my subject.
    apWord_mycheck_1 + apWord_mycheck_2)
    function myfinalfunction()
    app.trustedFunction(mycheck_1(this));
    app.trustedFunction(mycheck_2(this));
    app.trustedFunction(mycheck_3(this));
    function mycheck_1 (doc)
    var apWord_mycheck_1, apWord2, apnumWords;
        apnumWords = doc.getPageNumWords(1);
            for (var z = 0; z < apnumWords; z++)
                apWord_mycheck_1 = doc.getPageNthWord(1,z);
                if (apWord_mycheck_1 == "Model_1")
    //how to through out apWord_mycheck_1 ?????
    function mycheck_2 (doc)
    var apWord_mycheck_3 =
    function mycheck_2 (doc)
    var apWord_mycheck_2, apWord2, apnumWords;
        apnumWords = doc.getPageNumWords(1);
            for (var z = 0; z < apnumWords; z++)
                 apWord_mycheck_2 = doc.getPageNthWord(1,z);
                if (apWord_mycheck_2 == "Model_2")  
    //how to through out apWord_mycheck_2 ?????

  • Is it possible to call a adobe form inside a function module?

    Hi gurus,
    i am trying to generate the pdf data source inside a custom function module,
    the function module will call the FUNCTION 'FP_JOB_OPEN' , then call the function module of the pdf interface. then get the pdf data back and return.
    but at run time i got the error message:
    FPRUNX101, the job already started.
    then the program stopped.
    i checked the service market place, there is a note for that:858325 Message "Job already started" when you display PDF forms .
    according to the notes,it seems that it's only possible to call the pdf generated function module in a program.
    my question is , is there a way to call that in a funciton module?
    best regards.
    Jun
    the note states that:
    Reason and Prerequisites
    At runtime, a PDF-based form is called using a generated function module. If you use the new interface, it is necessary to set the function modules FP_JOB_OPEN and FP_JOB_CLOSE as control structures with one or several generated function modules. In order for the single test from Transaction SFP to work simultaneously, however, the system checks for the test environment of Transaction SE37 (in which the test ultimately runs) in the single test. In this case, the function modules FP_JOB_OPEN or FP_JOB_CLOSE are called automatically.
    If you then test a function module that calls a PDF based form and therefore calls the function module FP_JOB_OPEN itself, this leads to the error message mentioned above.
    Solution
    The test should be carried out using a program that in turn calls the function module to be tested.

    sorry, i found out the reason.
    the fm can not test direct in se37, it should be wrapped by a program.
    br.
    zj

  • Calling a function inside a symbol?

    Hi there,
    I'm one of those flash-devs that are trying to get Edge Animate to do what I usually do in Flash, so I might be doing this the wrong way, but I've got a symbol with a function "inside" on my stage, and I wanna call that function from the stage.
    I've been trying to use sym.getComposition().getStage().getSymbol("symbolName").functionName(); but it doesn't work.
    I don't have any problems manipulating the symbol itself by calling .play() or .hide() so I know the path works....can anyone show me the right syntax to call a function inside a symbol?
    Thx in advance

    Hi Abnesher,
    An important principle to grasp is that symbols (and the stage is one of them) lies in parallel, despite the fact of instances of different symbols being nested one in another (and all in fine nested in the stage).
    The consequence is that from inside your nested symbol you have no direct visibility of the function defined inside the stage symbol !
    Inside the Stage symbol, in the document.compositionReady event handler :
    sym.yourGlobalFunction = function( firstParameter)
      // your stuff
    Inside another symbol, in one of its events handlers :
    sym.getComposition().getStage().yourGlobalFunction( 5);
    Gil

  • Calling a package function inside a sql

    Hi friends!!!
    First of all happy Christmas! And them please help! :)
    We have a query calling a package function:
    SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR ('0000000000000000');There is a primary key just with one column DW025H_NR and the problem is that is not accessing by INDEX UNIQUE SCAN,
    it's accessing by TABLE ACCESS FULL.
    May be the problem is that we are calling a procedure inside the query?
    I have been able to run that query accessing by primary key from my computer but a workmate hasn't!
    We both are connecting the same data base 10.2.0.4 and using Oracle SQL Developer!
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 5343K| 1406M| 15670 (7)| 00:02:43 |
    |* 1 | VIEW | DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
    |* 2 | FILTER | | | | | |
    | 3 | TABLE ACCESS FULL| DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
    Predicate Information (identified by operation id):
    1 - filter("DW025H_NR"="MPPCI"."ENCRIPTAPAN"('0000000000000000'))
    2 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
    SYS_AUDIT('OPS$SISINFO','DW025H','CMINFOGR001',3) ELSE NULL END IS
    NULL)
    The correct path would be:
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 276 | 3 (0)| 00:00:01 |
    |* 1 | FILTER | | | | | |
    | 2 | TABLE ACCESS BY INDEX ROWID| DW025H | 1 | 276 | 3 (0)| 00:00:01 |
    |* 3 | INDEX UNIQUE SCAN | PK_DW025H | 1 | | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
    SYS_AUDIT('OPS$SISINFO','DW025H ','CMINFOGR001',3) ELSE NULL END IS NULL)
    3 - access("DW025H_NR"="MPPCI"."ENCR"('0000000000000000'))
    Please any ideas!?!?!
    Thanks a lot!
    José
    Edited by: jamv on Dec 20, 2011 10:50 AM

    Hello
    Have a read of this and try to pull together the information in it and post it up here. That will help immensely with getting to the root of your problem...
    HOW TO: Post a SQL statement tuning request - template posting
    In the mean time:
    From the execution plan you have extra predicates that aren't present in the query you supplied, so that's either not the SQL or you have something like VPD switched on.
    Anyway, there could be lots of reasons for the difference in execution plan. Sorry if this is very basic and possibly patronising question but it's always worth checking the basics I think - are you both definitely connecting to the same database? If so, have a look in v$sqlarea for this SQL statement and find the SQL_ID, use this to query v$sql and look at the child_number column.
    select
        sql_id
    from
        v$sqlarea
    where
        sql_text like '%SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR%(''0000000000000000'')%'
    and
        sql_text not like '%v$sqlarea%'
    select child_number from v$sql where sql_id='<enter the sql id returned by the query above>'as an example...
    XXXX> select /* my sql statement*/ rownum id from dual;
            ID
             1
    1 row selected.
    Elapsed: 00:00:00.10
    XXXX> select sql_id from v$sqlarea where sql_text like '%my sql statement%'
    and sql_text not like '%v$sqlarea%';
    SQL_ID
    a6ss4v79udz6g
    1 row selected.
    Elapsed: 00:00:03.56
    XXXX> select child_number from v$sql where sql_id='a6ss4v79udz6g'
      2  /
    CHILD_NUMBER
               0
    1 row selected.   If you have more than one row in v$sql there could be differences in the optimiser environment. The supplied like shows you how to gather the information that should help find what the differences are if any.
    Also as a side note if you're calling PL/SQL functions from SQL, you can take advantage of subquery caching to help reduce the number of calls (depending on your version). As it stands, your function is most likely going to be called for every row - when there is only a single row returned, that's not necessarily a problem but for multiple rows, the overhead can quickly grow. If there's no way to get rid of the function call, select the function from dual instead i.e.
    SELECT * FROM DW025H WHERE DW025H_NR= (SELECT MPPCI.ENCR%('0000000000000000') FROM dual);This also (as I learnt a couple of weeks ago) works when you're using columns in the table your selecting from as parameters to the function.
    HTH
    David

  • How to call a function inside a class? 

    Hello, i am trying to fire a function onPress .. this
    function is inside a class.
    In this function i refer to another function inside the calss
    to call a Tween. It never arrives in the second function.
    I tried to make an example.
    In the fla file i have:
    var test:makeMovie = new makeMovie(this);
    You will see a red squere and you can press on it. It should
    run the tween class. Am i using the delegate class wrong?

    I always have to use test movie and trace a couple of times
    each time I start to use Delegate.
    It wraps function.apply I think, which I tend to use more
    often.
    try using:
    Container.onPress = Delegate.create(this,setAlpha);
    and then just
    setTween()
    inside your setAlpha....
    That's conceptually how I think I would try it above if I was
    doing something similar.
    I'm not sure it would have the desired effect even if the
    delegate was executed as you have it coded. Unless you want
    setTween's execution scope to be the Container clip in which case
    you might need to do what kglad said and change the Container
    reference to 'this'.
    The way you have it at the moment inside setAlpha the
    Delegate.create is simply creating a function...and not excuting
    it.
    its like : function something(){trace('what')}
    and not like : something();
    Below is some quick code that helps show how things work.
    Notice that I assigned the delegate function to mainFunc....so that
    along with the last example might provide a clue. Just paste it on
    a frame and take a look at what's happening.

Maybe you are looking for

  • Is it possible to install Mac OS X 10.5.x Leopard on a new MacBook ?

    I newly purchased a MacBook (White) where it comes with OS X 10.6.4 by default. Is it possible for me to install another OS X 10.5.x if I have an original MacBook (White) OS X Leopard Installation DVD ?

  • BT Infinity 2 Speed dropped and now doesn't recove...

    I've had BT Infinity 2 for a couple of years now and it has been working flawlessly. I use a Fritz!Box 7390 router and have had no problems at all with it. That is until mid-January 2014 when I noticed by connection speed dropping down to less than 4

  • Differences between Discoverer and BO

    Hi there, Thanks for all your helping and sharing ideas and thoughts. Can anyone knows basic differences between ORacle discvoerer and BO, Crystal Reports, Hyperion, Microsoft SSRS,why we use and which one is best (advantages and features etc) that w

  • Blank  entry date S_AHR_61016362 - Flexible Employee Data

    Good day all, i know that there are a lot of posts refering to 0041 but none of the suggestions have solved my problem so please help me. 1. we are currently on ECC6 2. the entry feild in S_AHR_61016362 returns 00.00.0000 when i select "today" but is

  • Oracle XTags?

    Is anyone aware of a Java taglib similar to Jakarta's XTags but uses Oracle's parser rather than DOM4J? For those that are not familiar, XTags encapsulates useful logic for parsing XML, iterating nodes, retrieving values, and performing conditional l