How does APEX check for null values in Text Fields on the forms?

Hello all,
How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
Declare
v_valid boolean;
Begin
IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
v_valid := TRUE;
ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
v_valid := TRUE;
ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
v_valid := FALSE;
ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
v_valid := FALSE;
END IF;
return v_valid;
END;
My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
Thanks

See SQL report for LIKE SEARCH I have just explained how Select list return value works..
Cheers,
Hari

Similar Messages

  • Checking for null value in arraylist

    Hi
    i have an excel file which i i am reading into an arraylist row by row but not necesarrily that all columns in the row mite be filled. So how do i check for null values in the array list.
    try
                        int cellCount = 0;
                        int emptyRow = 0;
                        HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(file));
                        HSSFSheet sheet = workbook.getSheetAt(0);
                        Iterator rows = sheet.rowIterator(); 
                        myRow = new ArrayList();
                        int r = 1;
                             while (rows.hasNext())
                                  System.out.println("Row # " + r);
                                  HSSFRow row = (HSSFRow) rows.next();
                                  Iterator cells = row.cellIterator();          
                                  cellCount = 0;
                                  boolean isValid = false;
                                  while (cells.hasNext())
                                       HSSFCell cell = (HSSFCell) cells.next();
                                       switch (cell.getCellType())
                                            case HSSFCell.CELL_TYPE_NUMERIC:
                                                 double num = cell.getNumericCellValue();     
                                                 DecimalFormat pattern = new DecimalFormat("###,###,###,###");     
                                                 NumberFormat testNumberFormat = NumberFormat.getNumberInstance();
                                                 String mob = testNumberFormat.format(num);               
                                                 Number n = null;
                                                 try
                                                      n = pattern.parse(mob);
                                                 catch ( ParseException e )
                                                      e.printStackTrace();
                                                 System.out.println(n);
                                                 myRow.add(n);                                             
                                                 //myRow.add(String.valueOf(cell.getNumericCellValue()).trim());
                                                 //System.out.println("numeric: " +cell.getNumericCellValue());
                                                 break;
                                            case HSSFCell.CELL_TYPE_STRING:
                                                 myRow.add(cell.getStringCellValue().trim());
                                                 System.out.println("string: " + cell.getStringCellValue().trim());
                                                 break;
                                            case HSSFCell.CELL_TYPE_BLANK:
                                                 myRow.add(" ");
                                                 System.out.println("add empty:");
                                                 break;
                                       } // end switch
                                       cellCount++;
                                  } // end while                    
                                  r++;
                             }// end while
                   } myRow is the arrayList i am adding the cells of the excel file to. I have checked for blank spaces in my coding so please help with how to check for the black spaces that has been added to my arraylist.
    I have tried checking by looping through the ArrayList and then checking for null values like this
    if(myRow.get(i)!=null)
      // do something
    // i have tried this also
    if(myRow.get(i)!="")
    //do something
    }Edited by: nb123 on Feb 3, 2008 11:23 PM

    From your post I see you are using a 3rd party package to access the Excel SpreadSheets, you will have to look in your API for you 3rd party package and see if there is a method that will identify a blank row, if there is and it does not work, then you have to take that problem up with them. I know this is a pain, but it is the price we pay for 3rd party object use.
    In the mean time, you can make a workaround by checking every column in your row and seeing if it is null, or perhaps even better: check and see if the trimmed value of each cell has a lenth of 0.

  • How to check for null values in bpel?? Please Help! very urgent!!!

    Hello Guys,
    I have a problem. I have an external webservice to which I have to post my request. My task is to create an Webservice and Service Assembly to which others would post request and get response. I have to create SA to deploy onto the bus.
    The problem is that there are optional elements in the request and response xsd's. In the Response sometimes certain feilds may come or they may not. for Example:- my response could contain a tag like this <firstName></firstName>
    I have to copy these feilds in my bpel process from one variable to another.(like in the mapper).
    My Question is , Is there any way in BPEL process or BPEL mapper where I could Check for null values in the request or response???
    Your inputs would be very helpful.
    Thanks
    Rajesh

    Thanks for replying man :)
    Ok I will be more clear.
    Here is a snippet of one of the xsd's that I am using.
    <xs:element name="returnUrl" nillable="false" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation>Partner specifies the return URL to which responses need to be sent to, in case of
    Async message model.
    </xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:anyURI">
                                  <xs:maxLength value="300"/>
                                  <xs:whiteSpace value="collapse"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
    This means that the return URL field can be there or it may not be there. But if it is there it cant be null because nillable=false. But the whole <returnURL> </returnURL> can be there or it may not be there because minOccurs=0.
    My requirement is , if returnURL is there in the response with a value, then in my BPEL mapper I should map it else I should not map it.
    Thats the issue.
    and Yes kiran, the node be non-existant.
    So can you please help me with this.
    Thanks
    Rajesh

  • How does one check for Updates...

    How does one check for Updates when :
    Registration
    Deactivation
    Updates
    Menu items are greyed out! ?

    Actually, it's a timing issue. Those items are greyed out for a couple of minutes after PPro starts. A little patience and they become available. ;)
    Cheers
    Eddie
    PremiereProPedia   (
    RSS feed)
    - Over 300 frequently answered questions
    - Over 250 free tutorials
    - Maintained by editors like
    you
    Forum FAQ

  • How to copy text from Excel to a text field in the form?

    Hi All,
    I want to copy a text from Excel or Word file and paste it in a text field in the form, How?
    I tried to use ctrl+c for copy and ctrl+v for paste but it doesn't work!

    hi, i've seen this problem before but can't remember what the solution was...
    but just by searching on this forum resulted in this link
    Re: Copy and Paste
    hope it helps

  • How do I check for null date entires using custom JScript on a SharePoint NewForm.aspx?

    Hi,
    I have the below JScript:
    /*Function to convert the US Date format to UK date format */
    function parseDate(input) {
    var parts = input.split('/');
    // new Date(year, month [, date [, hours[, minutes[, seconds[, ms]]]]])
    return new Date(parts[2], parts[1]-1, parts[0]); // months are 0-based
    /*Function to check if end date is before the start date */
    function checkDates(){
    var sd = parseDate($("input[title='From']").val());
    var ed = parseDate($("input[title='Until']").val());
    if(sd > ed) {
    alert("Please check From and Until Date");
    $("input[value$='Save']").attr('disabled', true); //hide save button
    else
    $("input[value$='Save']").attr('disabled', false); //show save button
    The above works fine for checking sd > ed but I can't seem to check for null's, I have attempted the below which doesn't work:
    /*Function to convert the US Date format to UK date format */
    function parseDate(input) {
    var parts = input.split('/');
    // new Date(year, month [, date [, hours[, minutes[, seconds[, ms]]]]])
    return new Date(parts[2], parts[1]-1, parts[0]); // months are 0-based
    /*Function to check if end date is before the start date */
    function checkDates(){
    var sd = parseDate($("input[title='From']").val());
    var ed = parseDate($("input[title='Until']").val());
    if( (sd > ed) || (sd == null) || (ed == Null) ) {
    alert("Please check From and Until Date");
    $("input[value$='Save']").attr('disabled', true); //hide save button
    else
    $("input[value$='Save']").attr('disabled', false); //show save button
    Any help appreciated.

    Hi aspnet-scotland,
    Please post ASP.NET related questions in
    ASP.NET forums where you could receive better responses.
    Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to check for null value of output parameter?

    Hi guys, I get a test procedure with 2 output parameters and do nothing:
    CREATE OR REPLACE PACKAGE BODY p_parameters_test AS
      PROCEDURE p_null_output_basetype(p1 OUT NUMBER,p2 OUT VARCHAR2)
      AS
      BEGIN
        DBMS_OUTPUT.PUT_LINE('DO NOTHING');
      END p_null_output_basetype;
    END;And I have below C# code:
    cmd.CommandText = "p_parameters_test.p_null_output_basetype";
    OracleParameter p1 = new OracleParameter("p1", OracleDbType.Decimal, System.Data.ParameterDirection.Output);
    OracleParameter p2 = new OracleParameter("p2", OracleDbType.Varchar2, System.Data.ParameterDirection.Output);
    cmd.Parameters.Add(p1);
    cmd.Parameters.Add(p2);
    try
        conn.Open();
        cmd.ExecuteNonQuery();
        if (p1.Value==null)
            Console.WriteLine("p1.Value==null");
        else if (Convert.IsDBNull(p1.Value))
            Console.WriteLine("Convert.IsDBNull(p1.Value)");
        else
            Console.WriteLine("p1 else "+p1.Value);
        if (p2.Value==null)
            Console.WriteLine("p2.Value==null");
        else if (Convert.IsDBNull(p2.Value))
            Console.WriteLine("Convert.IsDBNull(p2.Value)");
        else
            Console.WriteLine("p2 else "+p2.Value);
        Console.WriteLine("finished");
    catch......The output of it is:
    p1 else null
    p2 else null
    Does anyone have any idea why it always goes to the 'else' of the condition-branching, and how can I check if the output parameter is null?
    Thanks in advance.

    Morven... I ran into similar problems. Maybe you've found a solution of your own by now, but here's what I've learned...
    The Value property of output parameters, like p1 and p2 in your code, actually varies, according to (I think) the OracleDbType of the parameter. You've got OracleDbType.Decimal for p1 and OracleDbType.Varchar2 for p2. These look about right, since they match the parameter types in your actual stored procedure.
    After cmd.ExecuteNonQuery() executes, the respective Value properties of p1 and p2 are actually of different types. For p1, it's going to be "OracleDecimal" and for p2 it's "OracleString". Keep in miind that these are the types of the Value property of the OracleParameter objects, not the OracleParameter objects themselves.
    OracleDecimal and OracleString (and some other types like OracleDate, etc.) have an "IsNull" property you can use if you cast the Value property to its runtime type...
    if ((OracleDecimal)cmd.Parameters["p1"].Value).IsNull) { …do something… }
    else { …do something else… }
    Or maybe something like this...
    Decimal p1val = ((OracleDecimal)cmd.Parameters["p1"].Value).IsNull ? 0 : ((OracleDecimal)cmd.Parameters["AVG_SALARY"].Value).Value;
    I'll admit that expressions like this: ((OracleDecimal)cmd.Parameters["AVG_SALARY"].Value).Value look a little weird. But the "Value" of the "OracleDecimal" property is a regular .NET decimal type (System.Decimal). So, it's a "Value" of the "Value" property of the OracleParameter class.
    Even when the stored procedure returns a null, the Value property is still populated. In the case of p1, it's populated with an OracleDecimal object (actually a struct) where IsNull is true. That's why "p1.Value==null" tests false.
    From what I can see, OracleDecimal, OracleString, etc. will never be typed as DbNull, or DBNull.Value. So, that would be why Convert.IsDBNull(p1.Value)) always returns false. btw, it appears that these are Value types. That would suggest that coding something like like this, should be avoided…
    OracleString p2val = ((OracleString)cmd.Parameters["p2"].Value;
    if (p2val.IsNull) { …do something… }
    else { …do something else… }
    By assigning the value to another variable, you’d be actually creating an entire copy of the OracleString structure, which is pointless.
    I hope that helps
    Edited by: 897674 on Jan 3, 2012 10:44 AM
    Edited by: 897674 on Jan 3, 2012 10:46 AM

  • How to check for null value/field?

    Hi!
    I have created a form that is designed to calculate the rows using the FormCalc function.
    My problem is that if I have no value in the some of the rows, a 0 is automatically display as the calculated output field. If a row has no data, how can I get a null or blank field in the result (calculated field) field?
    Let's say, I have 5 rows and each row should have a calculated value in one of the fields; when I fill out only two of the rows, the remaining three rows come out with 0s in the calculated output field. I need a blank output field for the remaining calculated values instead of 0s. I am a newbie so please excuse me if I am not explaining well.
    Thanks
    Jofar1

    This is the value that I have on my calculate event: "Rate*Units_of_ServiceRow2".
    How should/can I incorporate the two codes?

  • How to check for null values in pl sql?

    Hello,
    I have an sql statement where I read the db column into a number of variables, some of the columns contain NULL values or empty varchars. How can I check if my variable contains any data?
    Thanks,
    J

    to check if your variable contain null or not use like this
    if v_variable is null if you use
    if v_variable=NULL this is right according to syntax but it will not give you desired result
    SQL> declare
      2  v_empname varchar2(20);
      3  v_comm number;
      4  begin
      5  select ename,comm into v_empname,v_comm from emp
      6  where empno=7839 and comm is NULL;
      7  dbms_output.put_line(v_empname);
      8  if v_comm is NULL then
      9  dbms_output.put_line(v_empname);
    10  end if;
    11  end;
    12  /
    KING
    KING
    PL/SQL procedure successfully completed.but if you will use = null then you will not get result
    SQL> declare
      2  v_empname varchar2(20);
      3  v_comm number;
      4  begin
      5  select ename,comm into v_empname,v_comm from emp
      6  where empno=7839 and comm is NULL;
      7  dbms_output.put_line(v_empname);
      8  if v_comm = NULL then
      9  dbms_output.put_line(v_empname);
    10  end if;
    11  end;
    12  /
    KING                   -------------king will get printed only once.
    PL/SQL procedure successfully completed.

  • Check for NULL value (Recordset field)

    Hi y'all...
    A little question, so just for the weekend...
    I've a query that returns 4 fields, the fisrt three always containing data, and the last one an integer, or NULL. If I get the value with <i>rs.Fields.Item(3).Value.ToString();</i> it always contains an integer. The NULL values are always converted to '0'.
    How can I check if it is a NULL value?

    Okey, found a workaround, using the SQL function ISNULL()...
    SELECT ISNULL(U_MyVar, 'null_value') FROM [@MyTable]
    Now I can check if the value has the value <i>"null_value"</i>. If so, that field was <i>null</i>

  • Check for NULL values

    Hi,
    I have a table with columns a1, a2, a3, a4 and a5. The column a1 is the primary key for the table. I want to check if all the other columns except a1 have null values. How can I do that?
    Thanks,
    Machaan

    For fun;
    select a1,
           a2,
           a3,
           a4,
           a5,
           nvl2(a2, 0,1) + nvl2(a3, 0,1) + nvl2(a4, 0,1) + nvl2(a5, 0,1) num_nulls
    from sample_data;
            A1         A2         A3         A4         A5  NUM_NULLS
             1          2                                           3
             2                                                      4
             3                                4                     3
             4                                4          4          2
             5                                           2          3
             6                    -2                                3
             7          1          2          3          4          0
             8         -1         -2         -3         -4          0

  • Check for null values in conditional formatting when no rows returned.

    I have a report that is showing facts for different months.
    For some months there is no row in the facts table.
    But in the report, I have to show a * when there is no data.
    If there is a row in the facts table with null value for data, the conditional formatting successfully shows a * when data is null.
    But when no row is present in the facts for a particular month , conditional formatting is unable to detect any null, as none exist.
    How we can check that no rews returned for a particular month and then show *?
    thanks

    Hi,
    which obiee version r u using?
    My Blog ref:
    http://obieeelegant.blogspot.com/2011/06/replacing-null-as-0-in-obiee.html
    in obiee10g its working fine.expect obiee11g
    also see the bug reference
    How to replace null as 0 in  obiee11g pivot table view?
    obiee11.1.1.6.0 also have the same issues.
    Thanks
    Deva

  • How does one check for view changes to avoid unnecessary reprovision?

    I have a couple of ActiveSync resources that I setup custom userforms and workflows for to sync up only a couple of attributes from each one. With ActiveSync whenever a user account is modified it processes the modified account no matter which attributes were actually modified. For example, if I want to sync the email attribute from an Active Directory resource the ActiveSync workflow receives modification events for all changes to Active Directory accounts, not just email. With my simple workflow what often happens is that I reprovision the accounts even when no changes are made. The downside of this is that the Lighthouse account is marked as being modifed by the ActiveSync proxy user even though no real changes were made and extraneous server tasks are generated that have no results.
    In my workflow I would like to somehow predetermine if the reprovision will actually make changes and if not cancel the workflow. Is there some utility class that I can use to check for modifications or some option I can pass into the reprovision workflow to accomplish this? I probably could check the user.update.accounts[resource].changes before calling reprovision but that would seem to require a lot of express coding and comparisons.

    I don't have an answer for you but I do have a question. I have been researching the issue of which channels in the 2.4 band are permitted according to law in the various countries in Europe. We have offices in Germany, France, Spain, Netherlands and England and I was wondering which channels we are permitted to use. Do you know or could you point me to a document I could read?

  • Checking for a value in a field within a subform before allowing a user to add a new Instance

    Form setup:
    Page name = Page1
    1st Subform within Page1 = Info (set to flowed)
    Objects within Info subform: Name (textfield) and Email (textfield)
    I also have a 2nd subform within Page 1 which contains an add instance button
    What I'm trying to do:
    1. The user needs to enter their Name and Email address then click "Add Instance button" to create a new instance of the Info subform :  _Info.addInstance(1);
    2. If the user fails to enter an email address, I want there to be a mesage box that infos the user that an email address is required before he/she can create a new instance. Note: It would also be nice if the cursor is Set to foucs on the email field within that particular subform instance.
    3. As long as the user tries to continue adding an instance, he/she will be denied if they do not enter an email in that instance
    4. If the user includes an email address in that instance, then the script will create add a new isntance
    5. The process should continue in this manner for each each click of the add instance button
    I presume there nees to be a loop and perhaps a somExpression scipt, but I'm not sure.
    Here's what i have so far (see below)....The script works for the first instance on the page, but it doesn't prevent new instances from being created when the email field in that "current instance" is empty. I want it to prevent the user from adding new instances if the email field is balnk in that "current instance". So, I guess I'm not sure how ot test a field in the current instance in a repeating subform.
    var vName = Info.somExpression + ".email";
        var vEmail = xfa.resolveNode(vName).rawValue;
        if(vEmail == null)
    xfa.host.messageBox("PLease enter an email address.");
    else{
    Form._Info.addInstance(1);
            var i = Form._Info.count - 1;
            xfa.host.setFocus(xfa.resolveNode("Info[" + i + "].Name")); //This set's the focus of the cursor in the Name field of the newly created subform
    Please advise, and thank you in advance!!!!!!

    Hi,
    I think you can acheive what you want just by adding "lastRow.presence = "hidden";" when you do the addInstance, so it now looks like;
    var lastRow = Form.resolveNode("Info["+(_Info.count - 1)+"]"); // Get last row
    if (lastRow.Email.isNull) // If email field empty
        xfa.host.messageBox("Please enter an email address.");
    else
        lastRow.presence = "hidden";
            var newRow = _Info.addInstance();
        xfa.host.setFocus(newRow.Name.somExpression); // set focus to Name field on the row just added
    So whenever you add a row the previous one is hidden?
    For your second issue, if you could have another button on your form, you could ask the user for a password and if they enter it correctly then show for the Info subforms, so;
    var response = app.response({ cQuestion: "Do you want to see all respones?",
                                  cTitle: "Unlock Form",
                                  bPassword: true,
                                  cLabel: "Please enter the password:" });
    if (response === "Password")
        var infoSubforms = Form.resolveNodes("Info[*]");
        for (var i = 0; i < infoSubforms.length; i++)
                    var infoSubform = infoSubforms.item(i);
            infoSubform.presence = "visible";
    You would want to password protect your template as well (in Form ... Form Properties ... PDF Security) so people couldn't just open the form and look at the password.
    Probably the simplest approach.
    Hope this helps
    Bruce

  • How can I pass URL parameter value to text field?

    Dear Masters,
    I have a text field. I want it to have a value based on the URL parameter, for example:
    http://myapplication.net:7777/pls/apex/f?p=102:1:::::P1_RTNUM:9448,P1_EMAILADD:email.add.here
    I want the value of the text field = P1_EMAILADD after the form was loaded. Also, please have it read-only.
    Thanks a lot.
    Edited by: user6368519 on Sep 16, 2009 11:39 PM

    Thanks Saad,
    Can I email you(I would need your email) for any concerns or just create a new thread for you to look?
    This is ok now. I'm sorry but I just marked this one as an "answered" one last time.
    Thanks for all the help again I appreciate it. ;)
    Thanks,
    Aaron
    [email protected]

Maybe you are looking for

  • MagSafe LED Green, but Battery Not Charging to 100%

    I got my MBP 15" (the "low"-end version) about 3-4 weeks ago. About a week ago, I noticed that when working on my computer with the AC adapter plugged in, it charged up to 98% (according to both CoconutBattery and the Mac itself) and then stopped; th

  • How to magnify text in Mail App ?

    How to magnify the mail text in Mail App ? it is not problem in Gmail or Yahoo so why not magnify in Mail App ?

  • PC to Mac Networking

    I am trying to directly connect via the ethernet ports a Panther Mac to an XP PC for the purpose of transfering music files from the PC to Mac. I have not been able to get this to work even after following the instructions I have found on the web. I

  • Add non-servlet class to Tomcat

    Hi, does anyone know, what I have to do, to be able to use a simple non-servlet class file in my jsp-pages. e.g. MyClass.class In my jsp page: <% MyClass m = new MyClass( ); %> I was told that I simply have to put it in the web-inf/classes directory,

  • Need to track windows processes through java code.

    Need to track windows processes through java code. Eg: I want to find out whether an exe file (wrun.exe) is running or stopped. Can I do it through java. If so can any one please tell me how to do it. That will be a great help. Thanks, Ramesh