apex_util.get_email returns null values

Request Express 4.1.0.00.32

I created a calculation for a page element to get the email of the user.

The page is P16_EMAIL_ADDRESS.

The calculation is a type of PL/sql. The code is:

DECLARE
L_EMAIL_RTN VARCHAR2 (240);
BEGIN
L_EMAIL_RTN: = APEX_UTIL. GET_EMAIL (p_username = > 'APP_USER');
END;

When I check the session information and debugging logs it indicates that the function is to return null.

I figured I was doing something wrong in the APEX while I created a procedure in the database called the APEX_UTIL. GET_EMAIL. I've run in debug mode and saw that he too returned null. I get the same results with the GET_FIRST_NAME and GET_LAST_NAME functions.

Can you see what I'm doing wrong? Or give an example of using these functions correctly?

Thank you

Steve

Published by: cranestar on February 28, 2012 09:28

So if you know, APEX forums supports the use of the [code] and [code /] intended to set aside code segments for ease of reading.

One thing I noticed in your sample service is this unconditional statement: RETURN NULL;

Your function can do all sorts of things, but this indicates the function always return explicitly NULL - your behavior. You must declare a variable to store the results of the function call to APEX_UTIL. GET_EMAIL() and return this variable:

create or replace function L_EMAIL_RTN
  return varchar2
 is
declare
  v_email   VARCHAR2(240);
begin
  v_email  := APEX_UTIL.GET_EMAIL(p_username => :APP_USER);
  return v_email;
end;

Tags: Database

Similar Questions

  • Terminal SYS_CONTEXT returns NULL values

    Hi, I'm working on a 10g database.

    I put a trigger on opening session in a database. who uses this query

              SELECT sys_context('USERENV',
                                     'SESSION_USER') s_user,
                      sys_context('USERENV',
                                     'OS_USER') s_osuser,
                      sys_context('USERENV',
                                     'IP_ADDRESS') s_ip,
                      sys_context('USERENV',
                                     'TERMINAL') s_terminal,
                      sys_context('userenv',
                                     'SESSIONID') s_sessid,
                      SYSDATE s_login
              FROM   dual
              WHERE  upper(sys_context('USERENV',
                                             'SESSION_USER')) IN
                      ('SYSADMN',
                        'SUPERUSER')
              AND    upper(sys_context('USERENV',
                                             'OS_USER')) <> 'SYSTEM';
    in a table.

    Why is this code return a NULL value in the terminal for some connections?

    What is the print server? or something else?

    Thank you

    IP address is not available if the client does not connect via TCP (@SID).

    So I can assume that since you are directly on the server you may not be connected through the listening port.

    Response by Anurag.
    Problem with sys_context

    HTH
    Girish Sharma

  • [CFFUNCTION return null value

    How can I return a null value when the return function is of type cfc

    Unfortunately ColdFusion doesn't have NULL values. Even if you return null from the database, it will make them in empty strings. If you return null from Java you will get variable is undefined errors.

  • bbUI.js and localStorage.getItem return null values

    Hello

    I build a WebWorks app with bbUI.js for BB10 and I run problems when I want to retrieve items of localStorage. Their storage is no problem. Here is my architecture:

    1. index.html which uses localStorage.getItem in a function ondomready for 1 screen (fueltracker.html), it works
    2. JS/Register.js with functions like registerUser(), registerEngine(), registerBrand(), registerModel() called when onclick in their respective screens, see below
    3. RegisterUser() calls register.html
    4. registerBrand() calls addCar.html
    5. registerModel() calls addModel.html
    6. registerEngine() calls addEngine.html
    7. fueltracker.html which has a few buttons that the label should be changed to values from localStorage

    The register() functions make a call to localStorage.setItem (), working (i.e. the values are defined). However, in some cases parts of objects stored in localStorage it update, so this object must be recovered first, updated and then stored again. Unfortunately the calls localStorage.getItem () does not return the value that is stored in the localStorage.

    So how does it do?

    Yes Chad, variables have been established.

    It's the same problem as this one: http://stackoverflow.com/questions/2010892/storing-objects-in-html5-localstorage (objects cannot be stored in LocalStorage, single key-value pairs, so items must be chained before putting them in the LocalStorage). The getObject() en index.html setObject methods and their use instead of getItem() and setItem() solved the problem.

  • How to return a NULL value in LOV and insert into a field of allowingNULL number 4?

    Hello

    I have the following LOV and the return_value is PeopleId which is number 4, allowing NULL. And the LOV options are as follows:

    LOV named--> select named LOV-
    Show Extra values-> no
    Dynamic translation-> - untranslated-
    The number of columns - > 1
    Display Null-> Yes
    Null-> - Select value-
    Return NULL,-> NULL value
    ^^^^^^^^^^^^^^^

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

    List of values definition:
    Select Lname | ', ' || Fname | ' ' || Mname as display_value, PeopleId as return_value
    of PEOPLETB
    where PEOPLETYPE ('i', 'HERE', 'IF')
    order by 1
    --------------

    Given that PoepleId is a number 4, allowing NULL. I want a NULL value will be inserted, if the user does not select anything in the drop-down list. It seems that I would get "ORA-01722: invalid number" error when the PeopleId msg is null (ie: user doesn't have a selection). What is the good 'return Null value' I need to put it in? I tried "NULL" (see above) or nothing, it still does not work.

    Any suggestions?

    Thank you very much
    Helen

    Hello Helen,.

    You have found one of the many sources of my frustration with APEX. Here's what I do:

    In the definition of the element in your page, go to the LOV part and implemented like this:

    Display Extra values: Yes a dynamic conversion (I ignore this)
    Number of columns: 1 display Null: No.
    Display null value: (leave blank) return Null value: (leave blank)

    An empty row is displayed when the user comes first to the screen. If they do NOT select the drop-down list, the value is left empty (null).

    If anyone has a better way, I will definitely experiment with it.

    Don.

  • getCharBoundaries returns null

    Hello

    I'm trying to reduce the text field for the simple letters and then make some animations on each letter. But, how can I find out where (position) the letters? I tried to use getCharBoundaries, but when she reached the 3rd line, it keeps returns null values. Someone knows why this happens? And what is perhaps the best way to cut text to the letters/words/strings fields?

    Thank you

    This method can not handle the paragraph characters (\n).   You can expect the same problem with tabs and carriage return.

    to remedy this, strip out and replace it with something that you can only detect a loop in the text of your main textfield.

  • PersistentStore.getPersistentObject returns the null value?

    I use a random key to retrieve a shape of the object PersistentStore

    persist is PersistentStore.getPersistentObject (KEY);.

    Works fine on the Simulator (OS 5), when I take the code signed to the device (BB OS 5.0 Bold 8900)

    For some reason, it returns null, without exception. Thereafter any API I inoke on PersistentStore / persist returns null without exception persist even when the null value.

    I don't know if it's one thing to eclipse debugger, but even if the debugger shows that objects are null. Controls null applied in the code seems to fail, what does code see these objects as non-null. Pheww! How is it possible.

    In this code still shows up as null, then safetyTable and orderedkeys. However, the value null check in the failure code.

    At a later stage in the code, when I try to access orderedkeys are null again! Are struggling with this problem for two days, all the pointers would be very comfortable.

                        persist = PersistentStore.getPersistentObject( KEY );
                        persistOrderedKeys = PersistentStore.getPersistentObject(KEY_ORDERED_KEYS);
                        safetyTable = (Hashtable)persist.getContents();
                        orderedKeys = (Vector)persistOrderedKeys.getContents();
                        if (safetyTable == null)
                        {
                            safetyTable = new Hashtable();
    
                            persist.setContents(safetyTable);
                            persist.commit();
                        }
    
                        if (orderedKeys==null)
                        {
                            orderedKeys=new Vector();
    
                            if (safetyTable.size()>0)
                            {
                                Enumeration addressKeys = safetyTable.keys();
                                while(addressKeys.hasMoreElements())
                                {
                                    orderedKeys.addElement((String)addressKeys.nextElement());
                                }
                            }
                            persistOrderedKeys.setContents(orderedKeys);
                            persistOrderedKeys.commit();
    
                        }
    

    "I don't know if it's one thing to eclipse debugger.

    I had problems of this kind when I don't have a level of operating system for the device I am debugging on.

  • GetCurrentRow returns the null value while trying to values defined in table advanced VO

    Hi all

    I'm trying to set default values to a bean advanced table according to the selection of LOV in another region. Here is the code and getCurrentRow returns the value null and null pointer exception is throwed. Please let me know where Iam going bad.

       if (pageContext. ) isLovEvent ())

    LovInputSourceId = string pageContext. getLovInputSourceId ();

       if ("poNumber". ) is equal to ()lovInputSourceId))

    pageContext . putDialogMessage (new OAException()"inside Onclick"));

    OAViewObject VO = (OAViewObject) am . findViewObject ()"L3APNonprojbasedpoVO1");

    VO1 OAViewObject = (OAViewObject) am . findViewObject ()"L3APCodingInfoEOVO1");

      VO . setWhereClause (null);

      VO . setWhereClauseParams (null);

      VO . executeQuery ();

      VO1 . setWhereClause (null);

      VO1 . setWhereClauseParams (null);

      VO1 . setWhereClause ("1=2");

      VO1 . executeQuery ();

       if (null! = VO )

       Row ReqRow = (Row) VO.first();  

       if (null ! = ReqRow )

       int idx = VO . getRowCount ();

       for (int xx = 0; xx < idx ; xx ++)

    String Description = (String)VO. getCurrentRow (). getAttribute ()"ItemDescription");

       Number Amount = (Number)VO. getCurrentRow (). getAttribute ("Amount");

       String Company = (String)VO. getCurrentRow (). getAttribute ("Company");

    String ProfitCenter = (String)VO. getCurrentRow (). getAttribute ()'ProfitCenter');

       String Dept = (String)VO. getCurrentRow (). getAttribute ("Dept");

       String Lob = (String)VO. getCurrentRow (). getAttribute ("Lob");

       String Account = (String)VO. getCurrentRow (). getAttribute ("Account");

    pageContext . putDialogMessage (new OAException()"inside loops'));

       if (null! = VO1 )

      { am. invokeMethod ("createRow");

    VO1 . getCurrentRow (). setAttribute ()'Description',Description);

      VO1 . getCurrentRow (). setAttribute ("Amount",Amount);

      VO1 . getCurrentRow (). setAttribute ("Company",Company);

      } ReqRow = (Row)VO.next(); }

       else {}

    }

    }

    Here is the method in AM.

    Public Sub createRow()
    {

    OAViewObject vo = (OAViewObject) getL3APCodingProjectEOVO1 ();

    vo.clearCache ();

    If (!) VO.isPreparedForExecution ())
    {
    System.out.println ("project VO executed");
    vo.setWhereClause (null);
    vo.setWhereClauseParams (null);
    vo.setWhereClause ("1 = 2");
    vo.executeQuery ();
    }
    Line = vo.createRow ();
    vo.insertRow (row);
    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

    I modified your code a bit. This code does not require a method of AM.

    If the problem still not solved.

    If you want you can try this and let us know what happens.

    if (pageContext.isLovEvent())
    {
       String lovInputSourceId = pageContext.getLovInputSourceId();
       if("poNumber".equals(lovInputSourceId))
      {
      pageContext.putDialogMessage(new OAException("Inside Onclick"));
      OAViewObject VO=(OAViewObject)am.findViewObject("L3APNonprojbasedpoVO1");
      OAViewObject VO1=(OAViewObject)am.findViewObject("L3APCodingInfoEOVO1");
      VO.setWhereClause(null);
      VO.setWhereClauseParams(null);
      VO.executeQuery();
    
      VO1.setWhereClause(null);
      VO1.setWhereClauseParams(null);
      VO1.setWhereClause("1=2");
      VO1.executeQuery();
    
      if (VO != null)
      {
      for( Row ReqRow = (Row) VO.first();  ReqRow != null; ReqRow = (Row) VO.next())
      {
      String Description = (String)ReqRow.getAttribute("ItemDescription");
      Number Amount = (Number)ReqRow.getAttribute("Amount");
      String Company = (String)ReqRow.getAttribute("Company");
      String ProfitCenter = (String)ReqRow.getAttribute("ProfitCenter");
      String Dept = (String)ReqRow.getAttribute("Dept");
      String Lob = (String)ReqRow.getAttribute("Lob");
      String Account = (String)ReqRow.getAttribute("Account");
      pageContext.putDialogMessage(new OAException("Inside for Loop"));
    
      if (VO1 != null)
      {
      Row newRow  = VO1.createRow();
      newRow.setAttribute("Description",Description);
      newRow.setAttribute("Amount",Amount);
      newRow.setAttribute("Company",Company);
      VO1.insertRow(newRow);
      }
      }
      }
      }
    }
    

    See you soon

    AJ

  • FND_PROFILE. VALUE('ORG_ID') returns null

    Hello world.
    FND_PROFILE . VALUE ('ORG_ID') always returns Null when I select double as follows

    SELECT FND_PROFILE. VALUE('ORG_ID')
    FROM DUAL;

    OR if I'm doing assignment as follows

    *: V_ORG_ID: = FND_PROFILE. VALUE ('ORG_ID'); *

    What is causing the problem, it's a configuration problem or what?

    What is your version of the application?

    Please see these documents.

    After the Patch 8222387 why Fnd_profile. Value('Org_id') return no value [ID 784279.1]
    Conc programs using the Fnd_profile parameter. Value (Org_id) Get Apps-Fnd-01436 [ID 784489.1]
    FND_PROFILE. VALUE('ORG_ID') returns-1 [1235274.1 ID]
    Package Fnd_Global - Fnd_Global.Resp_Id, Fnd_Global.Form_Id, Resp_Id, $form_id, Form_Appl_Id are equal to-1 [960111.1 ID]
    An incorrect value in the block: field $ $ $Profiles: Org_id [876402.1 ID]

    Thank you
    Hussein

  • IDHostAdapter.getInstance () .getXMPString (doc); Returns a null value

    Hello

    I'm trying to read and modify a document XMP data, but I always get a null value when playing it.

    In addition,

    IDHostAdapter.getInstance () .setXMPString (doc, updatedXMPString);

    does not either;

    App: application var = InDesign.app;

    var doc: Document = app.activeDocument;

    var idh:IDHostAdapter = IDHostAdapter.getInstance ();

    var xmpString:String = idh.getXMPString (doc);

    var warpxmpContext:WARPXMPXMPContext = new WARPXMPXMPContext (xmpString);

    warpxmpContext.wARPXMP.publicacion = "periodico";

    var updatedXMPString:String = warpxmpContext.serializeToXML ();

    IDHostAdapter.getInstance () .setXMPString (doc, updatedXMPString);

    var xmpString2:String is IDHostAdapter.getInstance () .getXMPString (doc);.

    Any ideas?

    Thank you

    Hello

    We have an updated version of the adapter host available for download InDesign library:

    http://cssdk.host.Adobe.com/SDK/1.5/patch/id_hostadapter_mac.zip

    Regarding the examples, please see the AssetFragger CS extension example which shows the adding/changing metadata XMP using XMP Namespace Designer and library InDesign Host Adapter.  This extension is available in Builder Extension CS under file > import > CS Extension Builder > samples.  For more information, please visit http://www.adobe.com/devnet/creativesuite/samples.html

    Kind regards

    LEA

    From: Adobe Forums [email protected]<>[email protected]>

    Reply-To: "[email protected]<>[email protected]> ' [email protected]<>[email protected]>" "

    Date: Saturday November 5, 2011 19:45:40 + 0000

    To: laboratory user [email protected]<>[email protected]>

    Topic: IDHostAdapter.getInstance () .getXMPString (doc); Returns a null value

    Re: IDHostAdapter.getInstance () .getXMPString (doc); Returns a null value

    created by substances. http://forums.adobe.com/people/Harbs. > in Creative Suite Extension Builder - see the discussion complete onhttp://forums.adobe.com/message/4009511#4009511

  • Returns the null value in HasMap.get ().

    Hi all.
    Just read the docs of java on hashmap and was interested in this topic the get() method:

    A NULL return value does not necessarily mean that the map contains no mapping for the key; It is also possible that the map explicitly maps the key null. The containsKey operation may be used to distinguish these two cases.

    I took in a case, which has been talked about: If the map allow nulls, returned by get() null will be just one key of the pair-> null value. But the second case is not clear to me. Please, show me an example for the latter case, when get() can returned null.

    sphinks wrote:
    I took in a case, which has been talked about: If the map permits null values, returned by get() null will be just a key pair-> null value. But the second case is not clear to me. Please, show me an example for the latter case, when get() can returned null.

    There is no second case. There is a single case, if you put a null value in a map, get() will return null. And because of that, if you need to know if a certain key is in the containsKey() worksheet should be used instead of the get() method.

  • return type is not specified... return type so how you return a null value

    My problem seems to be when no results are returned, I would return the same type of object, but as a null value, or almost, I think that's what I would do. If someone could please throw some light on how I should return a null object I would be very grateful.

    I should note I've already tried to return entityNew ("someObj") and which resulted also in failure.

    <!--get some object-->

    < cffunction name = "getSomeObject" returntype = "someObj" = "remote access" >

    < name cfargument = "client_key" required = "true" type = "string" >

    < name cfargument = "customer_id" type = "string" required = "true" / >

    < cfscript >

    value = [];

    value = entityload ("une_table", {client_key = "#client_key #", customer_id = "#customer_id #"});

    If (ArrayLen (value) == 1)

    {

    Returns the value [1];

    }

    return;

    < / cfscript >

    < / cffunction >

    < / cfproperty >

    Thank you in advance!

    You do something like ?

    If so, then again CF has no concept of null so you cannot assign to a variable CF.  If you return null, first change your attribute of the returntype to "any" and return it directly,

  • resolveNode returns a null value when a variable is used.

    LiveCycle Designer ES2, latest version

    Hello

    The following Javascript code, in the click event of a button, returns a null value for the variable opaque. When I manually enter the expected value the script works perfectly.

    I tried various modifications of the resolveNode line such as var opaque = xfa.resolveNode (qPage); , but without success.

    Also studied all the documents reference Adobe that I could find on the scripts and resolveNode. Any suggestions?

    var qPage = (Cell12.rawValue + "AnchorField");
    App.Alert (qPage);
    Opaque var = xfa.resolveNode ("' $... qPage '");
    App.Alert (opaque);
    var nPage = xfa.layout.absPage (opaque);
    App.Alert (nPage);
    xfa.host.currentPage = nPage;

    Thank you

    Ron

    I tried your sample and it seems to work very well... but I'm not sure 100% that you are trying to do... .going to your initial question on the passage of a variable in the resolveNode resolveNode expects a string, so you must use the following syntax to create the string:

    xfa.resolveNode ("$.." + qPage)

    Note that the variable is outside the quotes as such the string $... is added to the content of qPage. This wil work if qPage is a string as well.

    In your example you have defined qPage as an XFA object so that the syntax above will not work. If you intend to use the same way, you would use qPage.name so that the name of the field will be returned (this is a string) and it will be added to your expression of $ to make the $... ProductAnchorField

    Thus, the expression would be:

    xfa.resolveNode ("$.." + qPage.name)

    Make sense?

    Paul

  • VO.getCurrentRow () returns a null value

    Hi, OTN

    In short, the scenario is:
    View object is based on an entity. There is a form to the JSF page.
    I select a record by clicking next and previous. Then I click on create to display empty fields for the new record.
    When I click on the button, I need to register a field value and a default value for the new fields to records.

    How to:
    I have created a support bean and added customCreateMethod. To start, I want to get the value of current row field, but I can't get the current line.

    public String customCreateMethod() {}

    String amDef = "pattern. AppModule. "
    Config = "AppModuleLocal";

    Am = ApplicationModule
    Configuration.createRootApplicationModule (amDef, config); non-null

    ViewObject vo = am.findViewObject("ContentVersionView1"); non-null


    = problem here:
    vo.getCurrentRow (); Returns a null value

    System.out.println ("index:" + vo.getCurrentRowIndex ()); always returns 0
    }

    I tested variable vo by this code:

    While (vo.hasNext ()) {}
    Line = vo.next ();
    System.out.println (Row.GetAttribute ("IdContent"));
    }

    It works fine.


    How should I me current line?

    Thank you

    Hello

    createRootApplicationModule creates the new instance of the application module, thanks to which you did not receive the current line. Use the code posted by Timo in [this post | http://forums.oracle.com/forums/thread.jspa?threadID=933022] (which has been marked as correct) to get the instance of module of the application.

    Jean Lou

  • XMLDOM. Item returns a null value

    Hi, I have a little problem with xmldom.item treatment.

    For some reason, this statement returns me null and I don't know the reason why, here is a sample of what I'm doing:

    Select MENSAGEMXML in the R_BD_SS_XML_SP lobExistente where idSP = P_idSP;
    parserXML: = xmlparser.newparser;
    XMLParser.parseclob (parserXML, lobExistente);
    documentoExistente: = xmlparser.getdocument (parserXML);
    XMLParser.freeparser (parserXML);

    parserXML: = xmlparser.newparser;
    XMLParser.parseclob (parserXML, P_documento);
    documentoNovo: = xmlparser.getdocument (parserXML);
    XMLParser.freeparser (parserXML);

    listaNosAAdicionar: = xmldom.getElementsByTagName(documentoNovo,'R_Acti_API_SP');

    listaRootNode: = xmldom.getElementsByTagName(documentoExistente,'ListagemAvarias');


    rootNode: = xmldom.item (listaRootNode, 0);
    Size: = xmldom. GETLENGTH (listaNosAAdicionar);
    dbms_output.put_line (' we have ['| size |'] our add para.');


    Contador in 0.tamanho - 1 loop
    dbms_output.put_line (' #' |) Contador);
    n: = xmldom.item (listaNosAAdicionar, size);
    Xmldom.isnull (n) = FALSE then if - <-this allways failure condition why is - what happens if contador reiterated 7 times?
    dbms_output.put_line (' node: ' | xmldom.getNodeName (n) |'. ');
    outroN: = XMLDOM.importnode (n, documentoNovo, true);
    on the other
    dbms_output.put_line ('node does not exist');
    end if;
    end loop;

    OK, if the stetement

    Size: = xmldom. GETLENGTH (listaNosAAdicionar);

    the value 7 which meens that listaNosAAdicionar made of nodes inside why

    n: = xmldom.item (listaNosAAdicionar, size);

    allways return null?

    I use Oracle 9i.

    Thank you
    Best regards
    João

    Published by: João Lopes on July 6, 2009 09:29

    Shouldn't this line

    n: = xmldom.item (listaNosAAdicionar, size);

    be

    n: = xmldom.item (listaNosAAdicionar, contador);

    While you're picking up each element in the list as you go through the loop?

Maybe you are looking for