Need to perform validations across the Regions in OAF

Hi
There are 4 regions in a seeded page. The hierarchy is like below.
Region_1
---------> Item_1
********Region_2
********--------> Item_2
********Region_3
********--------> Item_3
Region_4
---------> Button_1
NOTE: Region_2 and Region_3 are under Region_1
I have separate controllers for each and every region.Now the requirement is when i click on Button_1 i have to perform some validation by fetching the values of Item_2 from Region_2 and Item_3 from Region_3 and should throw some exception. How i will be able to achieve it?
I tried the following code in Button_1 controllers ProcessFormRequest() method.
ProcessFormRequest()
if(pageContext.getParameter("Button_1") != null)
OAMessageTextInputBean textItem = (OAMessageTextInputBean)webBean.findChildRecursive("Item_2");
System.out.println("Value is "+textItem.getValue(pageContext));
I am getting Null Pointer Exception on the 2nd line (S.O.P line) but the item is having value. Also i noticed one thing. The if condition which i have written is getting executed only if click twice on the Button_1.
Kindly let me know how i can achieve it. Your inputs are much needed.
Thanks

Pratap
I am very happy about one thing. You got my requirement exactly.
ButtonRN is the top most region in the page which is having the "HrNext" button. Item1_RN and Item2_RN are one level below the ButtonRN and they are having Item1 and Item2 respectively. Item2_RN is the last region in that page.
The controller for ButtonRN, Item1_RN and Item2_RN are CO_1, CO_2 and CO_3 respectively.
Below is the code which i am referring to.
Extended CO_2
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
OAMessageTextInputBean mesBean = (OAMessageTextInputBean)webBean.findIndexedChild(webBean,"HrWorkHours");
String hoursWorked = (mesBean.getValue(pageContext)==null)?"-1":mesBean.getValue(pageContext).toString();
pageContext.putSessionValue("sessionHoursValue",hoursWorked);
I have created a session variable and assigned the value
Extended CO_3
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
OAApplicationModule am=pageContext.getApplicationModule(webBean);
if(pageContext.getParameter("HrNext") != null)
String sessionHoursValue = (( pageContext.getSessionValue("sessionHoursValue"))==null)?"-1":pageContext.getSessionValue("sessionHoursValue").toString();
OAMessageChoiceBean inpBean = (OAMessageChoiceBean)webBean.findIndexedChild(webBean,"HrEmpCategory");
String newVariable = (inpBean.getSelectionValue(pageContext)==null)?"-1":inpBean.getSelectionValue(pageContext).toString();
throw new OAException ("Test Exception - Session Value is "+sessionHoursValue+" Bean Value is "+newVariable);
super.processFormRequest(pageContext, webBean);
After migrating this code, if i click on "HrNext" button i am getting an error.
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
*## Detail 0 ##*
java.sql.SQLException: Missing IN or OUT parameter at index:: 1
I found that the query belongs to a VO which is not used anywhere in that page. It is just attached to the corresponding AM.
My point is if it identifying the "HrNext" event why it should try to execute this VO ? Hope you got some more insight on this issue.
Out of all these things i am bit worried whether i will be able to get handle for an item which is in a outside region. i.e if i am able to get the handle for item2 in item1_RN then my issue will be resolved. Any idea on that ?
Thanks,
Praveen

Similar Messages

  • Enabling PPR Event across the regions

    Hi All
    I dearly need all your thoughts on the following requirement.
    I have 2 items in 2 different regions referring to different CO's. For instance, first region is having a text item and the second region is having a MessageChoice item. Now if i change the value of the first item eventually the value in the second region's messageChoice item should be populated. How can i enable PPR event across 2 items referring to different COntroller files. Any input on this will help me a lot for proceeding further.
    Thanks
    Praveen

    You can use the pageContext.putSessionValue and getSessionValue to get the value.
    Yes you can change the parameter pass to a pass. In the Controller you can call the page with the help of pageContext.setForwardUrl.
    You can just check the condition like on the basic of some condition like If A then code will execute [[With 1 parameter]] else another code will execute [[with 2 parameter]]
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I have just bought an old ibook g3 and i need a code to change the region on the dvd drive . how can i get this ?, i have just bought an old ibook g3 and i need a code to change the region on the dvd drive . how can i get this ?

    i do not know the code to change the region on the dvd drive and it is stuck on region 1 and i need to change it to region 2. i am using an old ibook g3 , can any one help with the code

    You must have a G4 iBook as the G3 models can only install up to 10.4.11.
    Some links to read for possible help.
    https://discussions.apple.com/message/759882#759882
    https://discussions.apple.com/message/5083031#5083031
    https://discussions.apple.com/message/20461888#20461888

  • Using a bean method to perform validation via the validator attribute

    The J2EE tutorial demonstrates a method to perform validation by adding a FacesMessage directly into the FacesContext ... INSTEAD OF throwing a ValidatorException within the method:
    http://docs.oracle.com/javaee/6/tutorial/doc/bnavb.html#bnave
    http://docs.oracle.com/javaee/6/tutorial/doc/bnatn.html#bnatr
    What is NOT mentioned in the tutorials is that, if you simply add a FacesMessage into the FacesContext, the JSF lifecycle UPDATE_MODEL and INVOKE_APPLICATION are still executed even if the validation fails, which is probably not what one intends to happen if the validation fails.
    Instead of simply adding a FacesMessage into the FacesContext, the method performing the validation should instead throw a ValidatorException(FacesMessage) or ValidatorException(Collection<FacesMessage>), so that the UPDATE_MODEL and INVOKE_APPLICATION are NOT executed and you go directly to RENDER_RESPONSE if the validation fails.
    Does anyone see any reason why the tutorial would add the FacesMessage into the FacesContext instead of throwing a ValidatorException ?

    gimbal2 wrote:
    The whole intention of that section seems to be to give an alternative to using a validator. Its the type of validation I tend to use to be honest since I find it the least cumbersome. I agree with you on this one.
    gimbal2 wrote:
    I've hardly ever had any trouble with the extra phases happening... but .. isn't the whole point of PROCESS_VALIDATION lifecycle is to prevent updates to the model when the validation fails ... to skip straight to RENDER_RESPONSE ? I just don't see the point of having the validation failing ( by showing an error to the user ), and yet allowing the "illegal" value updated on the model / bean.
    On a different matter ... I am still not sure how the JSR-303 validation fits in to the JSF lifecycle with regards to updating the model / bean. If you were using JSR-303 validations WITHOUT JSF, like so:
    ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
    Validator validator = factory.getValidator();
    Set<ConstraintViolation<Bean>> constraintViolations = validator.validate(bean);.. the bean would have been updated already with the "illegal" values for the JSR-303 validation to work / "detect" that validation fails. Now going back to JSR-303 with JSF, that would suggest that model gets updated before the validation takes place ( to mimic the non-JSF validation above ) ... but that can't be the case as nowhere in the JSF / J2EE documentation ( unless I missed it ) that says that UPDATE_MODEL takes place before PROCESS_VALIDATION only if JSR-303 is used. The JSF lifecycle diagrams always say PROCESS_VALIDATION takes place before UPDATE_MODEL, and only if validation succeeds.
    On the other hand, JBoss' <rich:graphValidator> is clearly documented so that it actually clones the bean and then updates the properties on the clone of the bean, not the bean itself. Hence, the bean must implement the Cloneable interface. ( http://docs.jboss.org/richfaces/4.2.X/4.2.2.Final/Component_Reference/en-US/html/chap-Component_Reference-Validation.html#sect-Component_Reference-Validation-richgraphValidator ). Okay, that link is saying that the use case for <rich:graphValidator> is for cross-field validation, but at least it documents that the model is not updated.

  • HELP! Need a copy/pic of the regional calling map for FL

    I signed up for the Regional Essentials Package so i can take advantage of Fios internet. I cannot find anywhere on line that shows the regional calling map for Florida (or any other area for that matter). Does the regional calling coverage cover the entire state, a portion of the state or what?
    I keep ebing directed to the consumer guide in my phone book, that issue is two fold-who has a phone book any more?! And...we have one at work and there isn't a map to be found.
    Thank you!

    Your talking to peers.  Note I can't even locate your plan.  The essential plans i do find are apparently not your as they include unlimited nationwide phone service.
    Try looking under your "my verizon" to see if you can give you details.

  • I competed updating my ipad2 to ios6. I have 11 apps which has updates I need to perform. But, the procedures of 'agree' and update keep going in a loop and I was not able to update any of the 11 app I need to update. Why the up date procedures keep loopi

    I completed updating my iPad2 to ios6. I hv 11 app which need to be updated and these are flagged. But the updating procedures keep looping itself and I was not able to update any of the 11 app.? Why the update procedures keep looping and how to get out of it.

    Okay - let's cut to the chase...
    If the Menu Bar (File, Edit... Help) shown in my screenshot below is not visible, use CTRL+B to display it. Then click on Help/Check for Updates. If one is available, you will be able to select it at this time.
    Note the item at the bottom of the list; About iTunes. Selecting that will show you which version of iTunes you are using.
    An alternative method to display the Menu Bar is click on the box in the top left of your iTunes window...

  • ZTable new entries need to be validated

    hi,
    Ztable new entries need to be validated.Only the F4 help value should be populated in fields.Few fields are not bringing the F4 help.And when I am trying to save any random data into the field,its saving in the ztable.
    i want ONLY F4 HELP values to be saved into the ZTABLE.
    Please advice.

    Hi,
    1. For Possible entries :
       Create the foreign key relationship for the fields in the custom table.
    2. For Other validations againt the data entered for the field.
    You have to Generate the table maintenance for this custom table in SE11.
    After generating the table maintenace for this table there will be a program name
    and screen number for this table.
    The program name can be identified after running the maintenance generator.
    System->Status->Program(screen)
    System->Status->Screen number
    The program will be generated with SAPLZXXXXXXX
    For eg :
    Function group : ZEURMM000
    Program name   : SAPLZEURMM000
    Screen number  : from the table maintenance generator
    You can find the PAI of for this table.
    Write new module between chain and endchain statement.
    CHAIN.
        FIELD ZMM001-ZPLANT .
        FIELD ZMM001-ZDES .
        MODULE get_Zdes.            "Added new code
        MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
    ENDCHAIN.
    MODULE get_zdes iNPUT.
    data : lv_zdes type ZMM001-ZDES.
      CLEAR ZMM001-ZDES.
      SELECT SINGLE zdes
         INTO lv_ZDES
         FROM CHECK_TABLE  "The values needs to be validated
         WHERE  PLANT = ZMM001-ZPLANT
            AND ZDES = CHECK_TABLE-ZDES.
    if sy-subr <> 0.
    message.
    endif.
    ENDMODULE.                 " GET_CARNO_DES  INPUT
    All the User PAI statements can be performed in the subrouine LZEURMMXXXO01 of the generated program SAPLZEURMM000.
    Best Regards,
    Senthilraj Selvaraj

  • Sync files across the Managed Server.

    We have exploded war deployed in the Weblogic Cluster and in this there is a feature which would create a zip file in the exploded folder and this zip file will be downloaded through the URL. Now the problem in clustered environment is when the application write the zip file which will be available in only one of the managed server and when we try to download the zip file through the LoadBalancer URL it may not hit the same Managed Server in which the zip file is available.
    Is there a way in weblogic cluster to sync the files across all the managed server so that we can access the file through loadbalancer.

    Hi Suresh
    1. Your issue has nothing to do with the cluster setup and the way you deploy the application (as EAR or Exploded). Basically in your application, you generate a file and automatically that gets stored in that machines location. Now when you access it from a load balancer, the request may go to other machine and naturally it will not find the file there. There is nothing in the cluster setup or something that can copy the files and replicate acorss the machines. Infact that will be way too complex. I will couple of solutions.
    2. Create a shared folder like public folder. Say in Windows, create a folder with some folder structure and map it as say X: Drive. now this X Drive can be accessed from any other machine like Machine1, Machine2 (after setting the sharing properties). First try directly from Windows Explorer itself. Now within your application, when you generate and store the file, refer this X: Drive with full path. You can make it more flexible by using a .properties file that has key value pair. Key is like FILE_LOCATION and value can be like X:\a\b\c. Now using simple Java Properties class API to load the contents from this file. You can add all the constants, check for if .properties file exist like that. Once you have all the properties loaded, then refer this key, to get its value and use that to store the file generated. Use the same approach, while retrieving the file also. Use the key to get the location and then look for the file you want to download. This should work, when the request goes to any managed server in the cluster. I used it. I created a utility class like MyAppPropertiesLoader, with some static methods, that reads the file only once, if it is null, and then get values using simle methods like getString(String aKey), getLong(String aKey) etc. The huge BENEFIT of this is, once you deploy the application say in Unix, natually, the shared location has to be one of the unix boxes. Then just mount this location on both the managed servers (mount is similar to mapping a drive in Windows OS). Also the location of the files can be changed anytime in the properties file. Say in QC, the location may be X:\a\b\c\qc. But for UAT on Unix it can be like /x/y/z/uat/. Now this .properties file can exist directly under the Domain root folder so you can access it directly without any path in your java code. You can also use System properties like user.home etc. Make sure to copy this .properties file on both the domains. The original master domain. And the psueduo domain that is generated when you run the unpack command if you have managed server in another machine.
    3. This is much simpler but kind of not recommended. Simply, create a simple table with few header columns and one BLOB/CLOB column. Store the file in this database table and retrieve from it. This means you will have JDBC code, and the code to create clob to store and generate file from clob for retrieval.
    My preference is the first option given above. Getting tools to copy files may be complex. Its not like syncing the data across but its the files that needs to be copied across the machines.
    Thanks
    Ravi Jegga

  • Need data retrieval recommendations for the UK only please

    Hey folks.
    I just wanted to say that I had a problem with strange sounds off my hard disk, the lengthy restarts and problems waking up the computer after battery being empty and finally my hard disk died completely.
    With 17 months under its belt this Hitachi 80GB hard disk ought not to have died but this happens. Sadly I was ABOUT to back up (isn't that always the way?) but had not managed (due to the problems) and so lost some EXTREMELY valuable data. ie photos (numbering 400 and about 600 others) of my grandfather who was taken into hospital for heart failure aged 91 on the VERY SAME DAY.
    Now- I am NOT letting this hard disk go. I have been told by the kind but very slow (Apple took over a fortnight to send them a replacement disk and they had it for 16 days in the end- I went mad) folk who repaired it, it is the mechanism which failed and not the platters which melted or otherwise warped.
    So- this means that the chances of data retrieval are high. BUT- I have had one quote from the firm they recommended and was told it could be as much as £1,300 on the slowest service. Now, as you will appreciate, there IS no value which can be placed on such precious things as memories of a loved one but SURELY there is a chance that someone here has knowledge of a more- erm- cost efficient method?
    LOOOOONG story short: Can you recommend anyone in the UK area who does a good job retrieving data from what has been deemed a high probability recovery?
    Anything I need to know about the subject? All I can tell you is that this WILL involve removing the platters from the mechanism and placing them to another, functioning one with the probability of needing to back up in the region of 20GB.
    Your help in this is so very gratefully received. I am thankful you users are here to hold my hand on this.

    Posted this under the correct header as well- 15 Powerbook. Resolved it myself- went on the net and just picked one. Was semi-successful and if you are needing info check it out- I have explained this there.

  • Which two operattions do you need to perform after restoring---QNo.106

    In your database, all the tablespace are locally managed. You started RMAN using recovery catalog and restoring the contol file by using the following command:
    RMAN>RESTORE CONTROLFILE;
    which two operations do you need to perform after restoring the control file from backup?(choose two)
    A. shut down and restart the instance
    B. add new tempfiles to the temporary tablespaces after recovery
    C. perform a media recovery and open the database with the RESETLOGS option
    D. perform a media recovery and bring the database to NOARCHIVELOG mode

    This question is a little ambiguous.
    C is a correct answer when restoring a control file
    http://download-east.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta051.htm#BGBJJGCB
    Restrictions and Usage Notes for RESTORE CONTROLFILE
    After you restore a backup control file, you must run RECOVER DATABASE and then open the database with the RESETLOGS option.
    B. If you were restoring a database from a backup you would need to create the temp files because temp files are not backed up.

  • Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset pref

    Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset preferences and still have problem. Slow to open and in force quit "Photoshop not responding" At this point should I uninstall and start over.

    What are the performance Preferences?

  • My Photoshop CS 5 has some strange actions when I copy a portion of a photo using the clone stamp  to transfer to another part of the image. It carries the entire layer (not just the stamps selection) across the screen and I cannot place it where I need t

    My Photoshop CS 5 has some strange actions when I copy a portion of a photo using the clone stamp  to transfer to another part of the image. It carries the entire layer (not just the stamps selection) across the screen and I cannot place it where I need to. It appears as if I selected the entire layer on purpose (which I did not)
    The below items appeared when I opened Photoshop CS 5:
    “Photoshop has encountered a problem with the display driver and has temporarily disabled G & U enhancements. Check the video card malfunctions website for latest software. GPU enhancements can be enabled in the performance panel of preferences.”
    (I believe this started after the automatically updated Windows was applied. It was coincident with the before mentioned problem . . . but I don’t really know if it had anything to do with it. )

    For the Clone Stamp problem, check the Clone Source panel and Clipped is probably unchecked.
    If so, check Clipped and see if that makes a difference.
    (Window>Clone Source)
    As to the video card problem:
    Which version of windows are you using?
    What is the make and model of your graphics card?
    Do you know which update windows installed?

  • Need Help :: Perform Attribute Level Validation

    Hi Frds,
    In oaf How to perform Attribute level Validation ?
    How to compare the two attribute values ?
    My requirement is , I have Amountfrom and Amountto items in Table region having 10 records.......
    here the validation is Amount to should be greater than Amount From, so for this I have to perform validation in EOImpl class..........
    For this  i have to read AmountFrom value and compare with AmountTo.....
    here my issue is, how to  read the AmountFrom value....
    Its urgent..........
    Plz...Give ur valuable suggestions......
    Thanks ,
    Jaya

    Hi,
    You can write this logic in validateEntity() method of EOImpl.
    In EOImpl, there should be methods to get those values like getAmountFrom() and getAmountto().
    --Sushant

  • 1 year ago i installed Elements 12 on my PC with a serial number.  Today i have installed Elements 12 also on my laptop. But,...there is a problem with validation of the serial number on my laptop. Is there a need to validate Elements  or will this progra

    One year ago i installed Elements 12 on my PC with a serial number and it was OK.
    Today i have installed Elements 12 also on my laptop.
    But,...there is a problem with validation of the serial number on my laptop. Is there a need to validate Elements  or will this program real disapeare in 7 days?
    Hans

    Hi,
    Since you already have one copy activated the serial number must be logged in your account details - I would first check that the one logged and the one you are attempting to enter are the same.
    You can check your account details by going to www.adobe.com and clicking on Manage Account. You need to sign in with your Adobe Id and then click on View All under Plans & Products. Next click on View your products and after a while it should produce your list.
    If there is a problem with the serial number, only Adobe can help you there (we are just users). Please see the response in this thread
    First of all, I would have to say that getting in touch with you is a nightmare and I am not at all happy that I can't just email or live chat with someone who can help!  I am not a technical person, I just want to be able to use Photoshop Elements and ge
    Brian

  • Need Help to see why the performance is not good

    Hi,
    We have an application that all process are developed in PL/SQL on Oracle 9i Database :
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    PL/SQL Release 9.2.0.6.0 - Production
    Why I have created this package. the application is a production management on chemical industries. I need to sometimes trace the Manufacturing order execution to eventually answer some incoherent data. If I analyze directly the data in the Table is not always responding because the origin of problem can be provide of some execution that perform some calculation.
    In the procedure or function a use my package PAC_LOG_ERROR.PUT_LINE(xxxxxx) to save the information. This command save the information in the memory before. At the end of the procedure or function a perform the insert with the COMMIT calling PAC_LOG_ERROR.LOGS or PAC_LOG_ERROR.ERRORS on the catch exception.
    This package is always call. On each routines performed I execute it. In the trace log of the database we have see a problem we the procedure GET_PROC_NAME in the package. We have identify that is called more that 800x and increase the performance. Who increase is this select command :
        SELECT * INTO SOURCE_TEXT
        FROM (SELECT TEXT FROM all_source
            WHERE OWNER = SOURCE_OWNER AND
                  NAME=SOURCE_NAME AND
                  TYPE IN ('PROCEDURE','FUNCTION','PACKAGE BODY') AND
                  LINE <= SOURCE_LINE AND SUBSTR(TRIM(TEXT),1,9) IN ('PROCEDURE','FUNCTION ')
            ORDER BY LINE DESC)
        WHERE ROWNUM = 1;I use it to get the procedure or function name where my log proc is called. I now that I can pass in parameters, but I have think to use an automatic method, that can help to not have some problem with others developer team to make a copy/past and not update the parameters. Because the Log info is read by the Help Desk and if we have an error on the information, it not a good help.
    COULD YOU PLEASE HELP ME TO OPTIMIZE OR SAID THE BETTER METHOD TO DO IT ?
    Here my package :
    create or replace
    PACKAGE PAC_LOG_ERROR AS
    -- Name         : pac_log_error.sql
    -- Author       : Calà Salvatore - 02 July 2010
    -- Description  : Basic Error and Log management.
    -- Usage notes  : To active the Log management execute this statement
    --                UPDATE PARAM_TECHNIC SET PRM_VALUE = 'Y' WHERE PRM_TYPE = 'TRC_LOG';
    --                COMMIT;
    --                To set the period in day before to delete tracability
    --                UPDATE PARAM_TECHNIC SET PRM_VALUE = 60 WHERE PRM_TYPE = 'DEL_TRC_LOG';
    --                COMMIT;
    --                To set the number in day where the ERROR is save before deleted
    --                UPDATE PARAM_TECHNIC SET PRM_VALUE = 60 WHERE PRM_TYPE = 'DEL_TRC_LOG';
    --                COMMIT;
    -- Requirements : Packages PAC_PUBLIC and OWA_UTIL
    -- Revision History
    -- --------+---------------+-------------+--------------------------------------
    -- Version |    Author     |  Date       | Comment
    -- --------+---------------+-------------+--------------------------------------
    -- 1.0.0   | S. Calà       | 02-Jul-2010 | Initial Version
    -- --------+---------------+-------------+--------------------------------------
    --         |               |             |
    -- --------+---------------+-------------+--------------------------------------
      PROCEDURE INITIALIZE;
      PROCEDURE CLEAN;
      PROCEDURE RESETS(IN_SOURCE IN VARCHAR2 DEFAULT NULL);
      PROCEDURE PUT_LINE(TXT IN VARCHAR2);
      PROCEDURE ERRORS(REF_TYPE IN VARCHAR2 DEFAULT 'SITE', REF_VALUE IN VARCHAR2 DEFAULT '99', ERR_CODE IN NUMBER DEFAULT SQLCODE, ERR_MSG IN VARCHAR2 DEFAULT SQLERRM);
      PROCEDURE LOGS(REF_TYPE IN VARCHAR2 DEFAULT 'SITE', REF_VALUE IN VARCHAR2 DEFAULT '99');
    END PAC_LOG_ERROR;
    create or replace
    PACKAGE BODY PAC_LOG_ERROR
    AS
      /* Private Constant */
      CR    CONSTANT CHAR(1)  := CHR(13);  -- Retour chariot
      LF    CONSTANT CHAR(1)  := CHR(10);  -- Saut de ligne
      CR_LF CONSTANT CHAR(2)  := LF || CR; --Saut de ligne et retour chariot
      TAB   CONSTANT PLS_INTEGER := 50;
      sDelay   CONSTANT PLS_INTEGER := 30;
      /* Private Record */
      TYPE REC_LOG IS RECORD(
        ERR_DATE TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
        ERR_TXT  VARCHAR2(4000)
      /* Private Type Table */
      TYPE TAB_VALUE IS TABLE OF REC_LOG INDEX BY PLS_INTEGER;
      TYPE TAB_POINTER IS TABLE OF TAB_VALUE INDEX BY VARCHAR2(80);
      /* Private Variables Structures */
      LOG_TRC PARAM_TECHNIC.PRM_VALUE%TYPE;
      LIST_PARAM TAB_POINTER;
      /* Private Programs */
      FUNCTION GET_PROC_NAME( SOURCE_OWNER IN all_source.OWNER%TYPE
                             ,SOURCE_NAME  IN all_source.NAME%TYPE
                             ,SOURCE_LINE  IN all_source.LINE%TYPE) RETURN VARCHAR2
      AS
        SOURCE_TEXT  all_source.TEXT%TYPE;
        TYPE RECORD_TEXT IS TABLE OF all_source.TEXT%TYPE;
        RETURN_TEXT     RECORD_TEXT;
      BEGIN
        SELECT * INTO SOURCE_TEXT
        FROM (SELECT TEXT FROM all_source
            WHERE OWNER = SOURCE_OWNER AND
                  NAME=SOURCE_NAME AND
                  TYPE IN ('PROCEDURE','FUNCTION','PACKAGE BODY') AND
                  LINE <= SOURCE_LINE AND SUBSTR(TRIM(TEXT),1,9) IN ('PROCEDURE','FUNCTION ')
            ORDER BY LINE DESC)
        WHERE ROWNUM = 1;
        IF SOURCE_TEXT IS NOT NULL OR  SOURCE_TEXT != '' THEN
          SOURCE_TEXT := TRIM(SUBSTR(SOURCE_TEXT,1,INSTR(SOURCE_TEXT,'(')-1));     
          SOURCE_TEXT := LTRIM(LTRIM(TRIM(SOURCE_TEXT),'PROCEDURE'),'FUNCTION');
          SOURCE_TEXT := SOURCE_NAME||'.'|| TRIM(SOURCE_TEXT);
        ELSE
          SOURCE_TEXT := 'ANONYMOUS BLOCK';
        END IF;
        RETURN SOURCE_TEXT;
      END GET_PROC_NAME;
      PROCEDURE SELECT_MASTER(REF_TYPE IN VARCHAR2, PARAM_VALUE IN VARCHAR2, SITE OUT VARCHAR2, REF_MASTER OUT VARCHAR2)
      AS
      BEGIN
          REF_MASTER := '';
          SITE := '99';
          CASE UPPER(REF_TYPE)
            WHEN 'PO' THEN -- Process Order
              SELECT SITE_CODE INTO SITE FROM PO_PROCESS_ORDER WHERE PO_NUMBER = PARAM_VALUE;
            WHEN 'SO' THEN -- Shop Order
              SELECT P.SITE_CODE,P.PO_NUMBER INTO SITE,REF_MASTER FROM SO_SHOP_ORDER S
              INNER JOIN PO_PROCESS_ORDER P ON P.PO_NUMBER = S.PO_NUMBER
              WHERE S.NUMOF = PARAM_VALUE;
            WHEN 'SM' THEN -- Submixing
              SELECT SITE_CODE,NUMOF INTO SITE,REF_MASTER FROM SO_SUBMIXING WHERE IDSM = PARAM_VALUE;
            WHEN 'IDSM' THEN -- Submixing
              SELECT SITE_CODE,NUMOF INTO SITE,REF_MASTER FROM SO_SUBMIXING WHERE IDSM = PARAM_VALUE;
            WHEN 'PR' THEN -- Pourring
              SELECT B.SITE_CODE,P.NUMOF INTO SITE,REF_MASTER FROM SO_POURING P
              INNER JOIN SO_SUBMIXING B ON B.IDSM=P.IDSM
              WHERE P.IDSM = PARAM_VALUE;
            WHEN 'NUMSMP' THEN -- Pourring
              SELECT SITE_CODE,NUMOF INTO SITE,REF_MASTER FROM SAMPLE WHERE NUMSMP = TO_NUMBER(PARAM_VALUE);
    --        WHEN 'MSG' THEN -- Messages
    --          SELECT SITE_CODE,PO_NUMBER INTO SITE,REF_MASTER FROM CMS_INTERFACE.MAP_ITF_PO WHERE MSG_ID = PARAM_VALUE;
            ELSE
              SITE := sys_context('usr_context', 'site_attribute');
          END CASE;
      EXCEPTION
        WHEN OTHERS THEN
          REF_MASTER := '';
          SITE := sys_context('usr_context', 'site_attribute');
      END SELECT_MASTER;
      PROCEDURE ADD_LIST_PROC
      AS
      PRAGMA AUTONOMOUS_TRANSACTION;
      BEGIN
        MERGE INTO LOG_PARAM A
        USING (SELECT OWNER, TYPE
                     ,NAME PROC
                     , CASE NAME WHEN SUBNAME THEN NULL
                                 ELSE SUBNAME
                       END SUBPROC
               FROM (
                  SELECT owner,TYPE,UPPER(NAME) NAME,UPPER(trim(substr(substr(trim(text),1,instr(trim(text),'(')-1),instr(substr(trim(text),1,instr(trim(text),'(')-1),' ')))) SUBNAME
                         FROM ALL_SOURCE where owner in ('CMS_ADM','CMS_INTERFACE')
                                             and type in ('FUNCTION','PROCEDURE','PACKAGE BODY')
                                             and (instr(substr(trim(text),1,instr(trim(upper(text)),'(')-1),'FUNCTION') = 1 or instr(substr(trim(text),1,instr(trim(upper(text)),'(')-1),'PROCEDURE')=1)
               )-- ORDER BY OWNER,PROC,SUBPROC NULLS FIRST
        ) B
        ON (A.OWNER = B.OWNER AND A.TYPE = B.TYPE AND A.PROC=B.PROC AND NVL(A.SUBPROC,' ') = NVL(B.SUBPROC,' '))
        WHEN NOT MATCHED THEN
          INSERT (OWNER,TYPE,PROC,SUBPROC) VALUES (B.OWNER,B.TYPE,B.PROC,B.SUBPROC)
        WHEN MATCHED THEN
          UPDATE SET ACTIVE = ACTIVE;
        DELETE LOG_PARAM A
        WHERE NOT EXISTS (SELECT OWNER, TYPE
                     ,NAME PROC
                     , CASE NAME WHEN SUBNAME THEN NULL
                                 ELSE SUBNAME
                       END SUBPROC
               FROM (
                  SELECT owner,TYPE,NAME,upper(trim(substr(substr(trim(text),1,instr(trim(text),'(')-1),instr(substr(trim(text),1,instr(trim(text),'(')-1),' ')))) SUBNAME
                         FROM ALL_SOURCE where owner in ('CMS_ADM','CMS_INTERFACE')
                                             and type in ('FUNCTION','PROCEDURE','PACKAGE BODY')
                                             and (instr(substr(trim(text),1,instr(trim(text),'(')-1),'FUNCTION') = 1 or instr(substr(trim(text),1,instr(trim(text),'(')-1),'PROCEDURE')=1)
               ) WHERE A.OWNER = OWNER AND A.TYPE = TYPE AND A.PROC=PROC AND NVL(A.SUBPROC,' ') = NVL(SUBPROC,' '));
        COMMIT;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END ADD_LIST_PROC;
      PROCEDURE INITIALIZE
      AS
      BEGIN
        LIST_PARAM.DELETE;
        CLEAN;
    --    ADD_LIST_PROC;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END INITIALIZE;
      PROCEDURE CLEAN
      AS
        PRAGMA AUTONOMOUS_TRANSACTION;
        dtTrcLog DATE;
        dtTrcErr DATE;
      BEGIN
        BEGIN
          SELECT dbdate-NUMTODSINTERVAL(to_number(PRM_VALUE),'DAY') INTO dtTrcLog
          FROM PARAM_TECHNIC WHERE PRM_TYPE = 'DEL_TRC_LOG';
        EXCEPTION
          WHEN OTHERS THEN
            dtTrcLog := dbdate -NUMTODSINTERVAL(sDelay,'DAY');
        END;
        BEGIN
          SELECT dbdate-NUMTODSINTERVAL(to_number(PRM_VALUE),'DAY') INTO dtTrcErr
          FROM PARAM_TECHNIC WHERE PRM_TYPE = 'DEL_TRC_ERR';
        EXCEPTION
          WHEN OTHERS THEN
            dtTrcErr := dbdate -NUMTODSINTERVAL(sDelay,'DAY');
          END;
        DELETE FROM ERROR_LOG WHERE ERR_TYPE ='LOG' AND ERR_DATE < dtTrcLog;
        DELETE FROM ERROR_LOG WHERE ERR_TYPE ='ERROR' AND ERR_DATE < dtTrcErr;
        COMMIT;
      EXCEPTION
        WHEN OTHERS THEN
          NULL; -- Do nothing if error occurs and catch exception
      END CLEAN;
      PROCEDURE RESETS(IN_SOURCE IN VARCHAR2 DEFAULT NULL)
      AS
        SOURCE_OWNER all_source.OWNER%TYPE;
        SOURCE_NAME      all_source.NAME%TYPE;
        SOURCE_LINE      all_source.LINE%TYPE;
        SOURCE_TEXT  all_source.TEXT%TYPE;
        SOURCE_PROC  VARCHAR2(32727);
      BEGIN
        OWA_UTIL.WHO_CALLED_ME(owner    => SOURCE_OWNER,
                               name     => SOURCE_NAME,
                               lineno   => SOURCE_LINE,
                               caller_t => SOURCE_TEXT);
        IF SOURCE_PROC IS NULL THEN
          SOURCE_PROC := SUBSTR(GET_PROC_NAME(SOURCE_OWNER,SOURCE_NAME,SOURCE_LINE),1,125);
        ELSE
          SOURCE_PROC := IN_SOURCE;
        END IF;
        LIST_PARAM.DELETE(SOURCE_PROC);
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END RESETS;
      PROCEDURE PUT_LINE(TXT IN VARCHAR2)
      AS
        PRAGMA AUTONOMOUS_TRANSACTION;
        SOURCE_OWNER     all_source.OWNER%TYPE;
        SOURCE_NAME     all_source.NAME%TYPE;
        SOURCE_LINE     all_source.LINE%TYPE;
        SOURCE_TEXT all_source.TEXT%TYPE;
        SOURCE_PROC VARCHAR2(128); 
      BEGIN
        IF TXT IS NULL OR TXT = '' THEN
          RETURN;
        END IF;
        OWA_UTIL.WHO_CALLED_ME(owner    => SOURCE_OWNER,
                               name     => SOURCE_NAME,
                               lineno   => SOURCE_LINE,
                               caller_t => SOURCE_TEXT);
        SOURCE_PROC := GET_PROC_NAME(SOURCE_OWNER,SOURCE_NAME,SOURCE_LINE);
        IF LIST_PARAM.EXISTS(SOURCE_PROC) THEN
          LIST_PARAM(SOURCE_PROC)(LIST_PARAM(SOURCE_PROC).COUNT+1).ERR_TXT := TXT;
        ELSE 
          LIST_PARAM(SOURCE_PROC)(1).ERR_TXT := TXT;
        END IF;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;   
      END PUT_LINE;
      PROCEDURE LOGS(REF_TYPE IN VARCHAR2 DEFAULT 'SITE', REF_VALUE IN VARCHAR2 DEFAULT '99')
      AS
        PRAGMA AUTONOMOUS_TRANSACTION;
        MASTER_VALUE ERROR_LOG.ERR_MASTER%TYPE;
        SITE PARAMTAB.SITE_CODE%TYPE;
        SOURCE_OWNER     all_source.OWNER%TYPE;
        SOURCE_NAME     all_source.NAME%TYPE;
        SOURCE_LINE     all_source.LINE%TYPE;
        SOURCE_TEXT all_source.TEXT%TYPE;
        SOURCE_PROC VARCHAR2(128);
        ERR_KEY NUMBER;
      BEGIN
    --    NULL;
        OWA_UTIL.WHO_CALLED_ME(owner    => SOURCE_OWNER,
                               name     => SOURCE_NAME,
                               lineno   => SOURCE_LINE,
                               caller_t => SOURCE_TEXT);
        SOURCE_PROC := SUBSTR(GET_PROC_NAME(SOURCE_OWNER,SOURCE_NAME,SOURCE_LINE),1,128);
        LIST_PARAM.DELETE(SOURCE_PROC);
    --    SELECT NVL(MAX(ACTIVE),'N') INTO LOG_TRC FROM LOG_PARAM WHERE TRIM(UPPER((PROC||'.'||SUBPROC))) = TRIM(UPPER(SOURCE_PROC))
    --                                      AND OWNER =SOURCE_OWNER AND TYPE = SOURCE_TEXT ;
    --    IF LOG_TRC = 'N' THEN
    --      LIST_PARAM.DELETE(SOURCE_PROC);
    --      RETURN;
    --    END IF;   
    --    SELECT_MASTER(REF_TYPE => UPPER(REF_TYPE), PARAM_VALUE => REF_VALUE, SITE => SITE, REF_MASTER => MASTER_VALUE);
    --    ERR_KEY := TO_CHAR(LOCALTIMESTAMP,'YYYYMMDDHH24MISSFF6');
    --    FOR AIX IN 1..LIST_PARAM(SOURCE_PROC).COUNT LOOP
    --      INSERT INTO ERROR_LOG (ERR_KEY, ERR_SITE,ERR_SLAVE  ,ERR_MASTER  ,ERR_TYPE ,ERR_PROC,ERR_DATE,ERR_TXT)
    --      VALUES (ERR_KEY,SITE,REF_VALUE,MASTER_VALUE,'LOG',SOURCE_PROC,LIST_PARAM(SOURCE_PROC)(AIX).ERR_DATE ,LIST_PARAM(SOURCE_PROC)(AIX).ERR_TXT);
    --    END LOOP; 
    --    UPDATE SESSION_CONTEXT SET SCX_ERR_KEY = ERR_KEY WHERE SCX_ID = SYS_CONTEXT('USERENV','SESSIONID');
    --    LIST_PARAM.DELETE(SOURCE_PROC);
    --    COMMIT;
      EXCEPTION
        WHEN OTHERS THEN
          LIST_PARAM.DELETE(SOURCE_PROC);
      END LOGS;
      PROCEDURE ERRORS(REF_TYPE IN VARCHAR2 DEFAULT 'SITE', REF_VALUE IN VARCHAR2 DEFAULT '99', ERR_CODE IN NUMBER DEFAULT SQLCODE, ERR_MSG IN VARCHAR2 DEFAULT SQLERRM)
      AS
        PRAGMA AUTONOMOUS_TRANSACTION;
        MASTER_VALUE ERROR_LOG.ERR_MASTER%TYPE;
        SITE         PARAMTAB.SITE_CODE%TYPE;
        SOURCE_OWNER all_source.OWNER%TYPE;
        SOURCE_NAME      all_source.NAME%TYPE;
        SOURCE_LINE      all_source.LINE%TYPE;
        SOURCE_TEXT  all_source.TEXT%TYPE;
        SOURCE_PROC  VARCHAR2(4000);
        ERR_KEY NUMBER := TO_CHAR(LOCALTIMESTAMP,'YYYYMMDDHH24MISSFF6');
      BEGIN
        OWA_UTIL.WHO_CALLED_ME(owner    => SOURCE_OWNER,
                               name     => SOURCE_NAME,
                               lineno   => SOURCE_LINE,
                               caller_t => SOURCE_TEXT);
        SOURCE_PROC := SUBSTR(GET_PROC_NAME(SOURCE_OWNER,SOURCE_NAME,SOURCE_LINE),1,125);
        SELECT_MASTER(REF_TYPE => UPPER(REF_TYPE), PARAM_VALUE => REF_VALUE, SITE => SITE, REF_MASTER => MASTER_VALUE);
       IF LIST_PARAM.EXISTS(SOURCE_PROC) THEN
          FOR AIX IN 1..LIST_PARAM(SOURCE_PROC).COUNT LOOP
            INSERT INTO ERROR_LOG (ERR_KEY,ERR_SITE,ERR_SLAVE,ERR_MASTER,ERR_PROC,ERR_DATE,ERR_TXT,ERR_CODE,ERR_MSG)
            VALUES (ERR_KEY,SITE,REF_VALUE,MASTER_VALUE,SOURCE_PROC,LIST_PARAM(SOURCE_PROC)(AIX).ERR_DATE, LIST_PARAM(SOURCE_PROC)(AIX).ERR_TXT,ERR_CODE,ERR_MSG);
          END LOOP; 
         LIST_PARAM.DELETE(SOURCE_PROC);
        ELSE
          INSERT INTO ERROR_LOG (ERR_KEY,ERR_SITE,ERR_SLAVE,ERR_MASTER,ERR_PROC,ERR_DATE,ERR_TXT,ERR_CODE,ERR_MSG)
          VALUES (ERR_KEY,SITE,REF_VALUE,MASTER_VALUE,SOURCE_PROC,CURRENT_TIMESTAMP,'Error info',ERR_CODE,ERR_MSG);
        END IF;
        UPDATE SESSION_CONTEXT SET SCX_ERR_KEY = ERR_KEY WHERE SCX_ID = sys_context('usr_context', 'session_id');
        COMMIT;
      EXCEPTION
        WHEN OTHERS THEN
          LIST_PARAM.DELETE(SOURCE_PROC);
      END ERRORS;
    END PAC_LOG_ERROR;

    This package is always call. On each routines performed I execute it. In the trace log of the database we have see a problem we the procedure GET_PROC_NAME in the package. We have identify that is called more that 800x and increase the performance. Who increase is this select command :
        SELECT * INTO SOURCE_TEXT
        FROM (SELECT TEXT FROM all_source
            WHERE OWNER = SOURCE_OWNER AND
                  NAME=SOURCE_NAME AND
                  TYPE IN ('PROCEDURE','FUNCTION','PACKAGE BODY') AND
                  LINE <= SOURCE_LINE AND SUBSTR(TRIM(TEXT),1,9) IN ('PROCEDURE','FUNCTION ')
            ORDER BY LINE DESC)
        WHERE ROWNUM = 1;Complex SQL like inline views and views of views can overwhelm the cost-based optimizer resulting in bad execution plans. Start with getting an execution plan of your problem query to see if it is inefficient - look for full table scans in particular. You might bet better performance by eliminating the IN and merging the results of 3 queries with a UNION.

Maybe you are looking for

  • Set Adobe Reader iPad/iPhone app to just view pdf instead of downloading it?

    Hello, I work for a financial company and it seems that some of our user's were having trouble viewing a pdf document that contained editable text boxes.  The layout of the form itself would show, but none of the text within the text boxes would appe

  • Apache 2.0.5.5 and WebLogic 9.1 on Solaris 10

    Good day. We were setting up an Apache 2.0.55 server as the web server for a WebLogic 9.1 server. They are on different machines. We were able to setup successfully both servers and tried them on their own server. The problem begin when we connect th

  • Import leave application from NWDI to NWDS

    Hi, I want to modify the ESS leave application. I want to define default value in "duration" field of ESS leave webdynpro application. I have imported the ESS  buisness package into NWDI...  i was also able to import from NWDI into NWDS. I have impor

  • Oracle VM Server unable to communicate with pool master

    Hello Forum I have the following situation and I hope that someone has an idea/solution Background : Oracle VM version : 3.1 2 - Server pool Repository : NFS Problem : This is the what I found out so far : I try to start a guest which is hosted on th

  • DHCP 2008 R2 - MMC Cannot Initialize Snap-in when clicking on Address Leases

    I recently migrated my DHCP/DNS to a Windows 2008 R2 server. It generally seems to be working fine however, whenever I click on "Address Leases" within my scope it iterates all the leases and either at the end (or close to it) I just get the error "M