Apex_util.set_session_state + user id

Hi,
In my login process I have the following two calls, where user_group and user_id are application level items
apex_util.set_session_state('USER_GROUP', apex_util.get_groups_user_belongs_to(:APP_USER));
apex_util.set_session_state('USER_ID', apex_util.get_user_id(:APP_USER));
After I login, when I check the session state, I have the user_group populated correctly but not the user_id item. When I use a debug to print out what is happening using apex_util.get_session_state('USER_ID'), it seems to print the correct value.
THis is what I have in my debug output
0.01: Branch point: BEFORE_PROCESSING
0.01: Processing point: AFTER_SUBMIT
0.01: ...Process "Set Username Cookie": PLSQL (AFTER_SUBMIT) begin owa_util.mime_header('text/html', FALSE); owa_cookie.send( name=>'LOGIN_USERNAME_COOKIE', value=>lower(:P101_USERNAME)); exception when others then null; end;
0.01: ...Process "Login": PLSQL (AFTER_SUBMIT) wwv_flow_custom_auth_std.login( P_UNAME => :P101_USERNAME, P_PASSWORD => :P101_PASSWORD, P_SESSION_ID => v('APP_SESSION'), P_FLOW_PAGE => :APP_ID||':1' );
0.01: ...Process "set_application_items": PLSQL (AFTER_SUBMIT) BEGIN pkg_utils.debug('In set_application_items. Going to set appl item values for appuser' || :APP_USER); apex_util.set_session_state('USER_GROUP', apex_util.get_groups_user_belongs_to(:APP_USER)); apex_util.set_session_state('USER_ID', ape
0.01: ****Application Debugging: In set_application_items. Going to set appl item values for appuserCHAND****
0.03: ...Session State: Save Item "USER_GROUP" newValue="ADMIN, AMPINV, AMPMGR, AMRINSTLR, AMRPLN, AMRSURVYR, IT, LV, LVPLN, MANAGER, MR, MANAGER" "escape_on_input="Y"
0.03: ...Session State: Save Item "USER_ID" newValue="4110819710784391" "escape_on_input="Y"
0.03: ****Application Debugging: In set_application_items. Set the session state. User id is now , from session state it is 4110819710784391 now getting person id****
0.03: ****Application Debugging: In set_application_items. Done. User id is ,and username is CHAND, and session user id is 4110819710784391****
0.03: ...Session State: Saved Item "USER_ID" New Value=""
0.03: ...Session State: Save Item "PERSON_ID" newValue="12" "escape_on_input="Y"
0.03: ...Process "Clear Page(s) Cache": CLEAR_CACHE_FOR_PAGES (AFTER_SUBMIT) 101
0.03: Nulling cache for application "102" page: 101
How do I sort this ? I've got the exact same code in another application and there the user_id is populated correctly. Any pointers welcome.
Thank you,
Chandini

Hi,
Just an update. I've sorted this problem though I do not understand why there was a problem.
After my call to the Apex_util.set_session_state, I had an anonymous block written to look up some data from the db. And for some reason this was causing the problem. So I've had to move that bit into a separate process and it all seems to work now.
Though, if somebody could explain why it was a problem in the first place it would be useful to know.
Ta,
Chandini

Similar Messages

  • Apex_util.set_session_state issue

    Hi
    In order to try and workaround the issue reported in Translate substitutions I have been trying to set application item values using apex_util.set_session_state but this doesn't appear to be working.
    The problem in the thread was that when the admin user changed the values of substitutions these are only changed in the primary application and not the seeded ones. I understand that we are perhaps using substitutions differently to other people and although this problem has been acknowledged by Oracle I thought there might be a relatively simple solution for us.
    What I'd like to do is implement code similar to below as an application process:
    BEGIN
      FOR i IN (SELECT * FROM apex_application_substitutions
                WHERE application_id = :APP_ID) LOOP
        apex_util.set_session_state(i.substitution_string||'1', i.substitution_value);
      END LOOP;
    END;When running the seeded application the APP_ID is that of the primary application. So this code will pick up the values of the substitutions from the primary application and save these as values for similarly named application items in the current session, which we'd then refer to instead. This isn't ideal as we will need to re-write a lot of code, but at least it means we can translate our applications which we can't do at present.
    However, the spplication item values are not set. I've done some investigation just looking at the primary application, so ignoring translation and seeded application completely. I've been working on APEX 4.0.2 but found that there was a reported bug, apex_util.set_session_state don't works after upgrade from 4.0.1 to 4.0.2 This may be relevant, but I'm unable to apply the patch. So I've investigated on apex.oracle.com which is APEX 4.1 and I have been able to reproduce the problem. Just incase it matters I've got no authentication or authorization on my application.
    The problem can be seen here: http://apex.oracle.com/pls/apex/f?p=56303 The section of interest is the output not the form. Here I've output what I'm doing and the values of the application items after each step. The application items are called SUB_VALUE1 and 2ND_VALUE1 and my substitutions are called SUB_VALUE and 2ND_VALUE. At the end I set the application items to null, so they will always start null. The output is as follows:
    (0) SUB_VALUE1 =
    (0) 2ND_VALUE1 =
    apex_util.set_session_state(i.substitution_string||'1', i.substitution_value);
    (1) SUB_VALUE1 =
    (1) 2ND_VALUE1 =
    apex_util.set_session_state('SUB_VALUE1',i.substitution_value);
    (2) SUB_VALUE1 =
    (2) 2ND_VALUE1 =
    :SUB_VALUE1 := i.substitution_value;
    (3) SUB_VALUE1 = Primary App Value
    (3) 2ND_VALUE1 =
    apex_util.set_session_state('SUB_VALUE1','XYZ');
    (4) SUB_VALUE1 = Primary App Value
    (4) 2ND_VALUE1 =
    apex_util.set_session_state(i.substitution_string||'1', i.substitution_value);
    (1) SUB_VALUE1 = Primary App Value
    (1) 2ND_VALUE1 =
    apex_util.set_session_state('SUB_VALUE1',i.substitution_value);
    (2) SUB_VALUE1 = Primary App Value
    (2) 2ND_VALUE1 =
    :2ND_VALUE1 := i.substitution_value;
    (3) SUB_VALUE1 = Primary App Value
    (3) 2ND_VALUE1 = Second value
    apex_util.set_session_state('2ND_VALUE1','ABC');
    (4) SUB_VALUE1 = Primary App Value
    (4) 2ND_VALUE1 = Second valueYou can see that no values are set using apex_util.set_session_state, even explicitly stating the application item name and value (e.g. apex_util.set_session_state('2ND_VALUE1','ABC');) does not set or update the value.
    This could be as simple as the patch hasn't been included in APEX 4.1 or maybe I am missing something obvious. Unfortunately I'm unable to test this in 4.0.1 or any other version, to see if it's just a problem in 4.0.2 and 4.1.
    If someone could confirm if the patch has been included in 4.1 or if this is a new issue. Or perhaps point me to another post answering this (I couldn't find one) or just show me the error of my ways that would be brilliant.
    Cheers
    Sara

    Further, what should the 'Source' be set to for these hidden items.Static Assignment, with Source Used set to Only...
    Scott

  • Apex_util.set_session_state don't works after upgrade from 4.0.1 to 4.0.2

    Hi!
    We have custom authentication scheme with "Page Sentry Function" and "Post-Authentiaction Process" defined.
    Page sentry function called wwv_flow_custom_auth.define_user_session procedure.
    Post-authentiaction process called apex_util.set_session_state procedure to set some application items.
    All works fine until we upgraded from version 4.0.1 to 4.0.2 (patch 10173973).
    In verion 4.0.2 apex_util.set_session_state does nothing....
    This is a bug or a feature? :)
    Thanks.

    Hi, Patrick!
    Test case on http://apex.oracle.com/pls/apex/f?p=31741
    1. Run http://apex.oracle.com/pls/apex/f?p=31741 (Values of items F31741_USERID and F31741_USERINFO are not null)
    2. Login into apex builder (workspace: WS_AVER, user: VERSALAO, pass: qwerty%)
    3. Run page 1. Values of items F31741_USERID and F31741_USERINFO is null
    4. Logout from apex builder
    5. Run http://apex.oracle.com/pls/apex/f?p=31741 - "ERR-1201 session ID not set on custom authentication" displayed
    Where is an error in my code?
    Thanks.
    Edited by: user12288359 on 25/11/2010 7:23

  • How to trap APEX_UTIL.SET_SESSION_STATE errors like ERR-1002?

    Hi team,
    i noticed that when i call APEX_UTIL.SET_SESSION_STATE and the relevant page item or application item doesn't exist, this API procedure doesn't return a normal oracle exception but, i guess, it sets some status flag in the Apex engine that causes ERR-1002 to be reported. This is the behaviour i am seeing on Apex 3.1.2 and Apex 3.2.
    Is there any way to work around this?
    Thank you
    Flavio
    http://oraclequirks.blogspot.com

    Yes I realised it... I think I read your original post too hastily!
    I personally don't like tampering with code I don't have full access to... You never know if it will work with the next release or if you have covered all bases. So the solution I decided to use was to override the original apex function with my own (Apex 3.2):
      Checks whether a page item exists in the current application.
      Returns: TRUE if it does and FALSE otherwise.
      FUNCTION page_item_exists(p_name IN VARCHAR2) RETURN BOOLEAN IS
      BEGIN
        FOR r IN (SELECT i.item_name
                  FROM   apex_application_page_items i
                  WHERE  i.application_id = v('APP_ID')
                  AND    i.item_name = upper(p_name))
        LOOP
          RETURN TRUE;
        END LOOP;
        RETURN FALSE;
      END;
      Set session state.
      Raises an exception if the item does not exist.
      PROCEDURE set_session_state(p_name  IN VARCHAR2,
                                  p_value IN VARCHAR2) IS
      BEGIN
        IF NOT page_item_exists(p_name => p_name)
        THEN
          raise_application_error(-20000,
                                  'Item ' || p_name || ' does not exist');
        ELSE
          apex_util.set_session_state(p_name => p_name, p_value => p_value);
        END IF;
      END;Luis

  • Retrieve city and state from zip code that is entered by user

    I am trying to use AJAX to retrieve city and state from a table based on a zip code that is entered by the user. Two are text fields (zip code and city) and one is a SELECT field (state).
    1. I defined an application item called TEMPORARY_APPLICATION_ITEM.
    2. I defined an application process called SET_CITY_STATE as follows:
        a. Process point: on demand
        b. type: anonymous block
        c. process text:
    <pre>
    DECLARE
    v_city VARCHAR2 (100);
    v_state VARCHAR2 (2);
    CURSOR cur_c
    IS
    SELECT city, state
    FROM ZIP
    WHERE zip = v ('TEMPORARY_APPLICATION_ITEM');
    BEGIN
    FOR c IN cur_c
    LOOP
    v_city := c.city;
    v_state := c.state;
    END LOOP;
    apex_util.set_session_state('P2_CO_CITY',v_city);
    apex_util.set_session_state('P2_CO_STATE',v_state);
    EXCEPTION
    WHEN OTHERS
    THEN
    apex_util.set_session_state('P2_CITY','Unknown city');
    apex_util.set_session_state('P2_STATE',null);
    END;
    </pre>
    3. Javascript is defined in the region header:
    <pre>
    <script language="JavaScript" type="text/javascript">
    <!--
    function pull_city_state(pValue){
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_City_State',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM',pValue)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM','null')
    gReturn = get.get('XML');
    get = null;
    //-->
    </script>
    </pre>
    4. In the HTML Form Element Attributes of the P2_CO_ZIP text item: onchange="pull_city_state(this.value)";
    The city and state are not being populated. I checked the select statement and it is retreiving the city and state in SQL WORKSHOP > SQL COMMANDS.
    I would like to use it for the mailing address as well, so I would need to make the application process / javascript a bit more generic to be used in two places.
    I placed the application on apex.oracle.com:
    Workspace: RGWORK
    Application: Online Certification Application (28022)
    Can someone assists, please.
    Thank you,
    Robert
    Edited by: sect55 on Jun 2, 2009 4:11 PM

    Hi Robert,
    Try using XML instead of session state -
    Change the application on demand process with the following script -
    >
    DECLARE
    v_city VARCHAR2 (100);
    v_state VARCHAR2 (2);
    CURSOR cur_c
    IS
    SELECT city, state
    FROM ZIP
    WHERE zip = v ('TEMPORARY_APPLICATION_ITEM');
    BEGIN
    FOR c IN cur_c
    LOOP
    v_city := c.city;
    v_state := c.state;
    END LOOP;
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<body>');
    HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
    HTP.prn ('<item id="P2_CO_CITY">' || v_city || '</item>');
    HTP.prn ('<item id="P2_CO_STATE">' || v_state || '</item>');
    HTP.prn ('</body>');
    EXCEPTION
    WHEN OTHERS
    THEN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<body>');
    HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
    HTP.prn ('<item id="P2_CITY">' || 'Unknown city' || '</item>');
    HTP.prn ('<item id="P2_STATE">' || '' || '</item>');
    HTP.prn ('</body>');
    END;
    >
    in your javascript make sure you typing the application process name correctly as it is case sensitive.
    Hope this helps,
    Regards,
    M Tajuddin
    web: http://tajuddin.whitepagesbd.com

  • APEX 4.1 APEX_UTIL.CLEAR_PAGE_CACHE Bug

    Hi,
    I found the following issue in APEX 4.1. It's easiest described with an example:
    Before going into a page process suppose P1_X = 'abc' in session state;
    -- First page process (coming in P1_X = 'abc')
    l_backup := :P1_X;
    apex_util.clear_page_cache(:app_page_id);
    :P1_X := l_backup;
    -- Second page process (following the page process above)
    -- This prints the value of P1_X to the screen
    sys.htp.p(':P1_X: ' || nvl(:P1_X, 'null'));
    -- Results:
    -- APEX 4.0: (expected value)
    :P1_X: abc
    -- APEX 4.1 (incorrect)
    :P1_X: nullIf I change +:P1_X := l_backup;+ line to apex_util.set_session_state('P1_X', l_backup); the output is:
    -- Results (correct):
    -- APEX 4.0:
    :P1_X: abc
    -- APEX 4.1
    :P1_X: abcIf I change the +:P1_X := l_backup;+ line to +:P1_X := 'def';+ the output is:
    -- Results (correct):
    -- APEX 4.0:
    :P1_X: def
    -- APEX 4.1
    :P1_X: defIt appears in 4.1 that any time a page item is set following a clear cache call (this issue also happens for clear_app_cache) and the page item value is the same as it was before the clear cache value (using a bind variable set) then its value is null in session state once the page process completes.
    This was found in APEX version 4.1.1.00.23 and compared against 4.0.2.00.09
    Martin
    http://www.ClariFit.com
    http://www.TalkApex.com
    Edited by: Martin Giffy D'Souza on Oct 5, 2012 3:36 PM

    Hi Martin,
    thanks for reporting this. This change was introduced during a code reorg in 4.1.
    The reason for the current behaviour is our dynamic code exec implementation:
    1. create cursor and parse as user
    2. for all bind variables:
    3.      save session state value in local variable array
    4.      bind local value in cursor
    5. execute cursor
    6. for all bind variables:
    7.     if current bind value is different to local variable array value:
    8.         save current value in session state Step 7 only detects a change if the bind variable value itself has been modified in the dynamic pl/sql block. I filed bug #14731783 to fix this, but we will probably ship it with the first patch set.
    As a work-around, you should be able to use
    l_backup := :P1_X;
    apex_util.clear_page_cache(:app_page_id);
    apex_util.set_session_state('P1_X', l_backup);
    which does not rely on the dynamic code exec for writing back the original value of P1_X.
    Regards,
    Christian

  • Loop through user text fields on a page

    I am new to APEX and I have searched for an answer to this problem, but was not able to find one.
    I have a page which has about 40 text boxes for user input. I would like to find a way to loop through all of the text boxes on the page when the user submits the form. I want to check the contents of each text box and filter out any characters that are not alpha or numeric. I would like to do this in one process. Is this possible? If so, how would I access the text boxes and remove the unwanted input? Could you please show me an example?
    Thanks for any guidance on this.

    Hi,
    I did not test this, but could something like after submit process work
    DECLARE
    l_temp VARCHAR2(32000);
    BEGIN
      FOR C IN
      (SELECT item_name
      FROM apex_application_page_items
      WHERE display_as   = 'Text Field'
      AND application_id = :APP_ID
      AND page_id        = :APP_PAGE_ID
      LOOP
        -- Do stuff e.g. remove character  Ö
        l_temp := REPLACE(v(c.item_name),'Ö');
        APEX_UTIL.SET_SESSION_STATE (
          p_name  => c.item_name,
          p_value => l_temp
      END LOOP;
    END;Br,Jari
    Edited by: jarola on Mar 4, 2010 5:26 PM

  • Problem with APEX_UTIL.EXPIRE_END_USER_ACCOUNT

    Hi experts,
    I have one problem with apex_util procedure:
    APEX_UTIL.EXPIRE_END_USER_ACCOUNT (
      p_user_name IN VARCHAR2
    );Sometimes i need to set the expiration directly for some end users. If i use the procedure above - nothing happens. The end user can log in to the application.
    I use another way how to handle it: APEX_UTIL.EDIT_USER -> l_first_password_use_occurred := 'N';
    It works this way but i want to use less pl/sql code for it - to be more clearly (APEX_UTIL.EXPIRE_END_USER_ACCOUNT).
    Somebody can help ?
    - Tested user is set to end user.
    - APEX_UTIL.EXPIRE_END_USER_ACCOUNT is called on submit after computations and validations when button is pressed.
    - parameter p_user_name = upper(:PXX_USER_NAME).
    Specs:
    * APEX 4.1.1
    * 11G DB
    * Tomcat 6.0
    Regards
    J :D

    Hello,
    Set "Administration -> Manage Service -> Set Workspace Preference -> Account Expiration and Locking" as "Enable". Then only
    APEX_UTIL.EXPIRE_END_USER_ACCOUNT (expires the user password, forces user to change password) and APEX_UTIL.LOCK_ACCOUNT (user can't log-in anymore) Procedure will be effective.
    Regards,
    Hari
    Edited by: Hari_639 on Dec 19, 2012 5:18 PM

  • Use of the Apex API in pl/sql procedures.

    Hi,
    I have a page with a form region with fields working as filter for an interactive report. This report is conditionally showed when the user clicks on the filter button. It was working with the field :REQUEST, but in this way IR functions like download, filter, format... doesn't work, I've seen that it's a bug. A workaround is using a field instead :REQUEST to conditionally show the IR region. I want to create and manage this field with a proccess, here is the code.
    DECLARE
      L_INPUT BOOLEAN;
      L_VAL   VARCHAR2(32);
      L_NAME  VARCHAR2(32);
    BEGIN
      IF :REQUEST = 'FILTER' THEN
        L_VAL := 'FILTER';
      ELSE
        L_VAL := '';
      END IF;
      L_NAME  := :APP_PAGE_ID || '_PROCESS';
      L_INPUT := APEX_CUSTOM_AUTH.APPLICATION_PAGE_ITEM_EXISTS(L_NAME);
      IF L_VAL = 'FILTER' THEN
        IF L_INPUT THEN
          APEX_UTIL.SET_SESSION_STATE(L_NAME, L_VAL);
        ELSE
          APEX_ITEM.HIDDEN(1, L_VAL, 'readonly', L_NAME);
        END IF;   
      ELSE
        IF L_INPUT THEN
          APEX_UTIL.SET_SESSION_STATE(L_NAME, L_VAL);
        ELSE
          APEX_ITEM.HIDDEN(1, L_VAL, 'readonly', L_NAME);
        END IF;
      END IF;
    END;But this code produces the following error:
    ORA-06550: line 20, column 7: PLS-00221: 'HIDDEN' is not a procedure or is undefined ORA-06550: line 20, column 7: PL/SQL: Statement ignored ORA-06550: line 26, column 7: PLS-00221: 'HIDDEN' is not a procedure or is undefined ORA-06550: line 26, column 7: PL/SQL: Statement ignored
    I'm using Apex 4.1.2. What it's wrong? I can't use APEX_ITEM package in this way?
    Regards,

    RideTheStorm wrote:
    Hi,
    I have a page with a form region with fields working as filter for an interactive report. This report is conditionally showed when the user clicks on the filter button. It was working with the field :REQUEST, but in this way IR functions like download, filter, format... doesn't work, I've seen that it's a bug. A workaround is using a field instead :REQUEST to conditionally show the IR region. I want to create and manage this field with a proccess, here is the code.What field?? if you want to set a page item as conditional then edit the item and set a condition.
    DECLARE
    L_INPUT BOOLEAN;
    L_VAL   VARCHAR2(32);
    L_NAME  VARCHAR2(32);
    BEGIN
    IF :REQUEST = 'FILTER' THEN
    L_VAL := 'FILTER';
    ELSE
    L_VAL := '';
    END IF;
    L_NAME  := :APP_PAGE_ID || '_PROCESS';
    L_INPUT := APEX_CUSTOM_AUTH.APPLICATION_PAGE_ITEM_EXISTS(L_NAME);
    IF L_VAL = 'FILTER' THEN
    IF L_INPUT THEN
    APEX_UTIL.SET_SESSION_STATE(L_NAME, L_VAL);
    ELSE
    APEX_ITEM.HIDDEN(1, L_VAL, 'readonly', L_NAME);
    END IF;   
    ELSE
    IF L_INPUT THEN
    APEX_UTIL.SET_SESSION_STATE(L_NAME, L_VAL);
    ELSE
    APEX_ITEM.HIDDEN(1, L_VAL, 'readonly', L_NAME);
    END IF;
    END IF;
    END;But this code produces the following error:
    ORA-06550: line 20, column 7: PLS-00221: 'HIDDEN' is not a procedure or is undefined ORA-06550: line 20, column 7: PL/SQL: Statement ignored ORA-06550: line 26, column 7: PLS-00221: 'HIDDEN' is not a procedure or is undefined ORA-06550: line 26, column 7: PL/SQL: Statement ignored
    I'm using Apex 4.1.2. What it's wrong? I can't use APEX_ITEM package in this way?
    Regards,
    What are you trying to do?? I guess you have to use APEX_IR http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_ir.htm
    APEX_ITEM.HIDDEN is not a procedure and is a function that returns HTML for hidden item.

  • Create Simple Printable SQL Reports in APEX 3.2 Without a Print Server

    Oracle Apex 3.2
    Oracle 11g
    OHS
    I thought I'd post an answer on how to get a printable SQL report in Oracle Apex without having to configure a print server. I'm sure that similar things have been posted in various other places, but I found the documentation for using custom row templates (to create a printable report) to be incomplete at best. For my needs, I was not looking for an awe inspiring report printout, but rather simple directory information printouts. For example, if you wanted a printable report to look like this:
    =================================
    CURRENT ACTIVE EMPLOYEES REPORT
    =================================
    First Name: Bob                  Employee ID: 0000000000
    Last Name: Swarts              Company Credit Card Number: 0000-0000-0000-0000
    Middle Initial: F                  Social Security Number: 000-00-0000
    First Name: Sue                  Employee ID: 1111111111
    Last Name: Johnson           Company Credit Card Number: 1111-1111-1111-1111
    Middle Initial: G                 Social Security Number: 111-11-1111
    etc.....In MS Access, doing this is very easy. From what I understand, this is also very easy to do this using PDF software with a print server. However, if you are like me, you don't want to waste time and money by obtaining and configuring a print server (even if it is free). However, never fear because you can create simple reports like this with relatively minimalistic effort; and you can do so without having to configure a print server.
    1.) Create a new page
    2.) Create a new sql query report region on the page
    3.) Make your query just as you would normally.
    For this example the query would be:
    select first_name, employee_id, last_name, company_credit_card_number, middle_initial, social_security_number from employee_table4.) Go to "Shared Components"
    5.) Under "User Interface" click on "Templates"
    6.) Click on the "Create" button
    7.) Select "Report"
    8.) Select "From Scratch"
    9.) For the "Template Class," choose one of the "custom" classes. For the "Template Type," choose "Named Column"
    10.) Click the "Create" button
    11.) Now that you created a custom row template, go back to "Shared Components" and then to "Templates"
    12.) Find your custom template and click on it
    CUSTOM TEMPLATE HOW TO
    1.) In the "Row Template 1" textbox, you are going to create some custom css that will display the data on the page. The css to make the report look like the report above would be:
    <div style = text-align: justify">
    <table>
    <tr>
    <td style = "width: 200px"><b>First Name: #1#</b></td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px"><b>Employee Id: #2#</b></td>
    <tr>
    <td style = "width: 200px">Last Name: #3#</td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px">Company Credit Card Number: #4#</td>
    <tr>
    <td style = "width: 200px">MI: #5#</td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px">Social Security Number: <b>#6#</b></td>
    </tr>
    </table>
    <p style = "page-break-after: always">----------------------------------------------------------------</p>
    </div>
    {code}
    As you probably figured out, the numbers between the two pound signs ("#") are substitution strings for the variables in your select query in the SQL report.  As you have also probably noticed, the "page-break-after: always" line will always make it so that only one report is shown on a page.  To fix this, we will need to use logic and row template 2.
    2.)  For the "Row Template 1 Condition," select "Use Based on PL/SQL Expression" from the select list.
    3.)  In the textbox for the row template 1 expression enter in the following:  {code}substr('#rownum#',-1) = 0 or substr('#rownum#',-1) = 5{code}
    ***** This condition will make sure that this template is applied when the last digit in the row number is either a "0" or a "5."  So, only 5 reports will be displayed per page.
    4.)  Now go down to "Row Template 2" and enter in the following in the textbox:
    {code}
    <div style = text-align: justify">
    <table>
    <tr>
    <td style = "width: 200px"><b>First Name: #1#</b></td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px"><b>Employee Id: #2#</b></td>
    <tr>
    <td style = "width: 200px">Last Name: #3#</td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px">Company Credit Card Number: #4#</td>
    <tr>
    <td style = "width: 200px">MI: #5#</td>
    <td style = "width: 225px">&nbsp</td>
    <td style = "width: 215px">Social Security Number: <b>#6#</b></td>
    </tr>
    </table>
    <p>----------------------------------------------------------------</p>
    </div>look familiar? that is because it exactly the same code as above, except without the page-break-after piece.
    5.) For the "Row Template 2 Condition," select "Use Based on PL/SQL Expression" from the select list.
    6.) In the textbox for the row template 2 expression enter in the following: substr('#rownum#',-1) != 0 or substr('#rownum#',-1) != 5***** This condition will make sure that this template is applied when the last digit in the row number IS NOT a "0" or a "5."
    7.) Scroll down to column headings and enter this in the textbox for the "Column Heading Template": OMIT
    8.) Click the "Apply Changes" button
    9.) Now go back to your application and the page you want to apply the custom report to
    10.) On the report, click on the report tab
    11.) Scroll down to "Layout and Pagination"
    12.) Click on the "Report Template" select list
    13.) Select your custom template
    14.) Click the "Apply Changes" button and run the page
    Try printing the report, if it does not print correctly, try it in Opera, Safari, Internet Explorer, Firefox, and Google Chrome. Please note that it is my understanding that only Firefox does not understand the css "page-break-after: always"
    If needed, add some css to the page to hide tabs and other items when you print.
    ~Andrew Schulltz

    DOH. Too much copy/paste.
    In my code, I was setting an application variable to contain the email address I was retrieving from AD. Once commented out, it worked fine.
              IF l_attr_name = 'mail' THEN
                 APEX_UTIL.SET_SESSION_STATE('F111_USER_EMAIL',l_vals(i));
              END IF;

  • How to redirect to different page after login in APEX 4.1

    Dear All,
    Here my Requirement is,When the users login,
    when they entered their username and password and pressed login button,
    they have to redirected to different pages based on the type of user.
    Here my LOGIN_TABLE has following 3 columns,
    1.Username
    2.Password
    3.Type.
    The TYPE has 2 values, employee and admin.
    when the type is admin they should be redirected to page 2,
    reaining i.e employee users has to be redirected to page 3.
    How can I do this? please give some suggestion.
    Thank you.
    regards,
    Gurujothi

    Dear Christian,
    Thank you for your reply,
    I would like to explain something,
    When I using the following function,
    *create or replace FUNCTION custom_auth_g (
    p_username IN VARCHAR2,
    p_password IN VARCHAR2)
    RETURN BOOLEAN IS
    BEGIN
    FOR c1 IN (SELECT 1
    FROM login_table
    WHERE upper(username) = upper(p_username)
    AND upper(password) = upper(p_password))
    LOOP
    RETURN TRUE;
    END LOOP;
    RETURN FALSE;
    END;*
    When login, It checks in the login_table table and if the username is exist with the pass word it successfully entered inside the application.
    for all users only one page which we set.
    My Login_table also contains type which has 2 type as I mentined above.
    But As I mentioned earliar based on the user type it has to be redirected to 2 different page.
    I found this Package but I cant understand,Can you please Explain?
    *create or replace PACKAGE app_security_pkg
    AS
    PROCEDURE add_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    PROCEDURE login
    p_uname IN VARCHAR2
    ,p_password IN VARCHAR2
    ,p_session_id IN VARCHAR2
    ,p_flow_page IN VARCHAR2
    FUNCTION get_hash
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    RETURN VARCHAR2;
    PROCEDURE valid_user2
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    FUNCTION valid_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    RETURN BOOLEAN;
    END app_security_pkg;*
    *create or replace PACKAGE BODY app_security_pkg
    AS
    PROCEDURE login
    p_uname IN VARCHAR2
    ,p_password IN VARCHAR2
    ,p_session_id IN VARCHAR2
    ,p_flow_page IN VARCHAR2
    IS
    lv_goto_page NUMBER DEFAULT 1;
    BEGIN
    -- This logic is a demonstration of how to redirect
    -- to different pages depending on who successfully
    -- authenticates. In my example, it simply demonstrates
    -- the ADMIN user going to page 1 and all other users going
    -- to page 2. Add you own logic here to detrmin which page
    -- a user should be directed to post authentication.
    IF UPPER(p_uname) = 'ADMIN'
    THEN
    lv_goto_page := 1;
    ELSE
    lv_goto_page := 2;
    END IF;
    APEX_UTIL.SET_SESSION_STATE('FSP_AFTER_LOGIN_URL');
    wwv_flow_custom_auth_std.login
    p_uname => p_uname,
    p_password => p_password,
    p_session_id => p_session_id,
    p_flow_page => p_flow_page || ':' || lv_goto_page
    EXCEPTION
    WHEN OTHERS
    THEN
    RAISE;
    END login;
    PROCEDURE add_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    AS
    BEGIN
    INSERT INTO app_users (username, PASSWORD)
    VALUES (UPPER (p_username),
    get_hash (TRIM (p_username), p_password));
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    ROLLBACK;
    RAISE;
    END add_user;
    -- Function to Perform a oneway hash of the users
    -- passwords. This cannot be reversed. This exmaple
    -- is a very week hash and if been used on a production
    -- system, you may want to use a stronger hash algorithm.
    -- Read the Documentation for more info on DBMS_CRYPTO as
    -- this is the supported package from Oracle and
    -- DBMS_OBFUSCATION_TOOLKIT is now depricated.
    FUNCTION get_hash (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN VARCHAR2
    AS
    BEGIN
    RETURN DBMS_OBFUSCATION_TOOLKIT.md5 (
    input_string => UPPER (p_username)
    || '/'
    || UPPER (p_password));
    END get_hash;
    PROCEDURE valid_user2 (p_username IN VARCHAR2, p_password IN VARCHAR2)
    AS
    v_dummy VARCHAR2 (1);
    BEGIN
    SELECT '1'
    INTO v_dummy
    FROM app_users
    WHERE UPPER (username) = UPPER (p_username)
    AND PASSWORD = get_hash (p_username, p_password);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN raise_application_error (-20000, 'Invalid username / password.');
    END valid_user2;
    FUNCTION valid_user (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN BOOLEAN
    AS
    BEGIN
    valid_user2 (UPPER (p_username), p_password);
    RETURN TRUE;
    EXCEPTION
    WHEN OTHERS
    THEN RETURN FALSE;
    END valid_user;
    END app_security_pkg;*
    And you said "assign an URL to FSP_AFTER_LOGIN_URL, depending on the Type column",
    Where to assign,Could you please Explain?
    Thank you.

  • How to set an Application Item from PL/SQL

    I am attempting to set an Application Item
    After login to my app, I want to retrieve a row from my SETTINGS table and populate some Application Items with the settings information so that I can
    display some of that settings information on every page.
    Just to start, I created one Application Item named F106_YEAR
    I then created a Shared Components Application Process which executes on New Session: After Authentication
    I created this process as an Anynomous PL/SQL block.
    declare
    aucyr varchar(4);
    begin
    select year into auctyr
    from settings;
    :F106_YEAR := aucyr;
    end;
    I've tried a couple of other Syntax tricks attempting to reference the Application Item F106_YEAR from within PL/SQL (like V('F106_YEAR') but nothing seems to be working.
    I'm sure that I am missing something simple. Can someone tell me how to set an Application Item from PL/SQL?
    Thanks in advance.

    I'm still doing something wrong because this is not working for me.
    I've tried both of the following versions as an Application Process set to run on New Session after Authentication:
    declare
    auction_year varchar(4);
    begin
    select year into auction_year
    from PBUUC.SETTINGS where rownum < 2;
    :F106_AUCTION_YEAR:=auction_year;
    end;
    and I also tried:
    declare
    auction_year varchar(4);
    begin
    select year into auction_year
    from PBUUC.SETTINGS where rownum < 2;
    APEX_UTIL.SET_SESSION_STATE (p_name, p_value);
    end;
    F106_YEAR is a global Item (shared components).
    The select statement works just fine in SQL*PLUS so I know that it is correct.
    If I run the debugger and log into the application, here is the output. Shouldn't I see my Application Process get called if it is set to run on New Session after Validation?
    My Application process is named RETRIEVE_AUCTION_SETTINGS
    0.01: A C C E P T: Request="P101_PASSWORD"
    0.01: Metadata: Fetch application definition and shortcuts
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: ...NLS: Set Decimal separator="."
    0.01: ...NLS: Set NLS Group separator=","
    0.01: ...NLS: Set date format="DD-MON-RR"
    0.01: ...Setting session time_zone to -04:00
    0.01: NLS: wwv_flow.g_flow_language_derived_from=0: wwv_flow.g_browser_language=en-us
    0.01: Fetch session state from database
    0.02: ...Check session 695371898690095 owner
    0.02: ...Check for session expiration:
    0.02: ...Metadata: Fetch Page, Computation, Process, and Branch
    0.02: Session: Fetch session header information
    0.02: ...Metadata: Fetch page attributes for application 106, page 101
    0.03: ...Validate item page affinity.
    0.03: ...Validate hidden_protected items.
    0.03: ...Check authorization security schemes
    0.03: Session State: Save form items and p_arg_values
    0.03: ...Session State: Save "P101_USERNAME" - saving same value: "jps"
    0.03: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    0.03: Branch point: BEFORE_COMPUTATION
    0.03: Computation point: AFTER_SUBMIT
    0.03: Tabs: Perform Branching for Tab Requests
    0.03: Branch point: BEFORE_VALIDATION
    0.03: Perform validations:
    0.03: Branch point: BEFORE_PROCESSING
    0.03: Processing point: AFTER_SUBMIT
    0.03: ...Process "Set Username Cookie": PLSQL (AFTER_SUBMIT) begin owa_util.mime_header('text/html', FALSE); owa_cookie.send( name=>'LOGIN_USERNAME_COOKIE', value=>lower(:P101_USERNAME)); exception when others then null; end;
    0.04: ...Process "Login": PLSQL (AFTER_SUBMIT) wwv_flow_custom_auth_std.login( P_UNAME => :P101_USERNAME, P_PASSWORD => :P101_PASSWORD, P_SESSION_ID => v('APP_SESSION'), P_FLOW_PAGE => :APP_ID||':1' );
    0.06: ...Process "Clear Page(s) Cache": CLEAR_CACHE_FOR_PAGES (AFTER_SUBMIT) 101
    0.06: Nulling cache for application "106" page: 101
    0.00:
    0.00: S H O W: application="106" page="1" workspace="" request="" session="695371898690095"
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: ...NLS: Set Decimal separator="."
    0.01: ...NLS: Set NLS Group separator=","
    0.01: ...NLS: Set date format="DD-MON-RR"
    0.01: ...Setting session time_zone to -04:00
    0.01: NLS: wwv_flow.g_flow_language_derived_from=0: wwv_flow.g_browser_language=en-us
    0.01: Application 106, Authentication: CUSTOM2, Page Template: 2904114531488186
    0.01: ...Session ID 695371898690095 can be used
    0.01: ...Application session: 695371898690095, user=JPS
    0.01: ...Determine if user "JPS" workspace "1040027630222986" can develop application "106" in workspace "1040027630222986"
    0.01: ...Check for session expiration:
    0.01: Session: Fetch session header information
    0.01: ...Metadata: Fetch page attributes for application 106, page 1
    0.01: Fetch session state from database
    0.02: Branch point: BEFORE_HEADER
    0.02: Fetch application meta data
    0.02: Computation point: BEFORE_HEADER
    0.02: Processing point: BEFORE_HEADER
    0.03: Show page template header
    0.03: Computation point: AFTER_HEADER
    0.03: Processing point: AFTER_HEADER     
    0.04: Computation point: BEFORE_BOX_BODY
    0.04: Processing point: BEFORE_BOX_BODY
    0.04: Region: Auction_Title F106_AUCTION_YEAR

  • Is null validation not working correctly

    I have an application in which I have created a data entry page. We are using apex version 3.0.1.00.08.
    I have an item whose source is a database column which has a select list associated with it, as I want to show the user that they have not yet picked anything from the select list i have the lov properties set as follows:
    display null = Yes
    null display value = Please select
    I also have a page processing validation to check that the user has entered a value. the code for this validation is as follows:
    if :P1_DATA_ITEM is null then
    return 'This value for this Item must be selected before this record can be saved to the database';
    else
    return null;
    end if;
    However on the save button if but the user not selected a value for P1_DATA_ITEM so it is still showing -- please select -- the validation does not fail and lets the user save the record. This is not the behaviour that I want as I am trying to trap the fact that the user has not selected a value.
    This seems to indicate that Apex thinks P1_DATA_ITEM is not null so i checked session state for this item and it is showing %null%.
    How can I get a select list to indicate that the user has not actually selected a value but also to validate correctly, how do I deal with items when their session state is %null%.
    The only way round this issue that I have found is to use a radio button because it is obvious that the user has not yet selected a value but I would prefer to use a select list as we will need to do the same thing for other fields where a radio button would be impractical. I also need to indicate to the user that they still have to pick a value for this field and if you do not set the proprerty display null to Yes then it looks to the user as though they have selected an item becuse the first value in the select list appears.
    Can anyone advise on this.
    Regards
    Kay

    Hi Kay...
    Patrick wolf came up with this excellent piece of code here on this forum (I'd reference it but I can't find it at the moment.
    Instead of checking for the %null% state of each select list item on every page you can use this application process to do the job for you...
    Create an Application process
    -) Name: APP_Remove_NULLS
    -) Sequence: 0 (should be a number before any of your page level processes)
    -) On submit: After Page Submission - Before Computations and Validations
    BEGIN
        FOR rItem IN
          ( SELECT ITEM_NAME
              FROM APEX_APPLICATION_PAGE_ITEMS
             WHERE APPLICATION_ID   = TO_NUMBER(:APP_ID)
               AND PAGE_ID          = TO_NUMBER(:APP_PAGE_ID)
               AND LOV_DISPLAY_NULL = 'Yes'
               AND LOV_DEFINITION   IS NOT NULL
               AND LOV_NULL_VALUE   IS NULL
        LOOP
            IF V(rItem.ITEM_NAME) = '%null'||'%'
            THEN
                Apex_Util.set_session_state(rItem.ITEM_NAME, NULL);
            END IF;
        END LOOP;
    /* if you have select lists in your page zero items, remove this comment
        FOR rItem IN
          ( SELECT ITEM_NAME
              FROM APEX_APPLICATION_PAGE_ITEMS
             WHERE APPLICATION_ID   = TO_NUMBER(:APP_ID)
               AND PAGE_ID          = 0
               AND LOV_DISPLAY_NULL = 'Yes'
               AND LOV_DEFINITION   IS NOT NULL
               AND LOV_NULL_VALUE   IS NULL
        LOOP
            IF V(rItem.ITEM_NAME) = '%null'||'%'
            THEN
                Apex_Util.set_session_state(rItem.ITEM_NAME, NULL);
            END IF;
        END LOOP;
    END;This is the first thing I do when I create a new application... It removes that whole '%null'||'%' can of worms in one go...
    Gus..

  • Item not being saved when item is in a jquery modal  dialog

    Hi all,
    I followed instructions found here :
    http://shijesh.wordpress.com/2010/04/10/jquery-modal-form-in-apex-4/
    to create a jquery modal dialog, this is the code I added in html header :
    <link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/
    redmond/jquery-ui.css" type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>
    <script type="text/javascript">
    $( function() {
       $('#ModalForm').dialog(
            modal : true ,
            autoOpen : false ,
            width : 425,
            closeText : 'Close',
            stack : false,
            resizable : false,
            buttons  : {
                Cancel : function() {
                         closeForm();
                Save : function() {
                    updateMEMOVELD();
    function openForm()
        $('#ModalForm').dialog('open');
    function closeForm()
        //$('#ModalForm input[type="textarea"]').val('');
        $('#ModalForm').dialog('close');
    function updateMEMOVELD ()
       var get = new htmldb_Get(null, &APP_ID.,   
                        'APPLICATION_PROCESS=f_memo', 0);
       get.add('P9_MEMOVELD',$v('P9_MEMOVELD'));
       var gReturn= get.get();
       //alert(gReturn);
       //alert($v('P9_DATUM'));
      $s('P9_MEMOVELD',gReturn);
      alert($v('P9_MEMOVELD'));
      $s('P9_MEMOVELD_COPY',$v('P9_MEMOVELD')); 
      $('#ModalForm').dialog('close');
    </script>my situation is a little different, my modal does not have to perform an sql update, just change a field
    the user will then save in the main form
    for some reason the field never gets updated in the db
    I even created a on demand application process called f_memo :
    BEGIN
      APEX_UTIL.SET_SESSION_STATE('P9_MEMOVELD',:P9_MEMOVELD);
      htp.p(:P9_MEMOVELD);
    END;why is my field not send to the db ?
    it works when I delete this from the region header :
    < d i v id="ModalForm" title="Add Person" style=" d isplay:n one  "   >but then of course I no longer have a modal dialog
    what's wrong ?
    I put the code online at apex.oracle.com
    workspace XONIXRS
    login/password demo/demorun the application
    click on lijst facturen (invoices) (in the right sidebar region)
    then click on the zoeken (search) button
    a report appears, click on edit on the first line (200900017)
    now a form appears, click on the outright button memo
    now the modal shows up, change the field and click on save
    click on ok (for the alert) and then click on Save invoice
    you will remain on the same page
    now click on annuleren
    and then click on edit on the first line (200900017) again
    then click on memo again, you will see the memo has not been changed
    how comes ?
    Kr
    Martin

    The issue is that creating a modal of a region lifts that region from the HTML. Just have a look at the DOM when you run your page and not the source html, because that does not reflect changes to the dom made on page load. This means that your memo-field is removed from the FORM-tags, and effectively won't submit to session state. The item is not processed when you submit the page! You can track that through debugging your page. Memo is not saved and not processed.
    Trying to save the value to session state is not enough, it doesn't really matter in this case. The moment you submit the page, the session state will get overwritten by the submitted values of the items.
    So what i did:
    <ul>
    <li>move P9_MEMOVELD to region FACTUUR, together with all the other db fields</li>
    <li>change the type to hidden</li>
    <li>set value protected to NO</li>
    <li>in the modal region create a new page item P9_MEMOVELD_POP, type textfield</li>
    <li>set the source to always use a page item as source, with source P9_MEMOVELD</li>
    <li>changed function updatememoveld:
    function updateMEMOVELD ()
       var get = new htmldb_Get(null, &APP_ID.,   
                        'APPLICATION_PROCESS=f_memo', 0);
       get.add('P9_MEMOVELD',$v('P9_MEMOVELD'));
       var gReturn= get.get();
       //alert(gReturn);
       //alert($v('P9_DATUM'));
      $s('P9_MEMOVELD',gReturn);
      alert($v('P9_MEMOVELD'));
      $s('P9_MEMOVELD_COPY',$v('P9_MEMOVELD')); 
      $s('P9_MEMOVELD',$v('P9_MEMOVELD_POP'));
      $('#ModalForm').dialog('close');
    }Whether you want or need the session state set is up to you, it depends on if you use this somewhere else dynamically on the page and thus would influence results there, but i don't think it will (it's a memo field...)</li>
    </ul>
    Extra remarks:
    <ul>
    <li>be careful with including jquery libraries! The standard libraries are included, yet you add previous versions too! (1.4.2) This might lead to issues...</li>
    <li>use your templates better. Why would you wrap a region in div tags? Change or add a region template to be div tags. You can then easily assign a static id to this region, and target it. This will save you from wrapping wrapped wrappers (cause that is what the generated code looks like in the end).</li>
    </ul>

  • Ntlm authenticated apps fails after 3.1.1 upgrade

    I upgraded my apex instance to 3.1.1 on Friday without any issues. I can log into application builder without any problems and the version 3.1.1.00.09.
    Everything in app builder works as expected. However, when I try to run my NTLM authenticated application, I get errors and the page fails to load.
    Furthermore, this only happens on my 11g database.
    The exact same app, using the same NTLM authentication works just fine on 10g.
    The Apache errors log states:
    mod_plsql: /pls/apex/f HTTP-404 ORA-03113: end-of-file on communication channel\n
    mod_plsql: Unable to reset state for mode 0: Err 3114 url=>/pls/apex/f           I have PlsqlErrorStyle          DebugStyle set, so the page returns a fair amount of data.
    Wed, 28 May 2008 14:07:17 GMT
    ORA-03113: end-of-file on communication channel
      DAD name: apex
      PROCEDURE  : f
      URL        : http://ecydblcyorwqt03.ecy.wa.lcl:80/pls/apex/f?p=127:51:339228564056494:::::
      PARAMETERS :
      ===========
      p:
       127:51:339228564056494:::::
      ENVIRONMENT:
      ============
        PLSQL_GATEWAY=WebDb
        GATEWAY_IVERSION=2
        SERVER_SOFTWARE=Oracle-Application-Server-10g/10.1.3.1.0 Oracle-HTTP-Server
        GATEWAY_INTERFACE=CGI/1.1
        SERVER_PORT=80
        SERVER_NAME=ecydblcyorwqt03.ecy.wa.lcl
        REQUEST_METHOD=GET
        QUERY_STRING=p=127:51:339228564056494:::::
        PATH_INFO=/f
        SCRIPT_NAME=/pls/apex
        REMOTE_HOST=
        REMOTE_ADDR=165.151.57.100
        SERVER_PROTOCOL=HTTP/1.1
        REQUEST_PROTOCOL=HTTP
        REMOTE_USER=ECY\taus461
        ORACLE_SSO_USER=
        OSSO_IDLE_TIMEOUT_EXCEEDED=
        OSSO_USER_GUID=
        HTTP_CONTENT_LENGTH=
        HTTP_CONTENT_TYPE=
        HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
        HTTP_HOST=ecydblcyorwqt03
        HTTP_ACCEPT=text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
        HTTP_ACCEPT_ENCODING=gzip,deflate
        HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.5
        HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7
        HTTP_COOKIE=WEBWPLCS_USER=TAUS461; WEBWPLCS_LAST=04.29.2008 11:41:38; ORA_WWV_R1=%23ALL; ORA_WWV_R2=%23ALL; ORA_WWV_R3=%23ALL; ORA_WWV_REMEMBER_UN=ADMIN:webwplcs; ORACLE_PLATFORM_REMEMBER_UN=ADMIN:webwplcs; ORA_WWV_USER=3B1A5D9EA835D646; WWV_CUSTOM-F_1021906798187125_122=9F806B35C3D9AF51
        HTTP_IF_MODIFIED_SINCE=
        HTTP_REFERER=http://ecydblcyorwqt03/pls/apex/f?p=4000:4150:339228564056494::NO:::
        HTTP_SOAPACTION=
        HTTP_ORACLE_ECID=1211983633:165.151.5.125:6156:6252:488,0
        HTTP_ORACLE_CACHE_VERSION=
        HTTP_AUTHORIZATION=NTLM  xyz
        WEB_AUTHENT_PREFIX=
        DAD_NAME=apex
        DOC_ACCESS_PATH=docs
        DOCUMENT_TABLE=wwv_flow_file_objects$
        PATH_ALIAS=
        REQUEST_CHARSET=AL32UTF8
        REQUEST_IANA_CHARSET=UTF-8
        SCRIPT_PREFIX=/pls
        HTTP_IF_MATCH=
        HTTP_CACHE_CONTROL=
        SOAP_BODY=
        HTTP_X_ORACLE_DEVICE_CLASS=
        HTTP_X_ORACLE_DEVICE_ORIENTATION=
        HTTP_X_ORACLE_DEVICE_MAXDOCSIZE=
        HTTP_X_ORACLE_DEVICE=
        HTTP_X_ORACLE_ORIG_ACCEPT=
        HTTP_X_ORACLE_ORIG_USER_AGENT=
        HTTP_X_ORACLE_USER_LOCALE=
        HTTP_X_ORACLE_USER_NAME=
        HTTP_X_ORACLE_USER_DISPLAYNAME=
        HTTP_X_ORACLE_USER_USERKIND=
        HTTP_X_ORACLE_USER_AUTHKIND=
        HTTP_X_ORACLE_USER_DEVICEID=
        HTTP_X_ORACLE_USER_LOCATION_ADDRESSLINE1=
        HTTP_X_ORACLE_USER_LOCATION_ADDRESSLINE2=
        HTTP_X_ORACLE_USER_LOCATION_ADDRESSLASTLINE=
        HTTP_X_ORACLE_USER_LOCATION_BLOCK=
        HTTP_X_ORACLE_USER_LOCATION_CITY=
        HTTP_X_ORACLE_USER_LOCATION_COMPANYNAME=
        HTTP_X_ORACLE_USER_LOCATION_COUNTY=
        HTTP_X_ORACLE_USER_LOCATION_STATE=
        HTTP_X_ORACLE_USER_LOCATION_POSTALCODE=
        HTTP_X_ORACLE_USER_LOCATION_POSTALCODEEXT=
        HTTP_X_ORACLE_USER_LOCATION_COUNTRY=
        HTTP_X_ORACLE_USER_LOCATION_TYPE=
        HTTP_X_ORACLE_USER_LOCATION_X=
        HTTP_X_ORACLE_USER_LOCATION_Y=
        HTTP_X_ORACLE_SERVICE_HOME_URL=
        HTTP_X_ORACLE_SERVICE_PARENT_URL=
        HTTP_X_ORACLE_HOME_URL=
        HTTP_X_ORACLE_MODULE_CALLBACK_URL=
        HTTP_X_ORACLE_MODULE_CALLBACK_LABEL=
        HTTP_X_ORACLE_CACHE_USER=
        HTTP_X_ORACLE_CACHE_SUBID=
        HTTP_X_ORACLE_CACHE_AUTH=
        HTTP_X_ORACLE_CACHE_DEVICE=
        HTTP_X_ORACLE_CACHE_LANG=
        HTTP_X_ORACLE_CACHE_ENCRYPT=
        HTTP_X_ORACLE_ASSERT_USER=There are no invalid objects in the FLOWS schema and the page sentry function I use for NTLM is also valid.
    There isn't a database connection issue since both builder and SQL Plus works.
    Here is my NTLM Page Sentry which is a slightly modified version of the GreenIT version
    CREATE OR REPLACE FUNCTION modNtlmPageSentry(pApexUser IN VARCHAR2 DEFAULT 'APEX_PUBLIC_USER')
    RETURN BOOLEAN
    IS
      vAuthenticatedUsername  VARCHAR2(512);
      vCurrentSessionId       NUMBER;
      l_cnt binary_integer :=0;
    BEGIN
      -- Get Authenticated User.
      vAuthenticatedUsername := UPPER(owa_util.get_cgi_env('REMOTE_USER'));
      vAuthenticatedUsername := substr(vAuthenticatedUsername,instr(vAuthenticatedUsername,'\')+1);
      if to_char(v('APP_ID')) = '127' -- WebWPLCS
      then
           apex_util.set_session_state('P18_USERNAME',vAuthenticatedUsername);
      elsif to_char(v('APP_ID')) = '124' --TMS
      then
      -- check to see if they are a listed TMS manager or overall admin
          select sum(cnt) into l_cnt
          from (
               select count(0) cnt
               from tms_managers
               where username=vAuthenticatedUsername
               union
               select count(0) cnt
               from tms_admin
               where username=vAuthenticatedUsername
               union
               select count(0) cnt
               from web_admin
               where username=vAuthenticatedUsername
          if l_cnt < 1
          then
         return FALSE;
          end if;
      end if;
      -- Check to ensure that we are running as the correct database user.
      IF USER ^= UPPER(pApexUser) THEN
        RETURN FALSE;
      END IF;
      IF vAuthenticatedUsername IS NULL THEN
        RETURN FALSE;
      END IF;
      -- Get SessionId.
      vCurrentSessionId := wwv_flow_custom_auth_std.get_session_id_from_cookie;
      -- Check Application Session Cookie.
      IF wwv_flow_custom_auth_std.is_session_valid THEN
        apex_application.g_instance := vCurrentSessionId;
        -- Check Authenticated User --> Username from wwv_flow_session$ for
        --   current Session.
        IF vAuthenticatedUsername = wwv_flow_custom_auth_std.get_username THEN
          wwv_flow_custom_auth.define_user_session(p_user => vAuthenticatedUsername,
            p_session_id => vCurrentSessionId);
          RETURN TRUE;
        ELSE
          -- Unset the Session Cookie and redirect back here to take other branch.
          wwv_flow_custom_auth_std.logout(p_this_flow => v('FLOW_ID'),
            p_next_flow_page_sess => v('FLOW_ID') || ':' || NVL(v('FLOW_PAGE_ID'), 0)
            || ':' || vCurrentSessionId);
          -- Tell Apex Engine to quit.
          apex_application.g_unrecoverable_error := TRUE;
          RETURN FALSE;
        END IF;
      ELSE
        -- Application Session Cookie not valid --> Define a new Apex Session.
        wwv_flow_custom_auth.define_user_session(p_user => vAuthenticatedUsername,
          p_session_id => wwv_flow_custom_auth.get_next_session_id);
        -- Tell Apex Engine to quit.
        apex_application.g_unrecoverable_error := TRUE;
        IF owa_util.get_cgi_env('REQUEST_METHOD') = 'GET'  THEN
          wwv_flow_custom_auth.remember_deep_link(p_url => 'f?' ||
            wwv_flow_utilities.url_decode2(owa_util.get_cgi_env('QUERY_STRING')));
        ELSE
          wwv_flow_custom_auth.remember_deep_link(p_url => 'f?p=' ||
            TO_CHAR(apex_application.g_flow_id) || ':' ||
            TO_CHAR(NVL(apex_application.g_flow_step_id, 0)) || ':' ||
            TO_CHAR(apex_application.g_instance));
        END IF;
        -- Register the Session in Apex Sessions Table, set Cookie, redirect back.
        wwv_flow_custom_auth_std.post_login(p_uname => vAuthenticatedUsername,
          p_session_id => nv('APP_SESSION'), p_flow_page => apex_application.g_flow_id
          || ':' || NVL(apex_application.g_flow_step_id, 0));
        RETURN FALSE;       
      END IF;   
    END modNtlmPageSentry;Does anyone have any ideas on where to look next?
    Regards, Tony
    <b>Update</b>
    For kicks, I added the page sentry function to the list in the <b>wwv_flow_epg_include_mod_local</b> function.
    I bounced both the HTTP Server and the database.
    None of these actions solved the problem.

    Joel -
    The alert log states that there is a 7445 error now from Apache
    host_id='ECYDBLCYORWQT01' host_addr='165.151.5.123' module='Apache.exe'
    pid='416'>
    <txt>Exception [type: ACCESS_VIOLATION, UNABLE_TO_READ] [ADDR:0x0] [PC:0x69A2AB3, _pfrinstr_BRNCCOND()+39]
    msg_id='1422874948' type='INCIDENT_ERROR' group='Access Violation'
    level='1' host_id='ECYDBLCYORWQT01' host_addr='165.151.5.123'
    prob_key='ORA 7445 [pfrinstr_BRNCCOND()+39]' upstream_comp='' downstream_comp=''
    ecid='' errid='12252' ORA-07445: exception encountered: core dump [pfrinstr_BRNCCOND()+39] [ACCESS_VIOLATION] [ADDR:0x0] [PC:0x69A2AB3] [UNABLE_TO_READ] []The trace file just states the same 7445 error:
    ORA-07445: exception encountered: core dump [pfrinstr_BRNCCOND()+39] [ACCESS_VIOLATION] [ADDR:0x0] [PC:0x69A2AB3] [UNABLE_TO_READ] []The incident trace file states that the current SQL was:
    ----- Current SQL Statement for this session (sql_id=bng4udk9mvtsh) -----
    declare function x return boolean is begin
    return mergedwplcs.modNtlmPageSentry; return false; end;
    begin
    wwv_flow.g_boolean := x; end;
    ----- PL/SQL Stack -----
    ----- PL/SQL Call Stack -----
      object      line  object
      handle    number  name
    2B6ACD34      1020  package body FLOWS_030100.WWV_FLOW_CUSTOM_AUTH_STD
    2B6ACD34       662  package body FLOWS_030100.WWV_FLOW_CUSTOM_AUTH_STD
    2B6BB44C        59  function MERGEDWPLCS.MODNTLMPAGESENTRY
    2B6BBD1C         2  anonymous block
    2B6BBD1C         4  anonymous block
    2B6BC674      1815  package body SYS.DBMS_SYS_SQL
    2B6BD29C       296  package body SYS.WWV_DBMS_SQL
    2B70B5D0      1352  package body FLOWS_030100.WWV_FLOW_SECURITY
    2B70B5D0      1158  package body FLOWS_030100.WWV_FLOW_SECURITY
    2B71BA2C      8847  package body FLOWS_030100.WWV_FLOW
    2B72FB04       255  procedure FLOWS_030100.F
    2B7E4F1C        31  anonymous blockWhich makes sense given that I was trying to log into the application. All of these functions and packages are valid.

Maybe you are looking for

  • BSEG - EBELN value

    Hi All, I want the Ebeln, lifnr and matnr fields in BSEG table for Account Type = GL Accountiing. Because of performance i want to use other table to get the same datas. I checked in BSIS and BSAS table, but fields are not in the table. Could you ple

  • Suggest No. of routers in a single metro-ethernet Vlan

    Hi, Just would like to know if there is a recommended no. of routers to put into a single metro-ethernet vlan. The local Metro-ethernet provider suggest 10 routers per vlan but I think 30-50 would be OK ?

  • Oracle 8i on Win 95

    Can Oracle 8i be loaded to a machine containing Win 95. I saw a version for Win 98 but did not see one for Win 95.

  • A quicker way to backup - but one problem

    instaed of going via the backup option in itunes , i find it quicker to go into my folders and copy and paste my entire itunes folder from e drive onto an external drive, then copy and paste from the external drive onto a new computer, in say drive f

  • Problem viewing videos feeds

    I'm having a problem viewing video feeds on sites like Youtube and Veoh instead of a video showing I get a icon that looks like a lego with question marks on them now how can i correct this?