How to fetch null values from DB

I need to fetch records where a field value is Null or nothing or space.
I tried :
where <field > eq space.
But this did not fetch any records though there are records in DB.
Is there any other way?
Thanks
Kiran

Hi kiran,
As you say, WHERE<field > EQ space should be works, try using  WHERE <field > IS NULL..
Regards,
Alejandro López

Similar Messages

  • How to fetch null values from a table

    Hi,
    This is a Attendance report
    Table Name : Attn_details ( Only 3 records stored in this table )
    EDate Etype
    04/03/2010 A
    05/03/2010 C
    06/03/2010 X
    user Enter From date : 01/03/2010
    To date : 10/03/2010
    I need the output 01/03/2010 to 10/03/2010
    01/03/2010 Null
    02/03/2010 Null
    03/03/2010 Null
    07/03/2010 Null
    08/03/2010 Null
    09/03/2010 Null
    10/03/2010 Null
    How to write a sql query, this is Urgent requirement, Help Me.

    EDate Etype Empcode
    01/03/2010 A 001
    02/03/2010 C 001
    04/03/2010 X 001
    02/03/2010 A 002
    01/03/2010 P 003
    5 records Like this stored in that table.
    user Enter From date : 01/03/2010
    To date : 04/03/2010
    for that employee code attendance date not marking that date only should come into the report.
    ECode 002 attendance not marked in the date of 01/03/2010 , 03/03/2010,04/03/2010
    003 attendance not marked in the date of 02/03/2010 , 03/03/2010,04/03/2010
    I need the output 01/03/2010 to 04/03/2010
    03/03/2010 Null 001
    01/03/2010 Null 002
    03/03/2010 Null 002
    04/03/2010 Null 002
    02/03/2010 Null 003
    03/03/2010 Null 003
    04/03/2010 Null 003
    i think now u clear the my requirement. how can i write the query.

  • Please help..it's Urgent..How to fetch the value from table row from Page

    Hi,
    I have created a table with 2 LOV's , LOV2 is dependent on LOV2.
    Here I can not use the general Dependent LOV concept, as these values are coming from 2 different LookUps.
    I am not able to fetch the user input for LOV1 (from page) .that is why not able to set the where cluse fro 2nd LOVVO.
    I have used this code:
    if ("ViolationCat".equals(lovInputSourceId)) {
    OAMessageLovInputBean msglov =
    (OAMessageLovInputBean)webBean.findChildRecursive("ViolationCat");
    // String p_violation_category = "'"+(String)msglov.getValue(pageContext)+"'";
    String p_violation_category =
    (String)msglov.getValue(pageContext);
    // System.out.println(" p_violation_category =" +
    // p_violation_category);
    String v_violation_category = "";
    //System.out.println("vcat=" + vCat);
    OAViewObject violationVO =
    (OAViewObject)am.findViewObject("SNI_Violation_DtlsVO2");
    Number vcatViolationIdnum =
    (Number)violationVO.getCurrentRow().getAttribute("ViolationId");
    String vcatViolationId = "" + vcatViolationIdnum;
    pageContext.putTransactionValue("vcatViolationId",
    vcatViolationId);
    pageContext.putTransactionValue("p_violation_category",
    p_violation_category);
    String query =
    " SELECT LOOKUP_CODE, \n" + " MEANING, \n" +
    " LOOKUP_TYPE \n" +
    " FROM apps.fnd_lookup_values \n" +
    " WHERE LOOKUP_TYPE ='SNI_VIOLATION_CATEGORY' AND MEANING=?";
    PreparedStatement ps = txn.createPreparedStatement(query, 1);
    try {
    ps.setString(1, p_violation_category);
    ResultSet rs = ps.executeQuery();
    //System.out.println("before while,");
    // rs.next();
    // v_violation_category = rs.getString("LOOKUP_CODE");
    // System.out.println("v_violation_category="+v_violation_category);
    while (rs.next()) {
    //System.out.println("inside while");
    v_violation_category = rs.getString("LOOKUP_CODE");
    // System.out.println("v_violation_category=" +
    // v_violation_category);
    ps.close();
    } //try ends
    catch (Exception e) {
    e.getMessage();
    //System.out.println("in catch.." + e.getMessage());
    OAViewObject subCatVO =
    (OAViewObject)am.findViewObject("SNI_ViolationSubCategoryVO1");
    //System.out.println("get VO before where clause: subCatVO::"+subCatVO.getQuery());
    subCatVO.setWhereClause("LOOKUP_TYPE like '%SNI_VIOL_SUB_CAT_" +
    v_violation_category + "'");
    System.out.println("after set where clause VO: subCat VO::" +
    subCatVO.getQuery());
    subCatVO.executeQuery();
    // System.out.println("query of subCat VO::" +
    // subCatVO.getQuery());
    //End of sub category Validation
    It is working fine only for the 1st row of teh table.
    I have tried to fetch the value using :
    String violationCategory = (String)violationVO.getCurrentRow().getAttribute("ViolationCategory");
    String violationSubcategory = (String)violationVO.getCurrentRow().getAttribute("ViolationSubcategory");
    But it is fetching null value.
    Please tell me how can I able to fetch the values.

    Hi
    in your scenarion,first u have to identify the particular row of table where the changes is being made ,u have to use this code .when u select the lov ,first it will give the row refernce and then u have to catch the lov event
    OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if ("<ItemPPREventName>").equals(event))
    // Get the identifier of the PPR event source row
    String rowReference =
    262
    pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    Serializable[] parameters = { rowReference };
    // Pass the rowReference to a "handler" method in the application module.
    am.invokeMethod("<handleSomeEvent>", parameters);
    In your application module's "handler" method, add the following code to access the source row:
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    thanx
    Pratap

  • How to post null values from h:inputText?

    Hello,
    I have a form made of h:inputText fields that map to an entity class as the backing bean. Whenever I post the form from a web page, all the fields that I did not fill out and that are mapped to String fields in the entity class are set to "" (empty string) instead of null.
    However, I would like to post null values to my entity, because that would indicate that the user did not fill out the field. In other contexts (outside of the web app) it is possible to set the fields to empty strings, but from the web app it should always be null. How can I get JSF to do this correctly?
    Also, when reading entitys with null values from the database, these are converted to empty h:inputText fields, so this direction works as expected.
    Ulrich

    I haven't seen a solution for this as far.
    This is how I do it:
    public void action() {
        if (isEmpty(inputValue)) {
            // do your thing
        } else {
            // do your thing
    public static boolean isEmpty(Object value) {
        if (value == null) {
            return true;
        if (value instanceof String && ((String) value).trim().length() == 0) {
            return true;
        if (value instanceof Collection && ((Collection) value).size() == 0) {
            return true;
        // And go so on .. make it an utility method.
        return false;
    }

  • How to replace NULL values from main table

    Dear all,
    I like to remove the NULL values from a main table field. Or the question is how to replace any part of the string field in MDM repository main table field.
    e.g.   I have a middle name field partly the value is NULL in some hundreds of records, I like to replace NULL values with Space
    any recommendation.
    Regards,
    Naeem

    Hi Naeem,
    You can try using Workflows for automatically replacing NULLs with any specific value.
    What you can do is: Create a workflow and set trigger action as Record Import, Record Create and Record Update. So, that whenever any change will occur in the repository; that workflow will trigger.
    Now create an assignment expression for replacing NULLs with any specific value and use that assignment expression in your workflow by using Assign Step in workflow.
    For exiting records, you will have to replace NULLs manually using the process given by Preethi else you can export those records in an Excel spreadsheet which have NULLs and then replace all NULLs with any string value and then reimport those records in your MDM repository.
    Hope this will solve your problem.
    Regards,
    Varun
    Edited by: Varun Agarwal on Dec 2, 2008 3:12 PM

  • Fetching Null Value from table

    I have a table where I am want to findout the total number of product (count of product) based on the ProdName.
    I have the following table with two columns:
    create table newproduct (prodid integer, prodname varchar(30));
    Insert into newproduct values (100, 'TowerA')
    Insert into newproduct values (160, 'TowerA')
    Insert into newproduct values (170, 'TowerB')
    Insert into newproduct values (120, 'TowerB')
    Insert into newproduct values (140, 'TowerC')
    Insert into newproduct values (180, '')
    So here the query that I trying to use:
    Select Distinct prodname from newproduct;
    Select prodid from newproduct where prodname is null; /* Correct way */
    Select prodid from newproduct where prodname in (''); /* I want result (180) by using this query */
    How can I do it?

    I'm not sure why you're trying to accomplish it that way, but you could try to use NVL to do that.
    You just need to make sure whatever value you input in the NVL is something you won't ever obtain as a real column value.
    Select prodid from newproduct where nvl(prodname, 'NULL VALUE HERE!') in ('NULL VALUE HERE!');Also, for performance reasons, since you're applying a function to the column, it won't be looking up indexes for matches, unless you create a function-based index.
    Nulls are not indexed anyway, but I'm not sure what you're trying to do with this query.

  • How to eliminate null values from the data?

    This query displays data for a project with approval & submission dates...I'm trying to eliminate records that have null values in Approval & submission date columns at the same time. But rather keep the records that have atleast one submission date or approval date?
    SELECT distinct QP.QIP_id,
            Max(decode( Upper(QP.Status_CD), Upper('Approved') , Effective_date, null ))  as Approved_date,
            Max( decode( Upper(QP.Status_CD), Upper('Submitted') , Effective_date, null ) ) as Submitted_date
             FROM  Llp_Sys.Project_Status QP
             WHERE SYSDATE >= qp.effective_date
                AND (qp.terminated_date IS NULL OR SYSDATE < qp.terminated_date)
            GROUP by QP.QIP_ID,Qp.Status_CD
            order by QP.QIP_ID

    francislazaro wrote:
    This query displays data for a project with approval & submission dates...I'm trying to eliminate records that have null values in Approval & submission date columns at the same time. But rather keep the records that have atleast one submission date or approval date?
    SELECT distinct QP.QIP_id,
    Max(decode( Upper(QP.Status_CD), Upper('Approved') , Effective_date, null ))  as Approved_date,
    Max( decode( Upper(QP.Status_CD), Upper('Submitted') , Effective_date, null ) ) as Submitted_date
    FROM  Llp_Sys.Project_Status QP
    WHERE SYSDATE >= qp.effective_date
    AND (qp.terminated_date IS NULL OR SYSDATE < qp.terminated_date)
    GROUP by QP.QIP_ID,Qp.Status_CD
    order by QP.QIP_ID
    based on my assumption, will the following not work ? if so then post some sample data and expected output (simplify as much as possible)
    SELECT *
      FROM (SELECT DISTINCT qp.qip_id,
                            MAX(DECODE(UPPER(qp.status_cd),
                                       UPPER('Approved'), effective_date,
                                       NULL
                                      )) AS approved_date,
                            MAX(DECODE(UPPER(qp.status_cd),
                                       UPPER('Submitted'), effective_date,
                                       NULL
                                      )) AS submitted_date
                       FROM llp_sys.project_status qp
                      WHERE SYSDATE >= qp.effective_date
                        AND (   qp.terminated_date IS NULL
                             OR SYSDATE < qp.terminated_date
                   GROUP BY qp.qip_id, qp.status_cd
                   ORDER BY qp.qip_id)
    WHERE approved_date IS NOT NULL OR submitted_date IS NOT NULL;Edited by: Clearance 6`- 8`` on Jul 9, 2010 12:46 PM

  • How to include null values from DB

    Hi,
    I want to see all columns values even though it may contain null values. Right now all null columns are being suppresed by XSQL. Is there any way i can configure this.
    Thanks in advance
    Regards
    Veera

    use the following attribute in the <xsql:query> element (see the xsql help!):
    <xsql:query null-indicator = "yes">..
    </xsql:query>
    Indicates whether to signal that a column's value is NULL by including the NULL="Y" attribute on the element for the column. By default, columns with NULL values are omitted from the output. Valid values are 'yes' and 'no'.(Default value is 'no')

  • How to remove NULL values from crosstab sheet in Viewer/Plus.

    I created a worksheet as crosstab. The sheet shows blanks in Desktop when there is no data in the cell, but the same sheet is showing NULL in Viewer. Is there any solution to make NULL as 0 or blank in Viewer?
    Thank you.

    Here you can find solution for this issue and its works for me......
    Show null values as

  • How to remove null values from list?

    I had created a list in forms 6i and I am getting list values at run time using add_list_item function. The problem is I am getting null value at end of the list. In the property pallet I kept required yes and set the initial value but it is not removing null value. Can any one help me. Thank you.......

    Hello
    Sorry mis-read question on first reply.
    1. Have you set a default value?
    2. Is this default value still in your list?
    3. What happens if you default the list's value to a value you know exists after you have populated it?
    Cheers
    Q
    Message was edited by:
    Q_STEPHENSON

  • How to pass null values From DTW

    I have update value of Acctntcode of OACT table
    Now i have to insert null in the field of Acctntcode From DTW (Data Transfer WorkBench)
    How Can i do it ?

    Hi,
    little late to the party on this one but I had a similar issue today and found the answer.
    Use a "/" (forward-slash) in your DTW file and it will set the field to NULL for you.
    I don't know if this works for numeric fields (probably not) but it worked for me on several string fields I needed to clear in various Master Data objects.
    HTH!
    Regards,
    Steve

  • How to eliminate NULL values from case statement?

    I have the following query where I am trying to eliminate the NULL record.  How can I do this?  My query:
    select
    AttendedSchoolLast3Months = case
    when d.scrnval_id = 'AA5639E4-E60C-473F-9B72-354472C11F5B' and d.picklist_value = 'BC349A1E-65A1-4497-A38A-116C83B2028F' then 2 --No
    when d.scrnval_id = 'AA5639E4-E60C-473F-9B72-354472C11F5B' and d.picklist_value = 'A529C643-60A7-4D79-AC67-1A8F70791934' then 1 --Yes
    end
    From [evolv_cs].[dbo].[test_header] [test_header_rv] WITH (NOLOCK)
    CROSS APPLY [dbo].[fn_getTestSetupFormDetails](null, [test_header_rv].[test_setup_header_id]) AS [test_header]
    CROSS APPLY [dbo].[fn_getTestSetupFormDetails]([test_header].[test_setup_details_id], null) AS [test_details]
    JOIN [evolv_reports].[dbo].[test_details_answers_expanded_view] d WITH (NOLOCK) ON
    [test_header_rv].[test_header_id] = d.[test_header_id]
    AND [test_details].[test_setup_details_id] = d.[test_setup_details_id]
    join [user_defined_lut_rv] udl1 with(nolock) on udl1.[user_defined_lut_id] = d.picklist_value
    join people_rv p (nolock) on d.people_id = p.people_id
    where d.actual_date between '9/1/13' and '9/30/13'
    and d.people_id = '7A9ACEE4-ABD5-4905-A54E-659A81048A1A'
    And the result currently is:
    AttendedSchoolLast3Months
    1
    NULL
    When I ran this query:
    select distinct --attendedschoollast3months
    d.*
    From [evolv_cs].[dbo].[test_header] [test_header_rv] WITH (NOLOCK)
    CROSS APPLY [dbo].[fn_getTestSetupFormDetails](null, [test_header_rv].[test_setup_header_id]) AS [test_header]
    CROSS APPLY [dbo].[fn_getTestSetupFormDetails]([test_header].[test_setup_details_id], null) AS [test_details]
    JOIN [evolv_reports].[dbo].[test_details_answers_expanded_view] d WITH (NOLOCK) ON
    [test_header_rv].[test_header_id] = d.[test_header_id]
    AND [test_details].[test_setup_details_id] = d.[test_setup_details_id]
    join [user_defined_lut_rv] udl1 with(nolock) on udl1.[user_defined_lut_id] = d.picklist_value
    --join [education_level] e (nolock) on e.[EducationLevel] = udl1.[description]
    join people_rv p (nolock) on d.people_id = p.people_id
    where d.actual_date between '9/1/13' and '9/30/13'
    and d.people_id = '7A9ACEE4-ABD5-4905-A54E-659A81048A1A'
    I get this:
    event_log_id people_id group_profile_id actual_date test_header_id test_setup_details_id test_domains_info_id question_caption question_code test_details_answers_id update_log_id test_details_id numeric_value scrnval_id picklist_value remarks narrative test_setup_details_answers_id is_checked date_value details_type_code test_setup_answers_caption test_setup_answers_order test_setup_answers_value output_code answers_category_id answers_category answers_category_code
    24E8F88F-9648-4714-9394-D5A3F642C0F0 7A9ACEE4-ABD5-4905-A54E-659A81048A1A NULL 2013-09-26 17:00:00.000 24E8F88F-9648-4714-9394-D5A3F642C0F0 67CDCF44-6308-4E15-8543-3C85DE4C6D4D NULL Attended school in the last 3 months NULL 1BB75044-A65C-4464-ADB9-0CA991019907 7CDD1A4F-41F4-403C-A85E-7FF51B761FF0 3F04BBFF-8DE9-4283-842F-E53A536E3E46 NULL AA5639E4-E60C-473F-9B72-354472C11F5B A529C643-60A7-4D79-AC67-1A8F70791934 NULL NULL 5979600C-B4E6-42DF-BF45-8AFF15ACDD7D 0 NULL PICKLIST Click here for list 1 NULL NULL NULL NULL NULL
    24E8F88F-9648-4714-9394-D5A3F642C0F0 7A9ACEE4-ABD5-4905-A54E-659A81048A1A NULL 2013-09-26 17:00:00.000 24E8F88F-9648-4714-9394-D5A3F642C0F0 EBDFBCA5-6E57-4907-9DEF-A1E118F3AB2D NULL Highest grade completed NULL 8F7F4644-4E67-4821-B0FC-A192389F994D 7CDD1A4F-41F4-403C-A85E-7FF51B761FF0 F6C59E67-EC74-4F0C-8EE8-AB372F22255D NULL 4536DD06-871D-4FA7-BA8A-552DB2CA59BC D77F0CAB-505E-4838-AECE-01BAAE8B8EB2 NULL NULL E7C9ECB7-7B40-4115-A6DB-BC752116D68D 0 NULL PICKLIST Click here for list 1 NULL NULL NULL NULL NULL
    Ryan D

    Hi, 
    what I understood from above is that u want to filter NULL records and want to display only not null records. Try below query.
    SELECT * FROM(select
    AttendedSchoolLast3Months = case
    when d.scrnval_id = 'AA5639E4-E60C-473F-9B72-354472C11F5B' and d.picklist_value = 'BC349A1E-65A1-4497-A38A-116C83B2028F' then 2 --No
    when d.scrnval_id = 'AA5639E4-E60C-473F-9B72-354472C11F5B' and d.picklist_value = 'A529C643-60A7-4D79-AC67-1A8F70791934' then 1 --Yes
    end
    From [evolv_cs].[dbo].[test_header] [test_header_rv] WITH (NOLOCK)
    CROSS APPLY [dbo].[fn_getTestSetupFormDetails](null, [test_header_rv].[test_setup_header_id]) AS [test_header]
    CROSS APPLY [dbo].[fn_getTestSetupFormDetails]([test_header].[test_setup_details_id], null) AS [test_details]
    JOIN [evolv_reports].[dbo].[test_details_answers_expanded_view] d WITH (NOLOCK) ON
    [test_header_rv].[test_header_id] = d.[test_header_id]
    AND [test_details].[test_setup_details_id] = d.[test_setup_details_id]
    join [user_defined_lut_rv] udl1 with(nolock) on udl1.[user_defined_lut_id] = d.picklist_value
    join people_rv p (nolock) on d.people_id = p.people_id
    where d.actual_date between '9/1/13' and '9/30/13'
    and d.people_id = '7A9ACEE4-ABD5-4905-A54E-659A81048A1A' ) AWHERE AttendedSchoolLast3Months IS NOT NULLTry this query.
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • Fetch the values from internal table inside an internal table (urgent!!)

    data : BEGIN OF PITB2_ZLINFO occurs 0,
             BEGDA LIKE SY-DATUM,
             ENDDA LIKE SY-DATUM,
             PABRJ(4) TYPE N,                       "Payroll Year
             PABRP(2) TYPE N,                       "Pay. Period
             ZL LIKE PC2BF OCCURS 0,
           END OF PITB2_ZLINFO.
    I have a internal table like this,
    How to Fetch the values from internal table inside an internal table.
    Kindly Help me on this..
    Regards,
    Ram.

    Hi,
    Try this....
    Loop at PITB2_ZLINF0.
    Loop at PITB2_ZLINF0-ZL.
    endloop.
    Endloop.
    Thanks...
    Preetham S

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How can I delete null values from List Item?

    Hi Friends,
    I used List item for field job_Type, I entered values in List item at design time through property pallet. When I run form I will see null values in this List Item.
    How can I remove these null values from the List?
    Best regards,
    Shahzad

    Dear Shahzad,
    It can be removed by adding the following code in the When-new-Form-Instance.
    Set_item_property('List name', required, property_true);
    :block_name.list_name := <put your default value here>; (If you didn't oput the default value, then you will get some problem and the cursor may not navigate away from the list).
    Senthil Alagu .P.

Maybe you are looking for

  • ITunes install fails due to Error Code

    I'm trying to install iTunes and I get the message Service 'Apple Mobile Device' failed to start. Verify you have sufficient privileges to start system services. I then have 3 options - Abort - Retry - Ignore which provide no success. If I ignore it

  • Intel iMac won't boot from disc or in safe mode - cannot repair disk

    I have an early Intel iMac 20" (2GHz core duo) that generally works fine. I recently ran Onyx and it reported a startup disk error, suggesting I insert the install disk, hold 'c', and use disk utility to repair the disk. NOTE: I have performed this o

  • What's the latest version I can use on a Mac OS10 2.8?

    It downloads, but I don't get a prompt to move it to apps. When I moved it anyway, there's no Firefox logo and when I move it to the doc, it doesn't load. Still have old version when I launch Firefox. What am I doing wrong?

  • Small Query in Selection Screen and Screen.

    Hello Guys... I have Created a program using Selection-Screen 1000. and Screen 2000. At Selection-Screen I have written code Start-of-selection.   ok_code = sy-ucomm.   CASE ok_code.     WHEN 'BACK'.         LEAVE PROGRAM. end case. and At the user-c

  • Please help -- how to select shape in background?

    Hello, I made a rectangle shape and sent it to the background so that it would be behind my text. Now I cannot select it to get rid of it! Clicking anywhere just selects the table cells that overlay everything. How do I select my shape? I looked in t