When null!=null :(

hello all,
having a small issue today... i can't test for null correctly. here's some code...
<%
String thisString = null;
String thisString_sent = request.getParameter("thisString");
if (thisString_sent!=null) {
out.println(thisString);
%>
<form method="post" action="#">
<input type="button" onclick="form.submit();">
<input type="hidden" name="thisString" id="thisString" value="<%=thisString_sent%>">
</form>
when the form is submitted and thisString is null, the if statement doesn't consider the string to be null and prints "null". weird. I've also tried:
if (!thisString_sent.equals(null)) but i get a nullpointerexception... why is this happening?
signed,
newb

Well, because thisString_sent is never assigned a value.
This is what happens:
(1) you load the page and thisString_sent becomes null because request.getParameter("thisString") returns null.
(2) you post your form sending the hidden input 'thisString' with the value of thisString_sent, which is null
(3) the page is loaded and once again thisString_sent becomes null because request.getParameter("thisString") returns null.
(4) and so on and so on
Try making the input a textfield, remove the value="<%= thisString_sent %>" and input some string and post it.

Similar Messages

  • CREATE DIMENSION SKIP WHEN NULL Syntax

    I noticed in Oracle 11GR2 that the CREATE DIMENSION has been enhanced to include a SKIP WHEN NULL option. Do anyone know the behaviour of this option as the documentation is relatively light?
    Thanks John

    I thought it was quite well described in the documentation...
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5006.htm#SQLRF01206
    >
    level_clause
    The level_clause defines a level in the dimension. A level defines dimension hierarchies and attributes.
    level Specify the name of the level.
    level_table . level_column Specify the columns in the level. You can specify up to 32 columns. The tables you specify in this clause must already exist.
    SKIP WHEN NULL  Specify this clause to indicate that if the specified level is NULL, then the level is to be skipped. This clause lets you preserve the hierarchical chain of parent-child relationship by an alternative path that skips over the specified level. See hierarchy_clause .
    Restrictions on Dimension Level Columns Dimension level columns are subject to the following restrictions:
    All of the columns in a level must come from the same table.
    If columns in different levels come from different tables, then you must specify the dimension_join_clause.
    The set of columns you specify must be unique to this level.
    The columns you specify cannot be specified in any other dimension.
    Each level_column must be non-null unless the level is specified with SKIP WHEN NULL. The non-null columns need not have NOT NULL constraints. The column for which you specify SKIP WHEN NULL cannot have a NOT NULL constraint).

  • Error in when null values are passed to datefield

    Hi all,
    We are facing some issue with null values in date fields while calling a stored procedure using JDBC Adapter in one of the interfaces.
    When the value is null, XI gives errors in the communication channel.
    Case 1 , When the value is mapped to blank. : The adapter gives an error related to date format. Unsparseable date “”.
    Case 2 , When the value is not mapped at all : The adapter gives an error related to wrong number of arguments for the stored procedure.
    One option for fixing this issue is to hardcode the value to all zeros in a appropriate date format. However this is not acceptable in our case.
    Did anybody face this issue before. If yes what was the approach taken. Can you please let me know if anybody has any inputs on this.
    Thanks in advance,
    Younus

    you can clear the field key tags mandatory in the XML Schema interpreter parameter and make the Empty string value to Empty string from null value.
    For mapping : you can pass a value that is of the same format of date; but you can take your own value in the database since you are parsing the date format from one to other
    thanks
    nikhil

  • Item using source, even though it's supposed to be only when null.

    I have an interactive report on one page. When I click on the edit icon for a row, it successfully sets the value for the address id on the following page to the appropriate value from the row, let's say 8429.
    On the following page, there is an item, P31_XADDRESS. If it is a new address, then the session value should be null, so it populates it by a SQL Query. This source is set to be used Only when current value in session state is null.
    Session state is not null, it is 8429. However, P31_XADDRESS is using the SQL query anyway, thus creating a new number, let's say 8430.
    Any idea why this is happening, or how to fix it?

    Well, your question led me to the answer to my question. Turns out that there are two similar fields, P31_ADDRESS_ID and P31_XADDRESSID. I changed the link column to set both of them to #ADDRESS_ID#, and the problem seems to be resolved.
    Thanks.

  • Case when null statement

    Afternoon Folks,
    The line highlighted in Bold is where I have the issue. I want it to pick up NULL or Blanks in the method type has well as types E,G,T. I've tried NULL is the statement, "", and '' put none of these work. What am I doing wrong? I'm using 11g by the way
    select specialty,
    member_id,
    sp_id,
    service_date,
    sum(case when method_type = 'C' then (payment_total) end) "CONSULTATION",
    sum(case when method_type = 'M' then (payment_total) end) "MOT",
    sum(case when method_type = 'D' then (payment_total) end) "TESTS",
    sum(case when method_type in ('E','G','T') then (payment_total) end) "OTHER",
    sum(payment_total) "TOTAL"
    from a3_fact_sms_service_inv
    where specialty in ('Chiropody','Podiatry')
    and service_date between date '2011-01-01' and date '2011-12-31'
    group by specialty,
    member_id,
    sp_id,
    service_date
    order by specialty,
    member_id,
    sp_id,
    service_date

    957099 wrote:
    Afternoon Folks,
    The line highlighted in Bold is where I have the issue. I want it to pick up NULL or Blanks in the method type has well as types E,G,T. I've tried NULL is the statement, "", and '' put none of these work. What am I doing wrong? I'm using 11g by the way
    select specialty,
    member_id,
    sp_id,
    service_date,
    sum(case when method_type = 'C' then (payment_total) end) "CONSULTATION",
    sum(case when method_type = 'M' then (payment_total) end) "MOT",
    sum(case when method_type = 'D' then (payment_total) end) "TESTS",
    sum(case when method_type in ('E','G','T') then (payment_total) end) "OTHER",
    sum(payment_total) "TOTAL"
    from a3_fact_sms_service_inv
    where specialty in ('Chiropody','Podiatry')
    and service_date between date '2011-01-01' and date '2011-12-31'
    group by specialty,
    member_id,
    sp_id,
    service_date
    order by specialty,
    member_id,
    sp_id,
    service_dateWell, effectively the in is like saying method_type = 'E' or method_type = 'G' or method_type = 'T'
    and so trying null as well in the in-list would be ...or method_type = null which won't work
    as null isn't equal (nor not equal) to null.
    so you could try
    sum(case when method_type in ('E','G','T') or method_type is null then (payment_total) end) "OTHER",or use nvl
    sum(case when nvl(method_type,'X') in ('E','G','T','X') then (payment_total) end) "OTHER",where 'X' is a value you definitely don't (and won't) use as a real value in method_type.
    (Not tested as you didn't provide create table statements or inserts of test data).

  • Calculation fields need to hide $0 and 0% fields when null

    Adobe Live Cycle Designer 8.0
    I have my Before DIR% calculated by dividing (TotalDebts/TotalIncome*100) and have it show up as a percentage (ie 26% OR  31% instead of .26 or .31). I need it to show up blank if there isnt anything going on. Same for "After DIR" and "% Unsec to Inc". I also have another from with the same exact problem but it calculates a $0. How would make these 0's show up blank when no calculation is currenlty happening?  I am trying to get them to show up as blank so if needed I could print out the form and hand write it and NOT have the 0% show up.

    If you set the Pattern display on the calculated cell to allow zeros and/or null then if both of the numericFields are 0, then the calculated cell is blank; not 0. Just select the calculated cell that has the 0, then in the Object tab select the Field tab, and there should be a "Patterns" button you can click. Select "Display" from the drop down box after hitting "Patterns", and then check the fields "Allow Empty" and/or "Allow Zero". Should not display the 0 once you have those set.

  • IChart Trend does not refresh when NULL returned

    I have a problem with an iChart displaying a trend. The chart receives data based on a selection from a dropdown box. Everything works fine as long as there is data, the trend updates correctly for the line selected from the dropdown. If, however, you select a line that is down, no current data available, then the iChart continues to display the trend from the last selection. These are based on a query that runs when a new selection is made and a button clicked.
    When the page is first opened the iChart is blank until a selection is made. If the frame is refreshed, it refreshes the iChart to a blank state until a selection is made. What we need it to do is reset it to blank when no data is returned from the query, rather than caching the previous trend.
    Any suggestions greatly appreciated.

    Mark,
    Three dashes (---) and 12/31/1969 dates are an indication that the InitialUpdate has been suppressed for the chart, meaning it doesn't run the query template.  Because the query is time based, but does not actually run the query it has 'null' dates to display for the start and end.
    There is currently no way to use JavaScript to tell the iChart applet to revert back to this state.  Your best alternative may be to run a query that returns no values to display (something that doesn't produce a FatalError, which would lead to the 'No Data Available' message).
    Regards,
    Jeremy

  • Sqlldr / WHEN NULL

    Hi,
    here my script :
    LOAD DATA
    INFILE '../data/offer.txt'
    APPEND
    INTO TABLE base_offer_id
    WHEN (78:91) != BLANK
    ID POSITION(01:08) CHAR,
    PREF POSITION(09:10) INTEGER EXTERNAL
    What I want is: do not load row when (78:91) is null, something like
    WHEN (78:91) ISNOT NULL
    but it sqlldr doesn't understand this and BLANK is not the same as NULL. So I don;t know how to perform the test.
    Thanks, Ronan.

    Hi,
    Doesn't work :
    SQL*Loader-350: Syntax error at line 5.
    Expecting quoted string or hex identifier, found "CHR".
    WHEN (78:91) != CHR(0)
    ^
    I tried with != 0, != 0x0 as well without success.
    Thanks, Ronan.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by johna:
    Ronan,
    Change your WHEN condition "WHEN (78:91) != BLANK" to
    WHEN (78:91) != CHR(0)
    This should check for the null value.
    Regards,
    John<HR></BLOCKQUOTE>
    null

  • Superposed fields when null value

    Hi all,
    There is one repeating frame , say R1, which contains two other repeating frames , say R2 and R3.
    The group of R1 is the master group , and the groups of R2 and R3 are details of R1's group ( foreign key ) .
    I have created a formula column in the two detail groups , one in each other , and they may return null.
    My problem is when the return value is null then all the fields below the two fields associated for the formula columns come taking the place of the two fields , something like they are put over the two fields. And the report is not very good to look at this moment.
    I have tried to anchor each detail repeating frame to the text label of the field but the problem is not resolved. The report is even more bad when there is null value.
    So how to prevent this problem of misplacement.
    Thank you very much indeed.

    Try to change Vertical and Horizontal elasticity from Variable/Contract to Expand. See if it works

  • Borders are not appearing when null coming from database

    Hello all,
    Right now i am working on a report where i am getting data from stored procedure(sql server). The report is having 15 columns so i have created like multi line report and applied borders to each item. so the report look like a table. But the problem is there are some columns whose values in database are null. Beacuse there is no data coming from db these borders are not appearing on report.
    I know that we can write a formula in crystal by isnull function to get these borders. But want to do everthing on the stored procedures. Please help me on this.
    Thanks & Regards
    Ram

    Convert the null to 0 or " " using formula before placing it to the table/cross tab. This might helps.
    Nevermind because you know the above solution.
    You can do one more thing too, if you are not applying any calculations like runing total  to any of the column from those 15 column, place each of column in either tax-box (if numeric, covert it to text) or just use the box and lines to draw the table and expand the box and lines till end of group footer.
    -Bshukla
    Edited by: Bshukla on Aug 16, 2010 2:34 PM

  • XML not generating when null data present in the table

    Lets consider employee and dept tables and say one employee works in multiple departments,
    Dept table data:
    case1:
    emp_id     dept_name      dept_id
    1     Oracle     55
    1     Datawarehouse     56
    case 2:
    emp_id     dept_name      dept_id
    2     Oracle     55
    2     Datawarehouse     56
    2     Clearing House     
    2     Java     
    In Production environment, the below code generates xml for case 1 but not for case 2. In test environment , xml is getting generated for both the cases. It looks like null handling issue but why the same code behaves differently in qa and prod. dbms_xmlgen.getXML is not generating any exceptions. Any help would be appreciated.
    DECLARE
    ctx dbms_xmlgen.ctxHandle;
    xml CLOB;
    emp_no NUMBER := 7369;
    i PLS_INTEGER;
    BEGIN
    ctx := dbms_xmlgen.newContext('SELECT emp_id,name,salary, cursor(select emp_id, dept_name,dept_id from dept b where a.emp_id=b.emp_id) FROM emp a WHERE a.empno = '|| emp_no);
    xml := dbms_xmlgen.getXML(ctx);
    i := dbms_xmlgen.getNumRowsProcessed(ctx);
    dbms_output.put_line(TO_CHAR(i));
    END;
    Edited by: user512219 on May 22, 2012 12:52 PM

    Give the database version anyway, it could be a known bug.
    Are the NULL column(s) part of the join predicate?
    It's difficult to help in this situation, nobody but you has the real test case, so try to give as much details as possible.
    Wild guess : does this make a difference?
    dbms_xmlgen.setNullHandling(ctx, dbms_xmlgen.EMPTY_TAG);Edited by: odie_63 on 22 mai 2012 23:40

  • Skip hierarchy level when null is present

    Hi All,
    Can we skip a level from dimension hierarchy if there is a null value. If so can any one please tell me how can we achieve this.
    Thanks in advance

    Hi Venkat,
    Thanks for the reply....
    Case is in my dimension hierarchy i have a parent level which have multiple leafs at same level. As shown below..
    A-->
    .....B-->
    ..........C-->D
    ..........E-->F
    ..........G-->H
    So my drills are like A->B->C->D->E->F->G->H . In the case where 'C' column has null value then the drill downs are same A->B->C->D->E->F->G->H showing null value in the column.
    My requirement is , if column 'C' has null value then it should skip the level 'C' and move on to 'E' like A->B-->E->F->G->H and so on..
    Thank you.

  • Need to run the report for All Values when Null is passed in parameter

    Hi All,
    In my BIP report, I am using a parameter :asset with Type as Text, which means user will type the values for the parameter in the text box.
    Now, this parameter can take multiple comma separated values. I have a requirement to run the report for All Values when user doesn't enter any value in the parameter text box and if user enters any value(s) then the report will run for those values . The way, I tried to handle that in the query using couple of ways was :
    IMP : My Database is SQL Server
    where
    (table.asset = isnull((:asset), table.asset) or table.asset in (:asset))
    Now this works fine when I give a single asset number but when I give multiple values separated by comma like 123, 345 in the text box, then the statement fails saying 'encountered ,'
    I also tried simply
    table.asset in isnull((:asset),table.asset) -- but this doesn't work as it doesn't allow me to use in operater while using isnull and if i will use = operater then it won't work in case of multiple values
    Any suggestions on how can I handle this? Any help would be highly appreciated.
    Thanks,
    Ronny

    thanks for replying, but i tried this option too, it did not work for me, neither isnull nor coalesce. I mean, the solution work for single value but when i pass multiple values then separated by a comma then it doesn't work and shows me an error like "Incorrect Syntax ','". I am using SQL server as DB and bip is 10.1.3.4.1
    also please share the SR number, so i can also check the same.
    can there be any other work around to this?
    thanks,
    ronny

  • TableView: selectedRowKey=" %=selected% " fails when null

    Hello,
    having a HTMLB:TableView and the key column being PersNo (a NumC 8) it is not possible to define an unselected state for my table view when using the selectedRowKey attribute:
    selectedRowKey="0" or selectedRowKey="00000000"
    works fine, but as soon as this is a variable of the same type as the key column
    selectedRowKey="<%=selected%>"
    is get an exception claiming that the key value does not exists.
    Yes, and this is right, because there may be initial states where the selected row is not defined. If the "selected" thingy is filled with an existing key, it works fine.
    Of course cannot simply alternate using an inline IF cos that is not possible within attributes and leads to compiler error when doing an IF-ELSE-ENDIF around the entire htmlb:tableView element (not well-formed; tag must be closed) - one that contains selectedRowKey and one one not; depending on an initial "selected".
    Any ideas why using a variable fails but not specifying  the same value manually in HTMLB? Or better: what is the solution to get it working for me?
    Thanks and regards,
    Timo

    Hello Durairaj,
    Yes, that was the solution. I played with the leading zeros before but forgot that the NumC will revert to its defaults.
    So, I now use a String that I fork in the frontend:
    if the passed NumC is greater than 0 I move it over, otherwise, I manually set '0'.
    That works, although it is interesting to see that the selectedRowKey var I use is of the same type as the tables key column type
    Thanks all!
    Regards,
    Timo

  • Session State is set to null when tab (from List) is clicked

    Hi Gurus, et al,
    Database: 10g Rel 2
    APEX: 4.1.2
    My application uses a tabbed navigation list to tab through different sections of the form. Each tab issues a doSubmit('tabname');. My application also uses Page 0 for regions that are common to several forms. When I tab through the form (called requisition), the session state for the page items is set to null while the page 0 remains intact. It seems like the doSubmit sets the page items to null. How can I prevent this from happening?
    Also, it still happens on APEX 4.2.1 because I put the application on APEX.ORACLE.COM:
    Workspace: RGWORK
    Application: CSRSR (Application 60220)
    Page: 8
    Username: tester
    Password: test123
    Please follow these steps for this issue to occur
    1. Run application 60220
    2. Select the only choice on the menu (Creative Services Design Requisition (PA 0879))
    3. List of Outstanding Requisitions is displayed
    4. Click the edit icon next to the requisition Project Description is 'zazaza'
    5. Change Date Needed to 3/31/2013
    6. Click on the Project Type tab
    7. All items are null for that tab (project type in the database = 'frame:dec')
    Robert
    http://apexjscss.blogspot.com

    Denes,
    While I appreciate your professional opinion, the issue still remains. I may not have the described the issue clearly. It seems that while the row is initially fetched (source type is only when null), project type and purpose items are not displayed initially with the infomation from the table when the appropriate tab is clicked. For example, while the row contains 'frame:dec' for project type, those checkboxes are checked on on the screen.
    The form is "complex" for the following reasons:
    1. Uses a wizard for new requisitions
    2. Uses tabs for updates
    3. Uses a Modal page to display outstanding requisitions for the user before the form is displayed
    4. Uses common regions (on page 0) with other pages (3 pages uses project information, delivery, requesting department, and chargecode regions.
    5. Authorized approvers popup list are populated
    6. Manual tabular form is used for framing information including collections
    I tried to uses application processes, application computations, package procedures and functions whenever possible.
    SOMEONE, PLEASE HELP!
    Robert
    http://apexjscss.blogspot.com

Maybe you are looking for

  • Play Symbol To A Label From Wherever It Currently Is

    Perhaps I do not understand this right How do I get a symbol to play from wherever it currently is to a label? Could be forwards or backwards This works fine - Play the symbol to the end sym.getSymbol("digit_02").play(); And this works fine - Play th

  • RawShooter registered email address changed

    My RawShooter registered email address has changed. How do I get my new email address to Adobe so I can receive my free download of Lightroom 1.0?Thank you...

  • How to change sales organization input help search view in trade promotion?

    Hi, We are creating trade promotions. While creation, we have to select sales organization. We press the input help button of field sales organization, and we are facing sales organization search list. Here in search list, there are four columns, sal

  • Setting static IP on Lan port

    I've been trying to set up 1 static IP on a LAN port for a media player. I believe the method to use is (1)go to ADVANCED ROUTING tab (2)Select (in my case) GATEWAY (3) Select a route number (I select route (1)) (4) I enter a name in the name area (5

  • Illustrator CS3 and Illustrator V10 compatibility

    Hi Can Illustrator v10 open Illustrator cs3 files? If so which extension types? I am mainly interested in EPS and AI file formats but will be nice to know if there are other extension types as well. Thanks Dave