Handling null in table

Hi All,
String NoOfPositions = row.getAttribute("NoOfPositions").toString();
when NoOfPositions contain null (blank) then it throws null pointer exception. By which way shall i handle this exception.

Hi Gyan,
Always close the thread, if you have solved/get out of the issue...
Explicitly setting the value in my MessageChoice & MessageTextInput
So that others can also take advantage of it.
Adding one more point to Reetesh's reply:
best pactice is to check null for "row" object also. Sample code:
String NoOfPositions = "";
if(row != null)
if(row.getAttribute("NoOfPositions")!=null)
NoOfPositions = row.getAttribute("NoOfPositions").toString();
} Regards,
Anand

Similar Messages

  • How to handle Null value in Database Adapter

    I configured the DA Adapter, with operation type as "Perform an Operation on a Table - Select" and added few where clause parameters (StreetNo, StreetName city, country, state, zipcode)too.
    If we won't enter any value for any of the column in the table (S_ADDR_PER) is taking as NULL, so what happening is, if i give "%" or if i leave as "blank" to those columns(input for where clause parameter). The DB adapter not fetching any records. Any help to handle this situation.
    I need query like this...
    select * from S_ADDR_PER where city like '%' AND state is NULL AND addr_line_2 like '%';
    seems.... I can't use the pure SQL option since i don't know which column will be null. Some case the addr_line_2 column will be NULL in table, in some other case the state or city column will be null.

    Hi,
    you can handle null with date like this , If it doesn't wortk for you then please explain your problem.
    select NVL(to_char(sysdate,'DD-MON-YY'),'Not Recorded')
    from dual
    NVL(TO_CHAR(
    08-NOV-05
    select NVL(to_char(NULL,'DD-MON-YY'),'Not Recorded')
    from dual
    SQL> /
    NVL(TO_CHAR(
    Not Recorded
    Regards

  • Handling NULL in Oracle Function

    I try to handle NULL with IS NULL in side the Function. But I some how can't do it. Control always goes to NO_DATA_FOUND Exception block.
    In BEGIN block, if I try to handle with IS NULL condition but it doesn't work. But if I use DBMS_OUTPUT.PUTLINE and display the variable with NVL, it tells me it is NULL.
    My code is like;
    <code>
    FUNCTION F_GetProductKey (p_CompanyCod varchar2, p_ProductCod varchar2) return number;
    as
    vi_ProductKey Number;
    BEGIN
    DBMS_OUTPUT.PUT_LINE( NVL(p_ProductCod,'abc') <----- This displays 'abc'
    IF p_ProductCod IS NULL THEN
    SELECT PRODUCT_KEY in vi_ProductKey from DIM_PRODUCT WHERE Product_Cod=-2;
    ELSE <---- Control Always Goes to ELSE even p_ProductCod is NULL & then it goes to NO_DATA_FOUND Exception
    SELECT PRODUCT_KEY in vi_ProductKey from DIM_PRODUCT WHERE Product_Cod=p_ProductCod AND COMPANY_COD = p_CompanyCod ;
    END IF;
    return vi_Product_Key;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
         return -20060;
    WHEN OTHERS THEN
    return -20001;
    END;
    </code>
    I've a hard coded value in table for Product_Cod=-2, so I should never get No_Data_Found exception if ProductCod is NULL. I checked, for CompanyCod and it is NOT NULL when I call function.
    I Googled to look at what I'm doing wrong. I find that NULL values can be handled by ISNULL but some how it doesn't work in my case.
    Is there any other way to handle NULL inside function??

    I've a hard coded value in table for Product_Cod=-2, so I should
    never get No_Data_Found exception if ProductCod is NULL.Are you sure? It seems to me the behaviour you describe could equally well be explained by the control going down the IF ... IS NULL branch and then not finding the PRODUCT_COD in question.
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/
    P.S. Having read your subsequent message, specifically this
    Product_cod is varchar2. It is actually comparing to
    'UNK' not -2 in side the code.I am even more certain that the problem lies in your data. Larry Ellison did not become a multi-billionnaire on the basis of code which behaved in an unpredictable fashion.
    Message was edited by:
    APC

  • Report error: ORA-06502: PL/SQL: numeric or value error: NULL index table k

    Hi everybody,
    I have two Distinct Databases on two distinct servers. (Oracle Ent. Release 10.2.0.3.0 on AIX 5.3). After I install the latest patch last week, One of the APEX installation has some problems on Home>Application Builder Page. The error message is very random and
    report error:
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value.
    When i change the view (details to icons), everything goes to normal. This error message is reflected some of the pages (report region) of some of my applications randomly. When it appears in a report region, i deselect the order method of the region, the result is normal.
    But the other APEX application on the other instance has no problem. It is a bug? or Should i re-install the APEX instance?
    Thank you for your interest?
    Gökhan ÇATALKAYA

    No, but we have a reproducible test case now so we're working on it. See ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    Scott

  • Error: ORA-06502: PL/SQL: numeric or value error:NULL index table key value

    Hi,
    I am trying toceate an interface which collects data from database make some transformation and populated seeded tables in the same database.
    My Approach is :
    a) Create a record type variable ( concists of multiple segments)
    b) Create a pl/sql table type of the records type in a)
    c) Created a cursor of same structure as pl/sql table type ( collects data)
    d) BULK CoLLECT data from cursor into pl/sql table
    e) Print the data
    But during Bulk Collect i get the below error :
    Unexpected error in xxc_hr2hr_populate_elements.main at FLOW TRACE-1.120. Error: ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    ORA-20003: Unexpected error in xxc_hr2hr_populate_elements.get_data at FLOW TRACE-1.1.100. Error: ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind

    Ashish_Apps wrote:
    Hi,
    I am trying toceate an interface which collects data from database make some transformation and populated seeded tables in the same database.
    My Approach is :
    a) Create a record type variable ( concists of multiple segments)
    b) Create a pl/sql table type of the records type in a)
    c) Created a cursor of same structure as pl/sql table type ( collects data)
    d) BULK CoLLECT data from cursor into pl/sql table
    e) Print the data
    But during Bulk Collect i get the below error :
    Unexpected error in xxc_hr2hr_populate_elements.main at FLOW TRACE-1.120. Error: ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    ORA-20003: Unexpected error in xxc_hr2hr_populate_elements.get_data at FLOW TRACE-1.1.100. Error: ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated BindVerify the rows you are fetching are having the same data types as your Record like Dates should go to date , decimal should not be fetched in type defined as number etc.

  • ORA-06502: PL/SQL: numeric or value error: NULL index table key value??

    Hi,
    Can anyone let me know what is the issue on below code and how can we avoid that? i am getting the error like below
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value
                        v_while_loop := 1;
                        v_delete_char_id := v_tabtype_result_values.FIRST;
                        WHILE v_while_loop <> v_tabtype_result_values.COUNT
                        LOOP
                            IF check_duplicate_nc_data (v_result_view,
                                                        v_tabtype_result_values(v_delete_char_id).value,
                                                        v_collection_id,
                                                        v_occurrence,
                                                        v_plan_id,
                                                        v_delete_char_id
                            THEN
                                DBMS_OUTPUT.PUT_LINE(v_delete_char_id);
                                v_tabtype_result_values.DELETE(v_delete_char_id);
                            ELSE
                                DBMS_OUTPUT.PUT_LINE(v_delete_char_id||','||v_tabtype_result_values(v_delete_char_id).id||','
                                                        ||v_tabtype_result_values(v_delete_char_id).value||','
                                                        ||v_tabtype_result_values(v_delete_char_id).validation_flag
                            END IF;
                            v_while_loop := v_while_loop + 1;
                            v_delete_char_id := v_tabtype_result_values.NEXT(v_delete_char_id);
                        END LOOP;

    Change:
    WHILE v_while_loop &#60;&#62; v_tabtype_result_values.COUNT to
    WHILE v_while_loop <= v_tabtype_result_values.LASTSY.

  • ORA-06502: PL/SQL: numeric or value error: NULL index table key value Repor

    W've been experiencing the Oracle Error: ORA-06502: PL/SQL: numeric or value error: NULL index table key value Report’ [we are currently on apex v3.0.1]. From the forum there was a reference to a bug fix: apex bug (6416829) fixed in 3.1. When we view '6416829' in Metalink we can see the bug title but cannot see any details as it's protected. Can anyone shed some light on why it's protected or provide further details.
    We have many LIVE customers reporting this error and we want to be certain it's fixed in v3.1.
    (currently we are working around this by flushing the shared pool but this is not ideal).
    Any help would be appreciated.

    Scott,
    This error has been thrown several times in the past 24 hours. Yesterday several of my reports threw the error, these reports have done so in the past. This morning APEX has begun throwing the error of which I have seen only once before. This is occuring at Home>Application>My Application. The error appears when I attempt to View the report in Details mode, is OK when I view the report in Icons mode. The error is occuring in my Prodution environment which has not been updated since 2/25/2009.
    As before, I edited the SQL on my application's reports and the error then disappeared.
    We are running Application Express 3.2.0.00.27 and Oracle Release 10.2.0.1.0. My browser is IE 7.0.
    Plan to test later with FireFox provided I can download it to see if this might browser related.
    Any inforamtion or guidance is appreciated.
    Jeff

  • NULL index table key value

    ORA-06502: PL/SQL: numeric or value error: NULL index table key value in Package OE_Order_PVT Procedure Lines
    Where is the problem?
    thanks
    Edited by: huak on Feb 5, 2009 5:08 PM

    thank you
    My EBS is On 11.5.9 in Production, but Note: 433074.1 is based on 11.5.10.2 in Production.
    AND I use the api with test windows to declare code in PL/SQL developer that is right. But I use api in the a package for a ebs' request that is error.
    :(

  • OWB Error handling through error tables

    I have a mapping, which i want to implement error handling through error table, the table is created (error) and i have supplied it in the error table propertis in the target table. But i have tried testing if this is working by changing the data type of one column in my target database, but the whole mapping is failing to run with no error rerded in the error table. And i tried testing the this through sql and suprisingly the errors are being captured. How do i get the whole mapping to run and record the errors if any in the error table without it failing.

    When you say 'the whole mapping is failing to run' what do you mean? Can you deploy the mapping? If not what is the error? When you run the mapping what happens?
    If you look at the DML statement (the INSERT, MERGE or whatever) generated by OWB does it include the LOG ERRORS INTO statement in it?
    There is a blog post below for OWB 11gR2;
    http://blogs.oracle.com/warehousebuilder/entry/owb_11gr2_dml_error_logging
    And an older one here which was based on OWB 10gR2
    http://blogs.oracle.com/warehousebuilder/entry/set_based_errors_dml_error_log
    Cheers
    David

  • How to handle null pointer exception

    dEAR ALL
    how to handle null pointer exception
    public void xxperscompmatchcase(OAPageContext pageContext,
    OAWebBean webBean,String cid,String pid)
    xxcrmleadperslastnameVOImpl vo=getxxcrmleadperslastnameVO();
    xxcrmleadcompnameVOImpl vo1=getxxcrmleadcompnameVO();
    vo.setWhereClauseParams(null);
    vo1.setWhereClauseParams(null);
    vo.setWhereClauseParam(0,pid);
    vo1.setWhereClauseParam(0,cid);
    vo.executeQuery();
    vo1.executeQuery();
    String compname="";
    String plname="";
    if(vo1.first().getAttribute("CompName")!=null)
    compname=(String)vo1.first().getAttribute("CompName");
    else
    compname="";
    if((String)vo.first().getAttribute("PersLastname")!=null)
    plname=(String)(String)vo.first().getAttribute("PersLastname");
    else
    plname="";
    OAFormattedTextBean p =
    (OAFormattedTextBean)webBean.findChildRecursive("personmatchcase");
    OAFormattedTextBean b =
    (OAFormattedTextBean)webBean.findChildRecursive("matchcase");
    b.setValue(pageContext,
    "The Lead is matched to company " + compname.toUpperCase());
    p.setValue(pageContext,
    "The Lead is matched to person " + plname.toUpperCase());
    it is going to null pointer exception
    how to handle this exception

    Hi,
    try
    //Write your logic here, which can generate any exception
    catch(Exception e)
    //Write your exception specific code here
    Regards,
    Reetesh Sharma

  • How HANA handle NULL values

    Hi frzz,
    Can any one explain me how exactly HANA handles NULL values??
    Best Regards,
    Krishna.

    Hi Krishna,
    You can use IFNULL for the SQL queries/script instead of ISNULL . Since ISNULL is binary function and will be mostly used for the CE Functions based Calc views.
    Try using the same queries with IFNULL instead of ISNULL, it should work
    Best Regards
    Rahul Jha

  • Handling null

    Hi,
    i have a select into query within a procedure.
    select serial_id into v_serId from dts_tablel where lower(dts_name)=lower(cur1.dts_name) and tb=lower(cur1.tb)
    If one of the value is null ie., ( dts_name or tb ) the query will not return the values. How to handle null here

    Hi,
    So you want a condition like
    lower (dts_name)   != lower (cur1.dts_name)that will be TRUE when both dts_name and cur1.dts_name are NULL?
    Here's one way:
    select serial_id
    into   v_serId
    from   dts_tablel
    where  (    lower (dts_name)             != lower (cur1.dts_name)
           OR   NVL (dts_name, cur1.dts_name)  IS NULL
    and    (    tb               = lower (cur1.tb)
           OR   NVL (tb, cur1.tb)     IS NULL
    ;Also, DECODE compares NULLs the same way it compares values, so you could say:
    select serial_id
    into   v_serId
    from   dts_tablel
    where  DECODE ( lower (dts_name)
                      , lower (cur1.dts_name), 'Same'
               )                      = 'Same'
    and    DECODE ( tb
                      , lower (cur1.tb),       'Same'
               )                      = 'Same'
    ;

  • Handling null column values

    I can't find any samples that show how to handle null values returned in a JDBC Select statement. My code bombs out on setLong etc if the column is null.
    Any suggestions much appreciated.

    wasNull()

  • How to handle ORA-00942: table or view does not exist

    Hii All,
    I'm trying to drop a table dynamically irrespective of its existence in a procedure. Its working fine when table exists but when table doesn't exist I'm facing following error
    ORA-00942: table or view does not existI made use of pragma exception_init and modified my code as below
    Create or replace Procedure sp_FSASA_FEEDUPLOAD_process
               p_test_dir               in     varchar2,
               p_feed_file_name     in     varchar2
    is
              l_exttable_str varchar2(32000) ;
              l_log_file constant varchar2(200) := 'logfile_rgh.log';
              l_table_doesnt_exist Exception;
              pragma exception_init(l_table_doesnt_exist,-00492);
    Begin
              Begin
                   execute immediate 'drop table FSASA_FEEDUPLOAD_EXT purge' ;
              Exception
                        when l_table_doesnt_exist then
                             null;
              End;
              l_exttable_str := 'Create table FSASA_FEEDUPLOAD_EXT ';
              l_exttable_str := l_exttable_str||' ( ';
              l_exttable_str := l_exttable_str||' Category_No                    varchar2(1), ';
              l_exttable_str := l_exttable_str||' Financial_Category          varchar2(300), ';
              l_exttable_str := l_exttable_str||' GFCID                         number, ';
              l_exttable_str := l_exttable_str||' Balance                         number(34,14), ';
              l_exttable_str := l_exttable_str||' Refernce_no                    varchar2(20), ';
              l_exttable_str := l_exttable_str||' Account_no                    varchar2(20), ';
              l_exttable_str := l_exttable_str||' ce_trans_id                    varchar2(20) ';
              l_exttable_str := l_exttable_str||' ) ';
              l_exttable_str := l_exttable_str||' Organization external ';
              l_exttable_str := l_exttable_str||' ( ';
              l_exttable_str := l_exttable_str||' type                    oracle_loader ';
              l_exttable_str := l_exttable_str||' default directory      '||p_test_dir;
              l_exttable_str := l_exttable_str||' Access parameters ';
              l_exttable_str := l_exttable_str||' ( ';
              l_exttable_str := l_exttable_str||'  records delimited by newline ';
              l_exttable_str := l_exttable_str||'BADFILE '||q'[']'||p_test_dir||q'[']'||':'||q'[']'||'feed.bad '||q'[']' ;
              l_exttable_str := l_exttable_str||'LOGFILE '||q'[']'||p_test_dir||q'[']'||':'||q'[']'||':feed.log '||q'[']' ;
              l_exttable_str := l_exttable_str||q'[FIELDS TERMINATED BY X'09']';
              l_exttable_str := l_exttable_str||' missing field values are null ';
              l_exttable_str := l_exttable_str||')location('||q'[']'||p_feed_file_name||q'[']';
              l_exttable_str := l_exttable_str||')' ;
              l_exttable_str := l_exttable_str||' )Reject limit unlimited ';
              dbg_print(l_log_file,'l_exttable_str : '||l_exttable_str);
              execute immediate l_exttable_str;
    End;But still I'm unable to get rid of it. Pls help me.
    1)I need to drop it as I need to immediately create table with different file name and from different path.
    2)The last thing I don't like to do is to check the table name in USER_OBJECTS and then drop.
    3)Also suggest me whether creating an external table dynamically is correct approach or not.
    4)Till now we were using utl_file for reading feed file but I'm much interested in using EXTERNAL TABLE concept.
    5)As the filename and path gets changed I need to create my external table at runtime.
    please suggest me whether I can alter my filename and path at runtime

    You will need to use WHEN OTHERS EXCEPTION handler which is not a good idea to do so if you dont handle the same approprialtly then the exception would go un-noticed:
    SQL> ed
    Wrote file afiedt.buf
      1  begin
      2  execute immediate 'drop table my_Test';
      3  exception
      4  when others then
      5  dbms_output.put_line(SQLCODE||SQLERRM);
      6* end;
    SQL> /
    -942ORA-00942: table or view does not exist
    PL/SQL procedure successfully completed.
    SQL>

  • Get the handle to the table cell button

    Hi,
    I need to get a handle to a button which is itself is table cell - please have a look at the xml below.
    How do I get a handle to a button which has id "EamSubmitButton" below?
    Thank you
    Anatoliy
    <ui:tableSelection>
    <oa:multipleSelection viewName="EAMIssueMaterialResultTableVO" viewAttr="Selectflag" id="FndSelectCheckbox" user:akAttributeCode="FND_SELECT_CHECKBOX" user:akAttributeApplicationId="0">
    <ui:contents>
    <oa:selectionButton text="Issue" id="EamSubmitButton" textTranslationExpansion="100%" user:akAttributeCode="FNDBUTTONCELL" user:akAttributeApplicationId="0" use="/oracle/apps/fnd/attributesets/Buttons/Submit"/>...

    Ajay and Anil,
    Thank you for responding.
    In my case it is customization (extension, R12.1.1)
    I have a custom region with a button A.
    And I have a seeded page where I have a table with a button (id=EamSubmitButton) contained within a table cell - this is a piece of xml that I quoted before:
    ... <oa:selectionButton text="Issue" id="EamSubmitButton" textTranslationExpansion="100%" user:akAttributeCode="FNDBUTTONCELL" user:akAttributeApplicationId="0" use="/oracle/apps/fnd/attributesets/Buttons/Submit"/>
    </ui:contents>
    </oa:multipleSelection>
    I need to toggle Disabled property of button "EamSubmitButton" when button A is clicked.
    And I don't know how to get the handle to this "EamSubmitButton" button so that I can set it's Disabled property to true or false.
    Normally I would get the handle off the bean by way of webBean.findIndexedChildRecursive.
    But this doesn't work in this case. I get null.
    Please let me know if you have any ideas.
    Thanks
    Anatoliy

Maybe you are looking for

  • Purpose of DTO in CMP

    what is the purpose of DTOs in N-tire architecture using J2EE?

  • Credit card renew

    My credit card will be expired in July 2013 and I have a new card and it will be expired in July 2018. Do you needed update it?

  • I can't listen to anything!!

    Hi, i bought Iphone4 but when i use it the speakers aren't working, i can't listen to music or hear the video effects; however, i cant talk to the people. Moreover, i bought it when i was in Vancouver on 22nd Dec, 2010 from Apple store and now i'm in

  • New Mac Pro 2013 late version USB 3.0 hub issue during boot

    Hi all, I just purchased a new Mac Pro 8 core with 32GB of ram and 1 TB drive. When I connect a USB powered 3.0 hub and turn on my Mac Pro, it gets hung on while booting. (Gray screen before the Apple logo appears on boot). If I pull the USB 3.0 hub

  • Windows PC suddenly won't work with Airport Extreme

    Anyone's help would be greatly appreciated. We had a storm this past weekend....had to reboot the modem and Airport Extreme. Two of the three computers were back on line with the Airport instantly: my G4 and a Dell PC. The third computer (my work com