Difference between NULL and two single quotes

Hi,
Please advice me on the following.
First let's do an update.
update table_name set column_name ='';
After updating why do following queries return different results?
1. select count(*) from table_name where column_name is null;
2. select count(*) from table_name where column_name ='';
I understand update query set the column values to null and first select statement is the correct way to get the number of null values. But I want to know what's wrong with the second select statement.
Thank You.
Edited by: Sajeeva Lakmal on Jan 15, 2013 9:29 PM

Sajeeva Lakmal wrote:
Hi,
Please advice me on the following.
First let's do an update.
update table_name set column_name ='';
After updating why do following queries return different results?
1. select count(*) from table_name where column_name is null;
2. select count(*) from table_name where column_name ='';
I understand update query set the column values to null and first select statement is the correct way to get the number of null values. But I want to know what's wrong with the second select statement.
Thank You.
Edited by: Sajeeva Lakmal on Jan 15, 2013 9:29 PMhow can I reproduce what you report?

Similar Messages

  • Difference between Null and null?

    What is the difference between null and NULL?
    When is each used?
    Thanks,

    veryConfused wrote:
    There is a null in java, but no NULL. null means no value. However, when assigning value, the following is different:Although the empty String has no special role. Null means, the referential type is not assigned (doesn't refer) to a specific object. The empty String is just another object though, so seeing it or pointing it out as something special when it actually isn't at all (no more special than new Integer(0) or new Object[0]) just adds to the confusion.

  • Difference between Select *    and Select single     ?

    difference between Select *    and Select single     ?

    HI,
    DATA : IT  TYPE TABLE OF MARA,
               WA TYPE MARA.
    Here it selects all the record and keeps in internal table it.
    Select  *  from mara into corresponding fields of table <b> it</b>.
    Here it slects only one record that to first record.
    If you wnat any specific record then use where condition.
    Select  single *  from mara into corresponding fields of <b>wa</b>.
    Message was edited by:
            Purshothaman P

  • What is the difference between "= NULL" and "IS NULL" in SQL?

    Hi,
    I believe there is a difference between "= NULL" and "IS NULL" comparsion, but I couldn't find it. Anyone knows the difference?
    Thanks,
    Denny

    Aha, thanks:
    SQL> create table william_test_tab (col binary_double);
    Table created.
    SQL> insert into william_test_tab
      2  select rownum / (rownum - 1) from user_tables where rownum < 4;
    select rownum / (rownum - 1) from user_tables where rownum < 4
    ERROR at line 2:
    ORA-01476: divisor is equal to zero
    SQL> insert into william_test_tab
      2  select 1d * rownum / (rownum - 1) from user_tables where rownum < 4;
    3 rows created.
    SQL> select * from william_test_tab;
           COL
           Inf
      2.0E+000
      1.5E+000
    3 rows selected.
    SQL> select * from william_test_tab where col is infinite;
           COL
           Inf
    1 row selected.
    SQL>

  • Difference between NULL and ''

    Hi All,
    Is the below right?
    NULL is not stored as a value in a field. Its an internal bit that is set to indicate that the value is unknown.
    Blank is stored as a value in the field. Because of that we can perform all kinds of comparisons with blank value, while we cant do the same with NULLs
    Regards,
    aak

    user605246 wrote:
    Hi All,
    Is the below right?
    NULL is not stored as a value in a field. Its an internal bit that is set to indicate that the value is unknown.
    Blank is stored as a value in the field. Because of that we can perform all kinds of comparisons with blank value, while we cant do the same with NULLs
    Regards,
    aakYou are corerct in that NULL is not stored as a value in a field, but sorta/kinda wrong that it is an internal bit set to indicate that the value is unknown.
    If the NULL column(s) is/are the last column(s) in the table, then null values are not stored at all. The basic structure of a row stored on disk is (highly simplified)
    col1length|col1data|col2length|col2data|col3length|col3dataSo, given a row with col1 = 'ABC', col2 = 'Hello' and col3 null what is stored is:
    3|ABC|5|HelloHowever, if col2 is null and col 3 = 'Hello' then what is stored is:
    3|ABC|0|5|HelloSo the length byte is set to 0 to indicate that the column is null. Although the actual storage mechanisims for other data types differ from varchar2 example above, the 0 valeu i nthe length byte always indocates a null, and trailing null columns take 0 bytes of storage.
    John

  • Difference between NULL and INITIAL

    Hi All,
           I just wanted to know that if we have a statement such as 'IF VBAP-KWMENG IS INITIAL' or 'IF VBAP-KWMENG IS NULL' what is teh exact difference and where are they used. Is it that null is used for CHARACTER fields?
    TIA

    Hi,
    An <b>Initial Value</b> is set for all the predefined data types
    fo ex: type    Initial value
            b        0
            c        " "
            i        0
    so when an object is created,the start value explicitly given by you is taken by that else initial value is taken.
    <b>NULL Value</b> is Initial value of an empty column in a row of a database table.Null values can be processing using Native SQL statements, but they have no equivalent as the content of data objects in ABAP. Only the WHERE addition enables a special condition IS NULL for null values. Changing Open SQLstatements (INSERT, UPDATE, MODIFY) generally do not create null values, provided that you are not processing a view that does not comprise all columns of a database table. However, depending on the database system, you can also display empty strings as null values. Null values can still arise in database tables if the new columns are appended to filled tables. When reading with the Open SQL statement SELECT , null values can be created by aggregate functions or an outer join, but they are converted to initial values of the correct type when passed to data objects.
    Please reward points if you feel it helps you
    Thanks,
    Sowjanya

  • Difference between NULL and nil?

    I've searched but can't find a clear coherent answer. Could someone spell this out for me?
    Thanks

    command-double-click is your friend
    /* A null pointer constant. */
    #if defined (STDDEFH) || defined (_needNULL)
    #undef NULL /* in case <stdio.h> has defined it. */
    #ifdef _GNUG_
    #define NULL __null
    #else /* G++ */
    #ifndef __cplusplus
    #define NULL ((void *)0)
    #else /* C++ */
    #define NULL 0
    #endif /* C++ */
    #endif /* G++ */
    #endif /* NULL not defined and <stddef.h> or need NULL. */
    #undef _needNULL
    #ifndef NULL
    #define NULL _DARWINNULL
    #endif /* ! NULL */
    #ifndef nil
    #define nil NULL
    #endif /* ! nil */

  • Difference in Null and Empty String

    Hi,
    I have been wondering about the difference between Null and Empty String in Java. So I wrote a small program like this:
    public class CompareEmptyAndNullString {
         public static void main(String args[]) {
              String sNull = null;
              String sEmpty = "";
              try {
                   if (sNull.equalsIgnoreCase(sEmpty)) {
                        System.out.println("Null and Empty Strings are Equal");
                   } else {
                        System.out.println("Null and Empty Strings are Equal");
              } catch (Exception e) {
                   e.printStackTrace();
    This program throws Exception: java.lang.NullPointerException
         at practice.programs.CompareEmptyAndNullString.main(CompareEmptyAndNullString.java:10)
    Now if I change the IF Clause to if (sEmpty.equalsIgnoreCase(sNull)) then the Program outputs this: Null and Empty Strings are Equal
    Can anyone explain why this would happen ?
    Thanks in Advance !!

    JavaProwler wrote:
    Saish,
    Whether you do any of the following code, the JUnit Test always passes: I mean he NOT Sign doesnt make a difference ...
    assert (! "".equals(null));
    assert ("".equals(null));
    You probably have assertions turned off. Note the the assert keyword has nothing to do with JUnit tests.
    I think that older versions of JUnit, before assert was a language keyword (which started in 1.4 or 1.5), had a method called assert. Thus, if you have old-style JUnit tests, they might still compile, but the behavior is completely different from what it was in JUnit, and has nothing to do with JUnit at all.
    If you turn assertions on (-ea flag in the JVM command line, I think), the second one will throw AssertionError.

  • VARCHAR2:: How to differnciate between NULL and empty string '' ?

    Hello to all,
    I'm looking for a possibility to differnciate between NULL and empty string '' in column of type VARCHAR2.
    I have an application relying on that there is a difference between NULL and ''.
    Is it possible to configure ORACLE in some way ?
    Thanx in advance,
    Thomas

    try check if a varchar variable has an empty string
    by checking its lengthAnd that would accomplish what? But see for yourself:
    DECLARE
      v_test VARCHAR2(10);
    BEGIN
      v_test := '';
      DBMS_OUTPUT.put_line(LENGTH(v_test));
      v_test := NULL;
      DBMS_OUTPUT.put_line(LENGTH(v_test));
    END; C.

  • Difference between Null in c and Null in Oracle

    Hi,
    Can any one tell me the difference between NULL in C language and NULL in Oracle
    Rds,
    Naga

    > Null is some garvage value in oracle.
    Not sure what you mean.
    AFAIK and not being a C programmer myself, isn't null CHR(0) in C? I'm not sure the two concepts (SQL null and C null) have anything in common.

  • Difference between null string and empty string??

    what is the major difference between null string and an empty string??
    I wrote the following simple program and I could see some different output.
    Other than that, any other differences that we should pay attention to???
    C:\>java TestCode
    Hello
    nullHello
    public class TestCode
         public static void main(String[] s)
         {     String s1 = "";
              String s2 = null;
              System.out.println(s1 + "Hello");
              System.out.println(s2 + "Hello");
    }

    The difference is that an empty String is just empty but a null String has no value (i.e. it is not instantiated) this has signifigance since all Strings are objects.

  • Difference between -1 and null in the targettype filed

    Hi
    Could anyone advise what is the difference between -1 and null in the targettype filed in marketing documents?
    For example, in Sales Quotation - Rows (QUT1) table, I found for some open sales quotations, the field is null however the DB help file suggest the default value is -1 so I suppose it should be -1 for open documents.
    Many thanks for your advisory.

    Hi, Qian!
    I investigated that "-1" value appears in targettype field in Sales Quotation Rows (QUT1 table) when you Dublicate a Sales Quotation document (Ctrl + D). And NULL value appears when you create a new document without dublicating.
    In case you want to equal these 2 "empty"-values using T-SQL, you can use ISNULL(targettype, -1) function - this will give you -1 for both the "empty"-values
    HTH!
    Message was edited by: Aleksey Kuznetsov

  • Difference between void and null?

    wht is da difference between void and null w.r.t java?

    corlettk wrote:
    Why do you care, unless you're implementing a java compiler or JVM?Wow, you sure do suck at helping out in a forum. Why even make this post? You're not helping the OP any, and you made yourself look like a tool.
    To the op:
    Null is java's version of a null value. Java's version is more strict then many other languages, and will not work in a boolean expression or anywhere code expects a real and not null value. It's simply null.
    Void is java's way of declaring no return type on a method. Methods that are void take no 'return' statement and if one is provided will cause a fatal error. The exception to this is using 'return' without a value, which returns control to the caller of the method.
    Observe:
    //this method returns an int
    public int return_int(){
        int value = 5;
        return value;
    //this method does not return an int
    public void return_nothing(){
        int another_value = 123;
        System.out.println("Here's the value: " + return_int());
    //this method does not return anything
    public void nothing_returned(){
        return_nothing();
        return;
        System.out.println("This line never gets printed; the method returned control already!");
    }

  • Difference between logical and virtual terms

    Hello,
    This is not purely oracle question; but in documentation so many times we find 2 terms:
    A. Logical
    B.Virtual.
    So what is the principle difference between logical and virtual? As I know physical is that which I can see and touch; while logical/virtual is that is imaginary. We say tablespace is logical not virtual; while Java Virtual Machine; not Java Logical Machine. So I want to know; what is the principle difference; why two words for an imaginary thing. Before posting question; I searched in google as “Difference between virtual and logical” but I couldn’t found the answer.
    Please quote your comments.
    Thanks & Kind Regards
    Girish Sharma

    Girish,
    I wont say that I am correcting you as this is like that half glass full/empty thing.May be what I see is half empty , you would see the same as half full.
    Well now coming to the explanation.I am saying honestly , I got more confused after reading your definitions.What do you mean by saing that tablespace is not virtual.I see it as purely virtual.We don't say it as virtual tablespace or logical tablespace but it is actualy logical/virtual, having no existance but just the definition right?
    How can you say that the size of virtual is larger than logcial?The size of tablespace is actualy the sum total of size of datafiles.So it actualy becomes very larger right?Much larger than JVM which is of few megs only.
    The point 3 totally knocked me out.I have no idea what you said.
    Ok I tell you this.Just remember the definition that Hans gave already.If you ask me than its the best definition that we can have. Just remember this and if some one asks you more further than give them your point 3 definition and tell them understand this ;-).Please don'tmind I am just kidding. Its just semantics.Don't get lost into it.You will find many people using both the terms interchangibly. So its ok.I shall stick with Hans's defintion,simple and concise.There are lot more other topics to dig upon in oracle.I can mail you lots of them.Spend time on those.Don't think that I am demotivating you.I understand you asked only because you have a doubt.But we got a good resolution of it and beyond that, its not of much use to dig it atleast not in the technial terms.
    Cheers
    Aman....
    PS:Are you on oraclecommunity.net?

  • Difference Between BAPI And RFC in ABAP

    Hi,
    i want to know difference between BAPI and RFC in SAP,
    can we call SAP GUI screen from NON SAP System Using BAPI.
    Reg,
    Hariharan

    Hi Ravishankar,
    The difference is not importat while you understand the concept.
    I think, RFC is the protocol for calling functions from external systems in R/3.
    I understand like BAPI a series of complet functions that SAP offers you for use and model a business use.
    But if I need program a function that can be called for external system i would call it RFC_NAME, because is a unique function that makes a single task.
    In other words, the difference i think is about work idea more than another thing.
    RFC
    A remote function call is a call to a function module running in a system different from the caller's. The remote function can also be called from within the same system (as a remote call).
    RFC consists of two interfaces : A calling interface for ABAP Programs and a calling interface for Non-SAP programs.
    The RFC Interface takes care of :-
    - Converting all parameter data to the representation needed in the remote system
    Calling the communication routines needed to talk to the remote system.
    Handling communications errors, and notifying the caller, if desired ( using EXCEPTIONS paramater of the CALL FUNCTION).
    BAPI
    BAPIs are standardized programming interfaces (methods) enabling external applications to access business processes and data in the R/3 System.
    BAPIs provide stable and standardized methods to achieve seamless integration between the R/3 System and external applications, legacy systems and add-ons.
    BAPIs are defined in the BOR(Business object repository) as methods of SAP business object types that carry out specific business functions.
    BAPIs are implemented as RFC-enabled function modules and are created in the Function Builder of the ABAP Workbench.
    The most critical difference btwn BAPI and FM is that BAPI can be wrapped in Business objects whereas RFC cant.
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    The following standardized BAPIs are provided:
    Reading instances of SAP business objects
    GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
    The BAPI GetList() is a class method.
    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
    Create( ) and CreateFromData! ( )
    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
    Change( )
    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
    Check these Links out
    http://searchsap.techtarget.com/ateQuestionNResponse/0,289625,sid21_cid558752_tax293481,00.html
    http://www.sap-img.com/abap/interview-question-on-bapi-rfc-abap-objects-tables.htm
    http://www.sap-img.com/fu033.htm
    http://www.sap-img.com/abap/ale-bapi.htm
    Refer following SDN threads:
    Diff. Between BAPI and RFC
    Re: BAPI and RFC
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

Maybe you are looking for

  • T61- Blue Screen - - reporting unmountable boot volume

    Hi, I recently updated my T61 with the usual updates, but accidentally unpluged my computer before the updates were complete.  My computer was running on AC adapter alone because my battery was dead.  Now I have a new battery and when I turn my compu

  • Prob in printing cheque

    hello all, I hav problem when I am printing a chq.In sapscript,I hav created 3 pages :first,next,page1.When I execute The program then Itgives two cheq for one vendor becauz line item is geater then main window. I applied one method i.e when I put lo

  • Open Nef (Raw) file in CS3

    Hi, When trying to open a Nef (Raw) file from Nikon D90 in Photoshop CS3 the following happens: - Nikon Scan 4.0 tries to open (why scan?) and deliveres the message "buffer overrun, program must be terminated", the header for this message is "Visual

  • Integration between PS and MS project using open PS

    Hello all We have a requirement to interface MS Project with SAP PS using open PS that is a standard SAP provided interface.Since i dint work on this before please help me in answering the below questions:These are the clients requirement. 1. Methodo

  • Copy users with their Org assignments

    Hi, I'm working in a SAP system in which SAP Users are directly linked to Positions (for indirect role assignment need). Is it possible to copy users with all assignments ? All tests done using SU01 only copy User's data without their assignments. Th