NULL and SPACE

Hello Gurus:
I have had to use BOTH 'null' and 'space' (ofcourse I tried 'initial' too...) when selecting data from PRPS table, otherwise all the required records were not fetched. I had to do this on two different occassions. The first is a SAP provided field and the other is customer's enhancement. I have cut-paste the two code blocks. Any ideas why?
Thanks in advance,
Sard.
***********(1)**************
select posid objnr func_area zzfunct from prps into
                corresponding fields of table it_wbs
                          where func_area is null or
                                func_area eq space.
************(2)**************
select prps-pspnr prps-posid prps-post1
   into (wa_test1-pspnr, wa_test1-posid, wa_test1-post1,
   from prps
  where prps-posid in s_wbs and
        ...                 and
       ( prps-zzmlind is null or prps-zzmlind eq space ).
append wa_test1 to it_test1.
clear wa_test1.
endselect.

Hello Richard,
the Requirement to check for NULL corresponds to the definition of the database (field) within the DDIC. Check the flag initialize (it has also some documentation).
This flag is intended to be used if the definition of the db table is changed at SAP while the table already is used at customer side.
After deploying the corresponding patch or upgrade such a changed definition may result into the need to convert all entries. For tables with many entries this would result into inacceptable downtime. So such changes are done without the initialiazation/conversion of existing entries.
The tradeoff is the syntax you noticed.
Kind regards
Klaus

Similar Messages

  • NULL and Space value in ABAP

    Hi All,
           I like to know, is it NULL and Space value is same in ABAP, if it is not how to check null value.
    Thank you.
    Senthil

    everything is correct though some answers are not correct.
    A Database NULL value represents a field that has never been stored to database - this saving space, potentially.
    Usually all SAP tables are stored with all fields, empty fields are stored with their initial value.
    But: If a new table append is created and the newly-added fields do not have the 'initial value' marked in table definition, Oracle will just set NULL values for them.
    as mentioned: There is no NULL value to be stored in an ABAP field. The IS NULL comparison is valid only for WHERE clause in SELECT statement. WHERE field = space is different from WHERE field IS NULL. That's why you should check for both specially for appended table fields.
    If a record is selected (fulfilling another WHERE condition) into an internal table or work area, NULL values are convertted to their initial values anyway.
    Hope that sheds some light on the subject!
    regards,
    Clemens

  • No distinction between NULL and space

    No distinction between NULL and space. When you see the resultset, in PL/SQL developer, you will see that the NULL value is in yellow colour while column data having spaces is in white colour. In the new tool, there is not distinction between the two, so each time we will have to use the NVL function to determine the value in the column, which I would not like to do.

    An option in Preferences could be created, so that it was possible to choose as values NULL would be shown, as already it occurs in other tools.

  • Validation for text field: Null and contains no spaces

    Currently on APEX 3.2
    I want to check 1 text field and 2 text areas to ensure they are not null and blank (hitting the space bar in the field) before submitting the page. How do I do both validations for on each field?

    I created a validation with a type of 'Function Returning Boolean' and using the following code in the expression:
    IF( TRIM( :P1_Text_Field) IS NULL
    Or LTRIM( :P1_Text_Field ) != :P1_Text_Field )
    THEN
    RETURN false;
    ELSE
    RETURN true;
    END IF;
    Edited by: Jeremy_F on Apr 12, 2012 8:15 AM

  • Form feed, null and StringTokenizer

    is form feed recognized as null when using the StringTokenizer?
    i currently have my StringTokenizer set with a blank space and i am attempting to read until the value is (EOF) null and while it hasMoreTokens. the text file that i am reading from spans across several pages. my code falls out of my loop when it hits the last space on my first page.

    a form feed (\f) is not a null but that shouldn't be stopping the StringTokenizer, I suspect that the manner in which you're reading in the data may be the culprit. Try to use the BufferedReader class to read your file.
    V.V.

  • Order Of Null and Not Null Values while table creation

    We have to create a table with 10 fields .5 of them are Null and Not Null. Now my question what should be the order of fileds??.Means Null Fields will come first or Not Null.

    The only reason I can think of having the NULL columns at the end is storage space.
    To conserve space, a null in a column only stores the column length (zero). Oracle
    does not store data for the null column. Also, for trailing null columns, Oracle does
    not even store the column length.

  • More Fun with NULLs and Empty Strings

    Greetings,
    I ran across this behavior recently and thought I'd share with the forum. I'm running 10.2.0.2. Note the difference in behavior between passing and explicit NULL in the parameter vice passing an empty string (''):
    CREATE OR REPLACE PROCEDURE NULL_ES_TEST(PARAM1 IN VARCHAR2) IS
    VAR1 CHAR(1);
    BEGIN
    IF PARAM1 IS NULL THEN
    DBMS_OUTPUT.PUT_LINE('PARAM1 IS NULL');
    END IF;
    VAR1 := PARAM1;
    IF VAR1 IS NULL THEN
    DBMS_OUTPUT.PUT_LINE('VAR1 IS NULL');
    ELSE
    DBMS_OUTPUT.PUT_LINE('VAR1 IS NOT NULL');
    END IF;
    DBMS_OUTPUT.PUT_LINE('THE LENGTH OF VAR1 IS '||TO_CHAR(LENGTH(VAR1)));
    END NULL_ES_TEST;
    EXEC NULL_ES_TEST(PARAM1 => '');
    PARAM1 IS NULL
    VAR1 IS NOT NULL
    THE LENGTH OF VAR1 IS 1
    (var1 now holds a single space)
    EXEC NULL_ES_TEST(PARAM1 => NULL);
    PARAM1 IS NULL
    VAR1 IS NULL
    THE LENGTH OF VAR1 IS
    Any Comments or Insights are welcome.
    Sincerely,
    Dale Ward

    Well somethings not as expected (tested on 10.2.0.3)
    Even if you default the parameter to '', it treats null and '' differently.
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE PROCEDURE NULL_ES_TEST(PARAM1 IN VARCHAR2 := '') IS
      2    VAR1 CHAR(1);
      3  BEGIN
      4    IF PARAM1 IS NULL THEN
      5      DBMS_OUTPUT.PUT_LINE('PARAM1 IS NULL');
      6    END IF;
      7    VAR1 := PARAM1;
      8    IF VAR1 IS NULL THEN
      9      DBMS_OUTPUT.PUT_LINE('VAR1 IS NULL');
    10    ELSE
    11      DBMS_OUTPUT.PUT_LINE('VAR1 IS NOT NULL');
    12    END IF;
    13    DBMS_OUTPUT.PUT_LINE('THE LENGTH OF VAR1 IS '||TO_CHAR(LENGTH(VAR1)));
    14* END NULL_ES_TEST;
    SQL> /
    Procedure created.
    SQL> exec null_es_test(null);
    PARAM1 IS NULL
    VAR1 IS NULL
    THE LENGTH OF VAR1 IS
    PL/SQL procedure successfully completed.
    SQL> exec null_es_test('');
    PARAM1 IS NULL
    VAR1 IS NOT NULL
    THE LENGTH OF VAR1 IS 1
    PL/SQL procedure successfully completed.
    SQL>

  • Oracle evolution suggestion : NULL and Index

    Hello,
    As you know in most of case NULL values are not indexed and then not searchable using index.
    Then when you do where MyField is null, you have the risk of doing a full table scan
    However most of people don't know that, and then doesn't care of this possible issue and of possible solution (bitmap or including a not null column)
    SQL Server, MySQL and probably some others DB don't have the same behavior as they indexes NULL
    I know this caveat can be used to have partial indexing by nulling non interesting values and then can't be removed
    Then I would suggest to enhance the create index command to allow to index also null with something like that
    Create index MyIndex on MyTable(MyColumn including nulls )
    As you make this change, perhaps it would be geat to change the behavior documented bellow as it looks more as an old heritage too by adding keyword like "allow null duplicate" and "constraint on null duplicate"
    Ascending unique indexes allow multiple NULL values. However, in descending unique indexes, multiple NULL values are treated as duplicate values and therefore are not permitted.
    Laurent

    Hello,
    Thanks, for the links it cover mains solutions to index null values, there's also the usage of bitmap index.
    All of them are not very intuitive for an non expert.
    But the purpose of my message was mainly to higlight this complexity for a quite basic stuff, as I think that the default solution should be to index nulls and eventually allow to do not index them.
    As I said this is the behavior on sql server and mysql. That why i suggest to enhance index behavior to allow to index nulls easily and not by using stange tips like indexing a blank space or a not null column.
    This solutions are from my viewpoint workaround, helpfull workaround but still workaround, Oracle database team have the power to change this root cause without breaking ascending compatibility, here is the sense of my message, just hopping they can hear me...
    Laurent

  • Creating table with null and not null values.

    I have to create a table with 5 Null nd 5 Not Null fields.My questionis which fields are place first?Not or Not Null and why???

    What you mean is: the person who asked you the question thought the order of columns was important, and wanted to see if you agreed. Or maybe they were just asking the question to see whether you thought it was important (as a test of your understanding of the database).
    When I started out in Oracle I was told that it was good practice to have the mandatory columns first and then the optional columns. But if you do some research you find this: the impact of column ordering on space management is: empty nullable columns at the end of the table take up zero bytes whereas empty nullable columns at the middle of the table take up one byte each. I think if that saving really is important to you you need to spring for an additional hard drive.
    Besides, even if you do organise your columns as you suggest, what happens when you add an eleventh NOT NULL column to your table? It gets tacked on to the end of your table. Your whole neat organisation is blown.
    What does still matter is the positioning of large VARCHAR2 columns: they should be the last columns on your table in case they create chaining. Then any query that doesn't need the large columns can be satisfied without reading the chained block, something that can't be guaranteed if you've got columns after a VARCHAR2(4000) column. This doesn't apply to CLOBs, etc. which are stored separately anyway.
    Cheers, APC

  • How can i limit the user to enter only A to Z and space in JFormattedText

    dear
    i want to use JFormatedTextField in two manners
    1.Limit the no of charecters.means in a text field only 20 charecters r allowed.
    2.and also check the enterd charecter must be a to z and space not other chareters r allowed.
    3.same for numbers means 0 to 9 and decimal.
    how can i do by using the JFormated TextFilef.

    Probably lacks in some cases but what the hell.
    * Filename:           JSMaskedTextField.java
    * Creation date:      22-mei-2004
    * Author:                Kevin Pors
    package jsupport.swingext;
    import java.awt.event.KeyEvent;
    import java.util.Arrays;
    import javax.swing.JTextField;
    * A masked textfield is a textfield which allows only a specific mask of
    * characters to be typed. If characters typed do not occur in the mask
    * provided, the typed character will not be 'written' at all. The default mask
    * for this <code>JSMaskedTextField</code> is <code>MASK_ALPHA_NUMERIC</code>
    * @author Kevin Pors
    * @version 1.32
    public class JSMaskedTextField extends JTextField {
        /** Masking for alphabetical lowercase characters only. */
        public static final String MASK_ALPHA_LCASE = "abcdefghijklmnopqrstuvwxyz ";
        /** Masking for alpha-numeric characters (lcase/ucase) only. */
        public static final String MASK_ALPHA_NUMERIC = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
        /** Masking for alphabetical uppercase characters only. */
        public static final String MASK_ALPHA_UCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ";
        /** Masking for numbers only. */
        public static final String MASK_NUMERIC = "0123456789";
        /** Masking for hexadecimals. */
        public static final String MASK_HEXADECIMAL = "0123456789ABCDEF";
         * An array of keyevent constants defining which keys are always to be
         * allowed, no matter what.
        private final int[] ALWAYS_ALLOWED = new int[] { KeyEvent.VK_BACK_SPACE,
                KeyEvent.VK_DELETE, KeyEvent.VK_UP, KeyEvent.VK_DOWN,
                KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT, KeyEvent.VK_SHIFT,
                KeyEvent.VK_HOME, KeyEvent.VK_END};
        /** Boolean specifying whether casing should be ignored. */
        private boolean ignoringCase = true;
        /** Specifying whether the maskin is enabled */
        private boolean isMaskingEnabled = true;
        /** The mask for the textfield. */
        private String mask = MASK_ALPHA_NUMERIC;
         * Creates a default number field.
        public JSMaskedTextField() {
            super(null, null, 0);
            Arrays.sort(ALWAYS_ALLOWED);
         * Creates a number field, with a specified number of columns.
         * @param columns The columnnumber.
        public JSMaskedTextField(int columns) {
            super(null, null, columns);
            Arrays.sort(ALWAYS_ALLOWED);
         * Creates a JSMaskedTextField with a masking.
         * @param mask The masking to be used.
        public JSMaskedTextField(String mask) {
            super(null, null, 0);
            Arrays.sort(ALWAYS_ALLOWED);
            setMask(mask);
         * Gets the masking for this masked textfield.
         * @return Returns the mask.
        public String getMask() {
            return this.mask;
         * Gets whether this JSMaskedTextField should be ignoring casing.
         * @return Returns if the component should be ignoring casing.
        public boolean isIgnoringCase() {
            return this.ignoringCase;
         * Checks whether masking is enabled. Default should be true.
         * @return Returns true if masking is enabled, false if not.
        public boolean isMaskingEnabled() {
            return this.isMaskingEnabled;
         * Sets whether it should be ignoring casing when checking for alpha-chars.
         * @param ignoringCase The ignoringCase to set.
        public void setIgnoringCase(boolean ignoringCase) {
            this.ignoringCase = ignoringCase;
         * Sets the masking for this textfield. The masking will determine which
         * characters can be typed. If the characters in de <code>mask</code> do
         * not occur in the typed character, it won't be typed.
         * @param mask The mask to set.
        public void setMask(String mask) {
            this.mask = mask;
         * Sets the masking enabled. If <code>false</code> this component will
         * behave just like a normal textfield.
         * @param isMaskingEnabled true if masking should be enabled.
        public void setMaskingEnabled(boolean isMaskingEnabled) {
            this.isMaskingEnabled = isMaskingEnabled;
         * Sets text of this textfield. If the blah blah.
         * @see javax.swing.text.JTextComponent#setText(java.lang.String)
        public void setText(String text) {
            for (int i = 0; i < text.length(); i++) {
                if (getMask().indexOf(text.charAt(i)) < 0) { // does not occur
                    return;
            super.setText(text);
         * @see javax.swing.JComponent#processKeyEvent(java.awt.event.KeyEvent)
        protected void processKeyEvent(KeyEvent e) {
            if (!isMaskingEnabled()) {
                return;
            char typed = e.getKeyChar();
            int code = e.getKeyCode();
            for (int i = 0; i < ALWAYS_ALLOWED.length; i++) {
                if (ALWAYS_ALLOWED[i] == code) {
                    super.processKeyEvent(e);
                    return;
            if (typed == KeyEvent.VK_BACK_SPACE) {
                super.processKeyEvent(e);
            if (isIgnoringCase()) {
                String tString = new String(typed + "");
                String ucase = tString.toUpperCase();
                String lcase = tString.toLowerCase();
                if (getMask().indexOf(ucase) < 0 || getMask().indexOf(lcase) < 0) {
                    e.consume();
                } else {
                    super.processKeyEvent(e);
                    return;
            } else { // not ignoring casing
                if (getMask().indexOf(typed) < 0) {
                    e.consume();
                } else {
                    super.processKeyEvent(e);
    }

  • Why should i add a dot and space to execute this oracle provided script?

    When multiple oracle databases are installed in one machine, we need to set the environment variables like ORACLE_HOME, ORACLE_SID before logging into the respective database. For this, oracle provides as script called oraenv.
    If we try to execute oraenv like
    oraenv   #without a dot and space before the filenamethe file seem to get executed but none of the env variables actually get set.
    To execute this script correctly we have to put a dot and a space before the filename like
    . oraenvWhat is difference between these two way of executing scipts?
    The orenv code
    # $Header: oraenv.sh.pp 19-jul-2001.14:02:07 jboyce Exp $ oraenv.sh.pp Copyr (c) 1991 Oracle
    # usage: . oraenv
    # This routine is used to condition a user's environment for access to
    # an ORACLE database. It will prompt for the value of the new SID unless
    # the variable ORAENV_ASK is set to NO, in which case it will use the
    # current value of ORACLE_SID.
    # The character "*" denotes a null SID.
    # NOTE:          Due to constraints of the shell in regard to environment
    # -----          variables, the command MUST be prefaced with ".". If it
    #          is not, then no permanent change in the user's environment
    #          can take place.
    case ${ORACLE_TRACE:-""} in
        T)  set -x ;;
    esac
    # Determine how to suppress newline with echo command.
    N=
    C=
    if echo "\c" | grep c >/dev/null 2>&1; then
        N='-n'
    else
        C='\c'
    fi
    # Set minimum environment variables
    # ensure that OLDHOME is non-null
    if [ ${ORACLE_HOME:-0} = 0 ]; then
        OLDHOME=$PATH
    else
        OLDHOME=$ORACLE_HOME
    fi
    case ${ORAENV_ASK:-""} in                       #ORAENV_ASK suppresses prompt when set
        NO)     NEWSID="$ORACLE_SID" ;;
        *)     case "$ORACLE_SID" in
             "")     ORASID=$LOGNAME ;;
             *)     ORASID=$ORACLE_SID ;;
         esac
         echo $N "ORACLE_SID = [$ORASID] ? $C"
         read NEWSID
         case "$NEWSID" in
             "")          ORACLE_SID="$ORASID" ;;
             *)             ORACLE_SID="$NEWSID" ;;          
         esac ;;
    esac
    export ORACLE_SID
    ORAHOME=`dbhome "$ORACLE_SID"`
    case $? in
        0)     ORACLE_HOME=$ORAHOME ;;
        *)     echo $N "ORACLE_HOME = [$ORAHOME] ? $C"
         read NEWHOME
         case "$NEWHOME" in
             "")     ORACLE_HOME=$ORAHOME ;;
             *)     ORACLE_HOME=$NEWHOME ;;
         esac ;;
    esac
    export ORACLE_HOME
    # Put new ORACLE_HOME in path and remove old one
    case "$OLDHOME" in
        "")     OLDHOME=$PATH ;;     #This makes it so that null OLDHOME can't match
    esac                    #anything in next case statement
    case "$PATH" in
        *$OLDHOME/bin*)     PATH=`echo $PATH | \
                       sed "s;$OLDHOME/bin;$ORACLE_HOME/bin;g"` ;;
        *$ORACLE_HOME/bin*)     ;;
        *:)               PATH=${PATH}$ORACLE_HOME/bin: ;;
        "")               PATH=$ORACLE_HOME/bin ;;
        *)               PATH=$PATH:$ORACLE_HOME/bin ;;
    esac
    export PATH
    # Install any "custom" code here
    # Locate "osh" and exec it if found
    ULIMIT=`LANG=C ulimit 2>/dev/null`
    if [ $? = 0 -a "$ULIMIT" != "unlimited" ] ; then
      if [ "$ULIMIT" -lt 2113674 ] ; then
        if [ -f $ORACLE_HOME/bin/osh ] ; then
         exec $ORACLE_HOME/bin/osh
        else
         for D in `echo $PATH | tr : " "`
         do
             if [ -f $D/osh ] ; then
              exec $D/osh
             fi
         done
        fi
      fi
    fi

    The dot is used to "source" a file. It is commonly used to change your environment variables without forcing you to log out and back in again for the changes to take effect. Check out "source command for Solaris 10" or something similiar for more info.

  • Using NULL and NOT NULL in prompted filters

    Dear all,
    While trying to grap the concept of prompted filters in sap bo web intelligence, I had a question whether why we cannot use NULL and NOT NULL while creating a prompted filters in our report.

    HI,
    'Is Null' and 'Not Null' are the predefined functions in webi which only eliminate the null values or considering only null values.
    'Is Null' and 'Not Null' are itself predefined functions that why you are not getting  prompts.
    Null values are standard across the databases so this is defined  as a function in webi to specific eliminate the null values.
    If something is not standard then there is option in the webi to use different operator with static values or with prompts.
    More more information on Null see the Null wiki page.
    Null (SQL) - Wikipedia, the free encyclopedia
    Amit

  • Not null and enable or disable  column in tabular form

    Hi,
    Using apex version 4.1 and working on tabular form.
    ACT_COA_SEGMENT_MAS is Master table
    and
    ACT_SEGMENT_VALUES_MAS is detail table
    I have entered 8 rows in master table and PARENT_SEGMENT_ID is column in master table which is null able. If i specified PARENT_SEGMENT_ID with value in master table then in detail table there is column PARENT_ID that should not be null and enable.
    How i can enable or disable column when in master table PARENT_SEGMENT_ID column is null then in detail table PARENT_ID column should disable and vice versa.
    I have created tabular form on Detail table. before insert into the tabular form Check in master table in first entry if PARENT_SEGMENT_ID is not null in first row of master table then in tabular form PARENT_ID should enable and not null able in corresponding to this first row id's lines in tabular form.
    Same should check for second row in master table if PARENT_SEGMENT_ID is not null then entered rows with PARENT_ID into tabular form corresponding to 2nd id in master table should not nullable and column should enable in tabular form.
    Thanks & Regards
    Vedant
    Edited by: Vedant on Jan 9, 2013 9:12 PM

    Vedant,
    You need to create you own manual tabular form and not use the wizard.
    Using APEX_ITEM api you should be build you own form and you will be able to control how you wan to display the rows. (See Link [Apex Item Help|http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_item.htm#CACEEEJE] )
    select case when PRIMARY_TABLE_COLUMN is null then APEX_ITEM.DISPLAY_AND_SAVE(3 , DETAIL_COLUMN ) else APEX_ITEM.TEXT(2,detail_column) end "ALIAS" from detail table
    Hope that help.
    Vivek

  • Connection ==null and Connection is closed, difference

    Hi experts,
    I wonder what are the differences between "Connection==null" and "Connection is closed"?
    I closed a connection on one JSP page after a bean has retrieved data. Then, on the same page I call another bean to connect to the database. Because the Connection object has been created earlier, therefore Connection is not NULL, but it is closed. So, the second bean has to initiate another connection(if I knew how to test the "closed" status)
    Is it true that if the Connection is closed, then it should become null?
    I think I must have make quite a few mistakes in above statement:). Please help. Thanks a lot.

    connection.isClosed() will tell you if the connection object is closed or not. If it is closed, then the connection object can be dropped because you will not be able to create any new statements from that connection object. Just recreate another connection to use when this occurs.

  • Is null and regular value in where ($variable)

    is there any polibility to create select depend on value in where ?
    select count(x) where y = $variablebut if variable is NULLit doesn't work cause must be IS NULL or IS NOT
    select count(x) where y is $variableIs there any posibility to make it working with null and regular variable?

    try:
    select count(x) from <yourtable> where nvl(y,<not_possible_value>) = nvl($variable,<not_possible_value>);where <not_possible_value> is a value that is not possible for column y.
    E.g. if y always is a positive number you could use the value -1.

Maybe you are looking for

  • Drag 'n' Drop???

    I just noticed that for some reason some of the songs in certain albums on iTunes are not in numerical order. It does not simply let me "drag and drop" the songs in the order they should be in. I've tried everything I can think of to rearrange them a

  • Possible to get 'Automatic' device register without NSP ?

    Hi  Anybody pleade hint me config ISE1.2 I need to do separated ssid called on-board. Once non registed device comes in, ISE get sredirect to registering portal.  I can finish self fill in device register which user need to fill in his MAC manually.

  • Envelope Distort Issue

    I'm using envelope distort option under the objects file menu to put some text on a roof top shape but the top of the text is distorting badly. (See attached image) Anyone know why this happen and how to solve this? Any help would be greatly apprecia

  • Alternative of this

    Hi All,   Can you provide me with the alternative Query for finding the maximum Maxnu = 0.        Select * from <DB Table> where Field = ‘Condition’ and Field = ‘Condition’.              Check DB Table-field > maxnu.              Maxnu = DB Table-fie

  • Partial(?) SQL Developer

    Here are the symptoms: Can only connect to SQL Express as SYS (or SYSTEM) When using TNS, no schemas show in Network Alias dropdown No developer-created tables (in SQL Express) can be viewed in SQL Developer connection Environment: Using local machin