Empty strings morphed to NULL ???

Hi all,
I am executing the following SQL-statement (short version):
statement = (OraclePreparedStatement)
connection.prepareStatement(
"INSERT INTO TEST VALUES (?)");
statement.defineColumnType(1, OracleTypes.VARCHAR);
statement.setString (1,"");
statement.execute();
statement.close();
connection.commit();
Then I have a look into the table TEST (with SQL-PLUS) and see
that my stringValue "" morphed to a NULL-value !!!
Why are "" Strings mapped to NULL ???
Is there a configuration-parameter to turn this "feature" off ???
"" is not the same as NULL, is it ???
Thank You in advance,
Ralf.
null

Ralf Severloh (guest) wrote:
: Why are "" Strings mapped to NULL ???
This is a known Oracle feature / bug (depending on your
perspective). Null strings are equal to null. Try "SELECT 1 FROM
dual WHERE '' IS NULL;" to prove it.
: Is there a configuration-parameter to turn this "feature" off
Not as far as I know.
: "" is not the same as NULL, is it ???
Not to my way of thinking, however Oracle disagrees.
--> Steve
null

Similar Messages

  • Problem: textbox leave empty string("") instead of null

    Hello, I have a problem with textboxes. By default, they always are initialized to null, but when I start entering and removing data from textboxes, many times they leave an empty string "" instead of null.
    And, of course, it's not the same a null value as an empty string and thus, I haven't got the expected result in queries to database.
    Thus, I always have to compare textbox values with "" and null. It's very tedious and not elegant solution. I would like to know if there is another way to get the values as null instead of empty strings.

    Yes. Once you entered and remove the text it will evaluated as you told .
    For ur case u can Try the condition as
    if ( instance !=null && instance.length !=0)
    be sure instance != null check b4 other wise u can get NullPointerException

  • Empty string in NOT NULL column

    I'm migrating data to Oracle 9i from a database engine that supports emtpy strings in column with NOT NULL specified in the DDL. I would have thought Oracle would support this, but any attempt to put empty string data into a column created with NOT NULL is returning a 'column does not support nulls'-type error.
    Is there an option to allow this, or does Oracle simply not support this and assumes blank is null?
    Thanks

    I would have thought Oracle would support this, but any attempt to put empty string data into a column created with NOT NULL is returning a 'column does not support nulls'-type error.In Oracle Null means null nothing not even an empty String.
    Yes DB's like Ingress supports this. But I think Oracle is right.
    Is there an option to allow this, or does Oracle simply not support this and assumes blank is null?I am not aware of any options as it is against the basic principles.
    you can find work arounds to do the migration. But storing a blank NO.
    Good Luck
    Vij

  • Empty Strings are converted to NULLs

    We are developing a Java application intended to work with multiple databases. We want to store empty strings but oracle converts this to NULL values. Is there a way to tell the Oracle Database not to convert the empty string to NULL and to store it as an empty string?
    Thanks
    Joaquim Franco <[email protected]>
    GEDI, SA

    Our project started with a MySQL database and the code is full of built queries like "Select Field from table where field = var" where var can be an empty string. It would be easier for us to turn a switch in the database then to look for every query in the application and add code to test is var is empty a change the query to "Select Field from table where field is NULL".
    Best Regards
    Joaquim Franco
    &gt; It is a quirk of Oracle that it regards empty strings
    &gt; and NULLs as being the same thing. This behaviour
    &gt; has been built into the database forever. Oracle
    &gt; keep threatening to change but I suspect they are
    &gt; scared of the impact, not least on their own code.
    &gt; As Oracle increasingly embrace Java they may decide
    &gt; to revisit this - I don't know whether the behaviour
    &gt; is changed in 10G.
    &gt;
    &gt; What sort of problems does it cause you?
    &gt;
    &gt; Cheers, APC

  • How to distinguish NULL and Empty Strings

    Hi,
    Just to set the context right; I'm an experienced C programmer trying labview for the first time. As such I ran in to a problem being that Labview has no concept of NULL-pointers and more specifically appears to have no concept of the difference between a NULL-string and an empty-string
    I'm trying to make a structure (bundle) of strings (in it's most basic form key-value pairs) which i'd like to (for instance) URI encode in order to send it to a web server. For those who are not familiar with URI encoding; there is a distinguished difference between setting a key to an empty string and setting a key with no value. In C I would use a pointer to an empty string vs a NULL string pointer to symbolize this.
    In essence I need an elegant way to distinguish between a defined but empty string and an undefined string (hmmm this is actually describing the same problem but now in terms of perl).
    Anybody have any pointers (pun not intended) for me ?

    This is a bit depending on the interface you have with your encoder. The whole issue is that LV has no pointers at all (and you will like it, as you will never have any Null-Pointer exeptions and the like).
    Assuming that you use a dll (so the Call Library node).
    Use CString as input -> NULL-Terminated String.
    Use I32 as input and pass 0 -> NULL string.
    Felix
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml

  • What is in the column, empty string, null or ....?

    I am using Oracle 11.2, have one table tb_class as following:
    TB_CLASS (id number(3), nm varchar2(32), seqNum number(3));
    1, ,212
    2,'as', 12
    3, 'qq', 12
    select * from TB_CLASS where id=1 and nm=null; ...no row selected
    select nvl(nm) from TB_CLASS where id=1; ...1 row selected
    Any one know what is in column nm for row id=1? I thought it is empty string, but why it returns no row in the first query?
    Thanks!

    1) In Oracle there is no difference between NULL and the empty string.
    2) NULL is never equal to anything (including another NULL). NULL is never unequal to anything (including another NULL). You need to use the IS NULL and/ or IS NOT NULL operators in order to look for NULL values
    SELECT *
      FROM tb_class
    WHERE nm IS NULLor
    SELECT *
      FROM tb_class
    WHERE nm IS NOT NULLOf course, it is also possible that you are stating that the NM column contains one or more spaces or that it contains one or more non-printable characters rather than a NULL. That's why you were asked what dump(nm) returns
    Justin

  • Oracle SQL-92 Non compliance:  When will oracle support empty strings?

    Oracle is the only database on the planet that equates an empty string to a null value. For several major versions, Oracle has said "Make sure you don't rely on null and empty string equivalency because it could go away in the future." When will Oracle get with it and support this aspect of the SQL-92 standard (not to mention mathmatical logic)?

    You log enhancement requests through Metalink.
    The procedure is documented in Metalink document 166650.1 as follows:
    How to Log an Enhancement Request:
    Create a new Service Request in MetaLink.
    On the Create a SR - Brief Description screen, in the Type of problem field, select Enhancement Request.
    Important factors to remember when filling out the Enhancement Request Service Request template and creating the Service Request:
    Fully describe why the current product functionality does not meet your needs.
    Explain in detail the enhancement you would like implemented
    If possible, describe how the product can be changed to achieve the desired results.
    Describe your business expectations. Include key milestone dates and justifications as to why this request is so important and the benefits your organization stands to gain should this request be accepted.
    Once your Service Request has been created, it will be assigned to a Support Engineer who will validate your information. In some cases, your request may be a new or known product defect that the Support Engineer can either provide a fix, a workaround, or introduce to Oracle Development for resolution. In other cases, you may be presenting a valuable product enhancement that can improve Oracle product functionality. In all cases, the Support Engineer will be able to qualify your request and pass along the information to Oracle Development.
    Once the Support Engineer validates your request, and an agreed upon action plan is created, your Support Engineer will create a new Enhancement Request and provide you with an Enhancement Request tracking number. The BUG search tool on MetaLink can then be used to receive status updates.
    Please note that the Support Engineer will close the SR once the enhancement has been logged.
    Also, see document 214168.1

  • Oracle, Null and empty Strings

    Currently I'm facing problems with a class, which contains a String, which
    is set to "" (empty String).
    When the class is persistent, oracle writes null to the table column
    (which seems to be common oracle behaviour) and when retrieving the class,
    the field is set to null as well, giving me a lot of null-pointer
    exceptions.
    Anyway ... I can cope with that (just a lot of extra work)
    far worse is the problem, wenn searching objects, that have this field set
    to "" oder null.
    Oracle can't find the records because JDO creates Querys "where
    string=null" or "where string=''" , where oracle expects "where string is
    null" to find the records.
    Is there a workaround or solution ?

    Yeah, that would work as well, thx, but since I have to cope with
    null-Strings now everywhere in my program, it doesn't hurt just to forbid
    empty strings on the program side.
    In future times I'll test on Oracle first, then porting to DB/2 - this way
    I suppose work is far less to garant compability.
    Nevertheless ... having to set the bankcode into quotes is a kodo bug in
    my opinion.
    Kodo knows the type of classfields (in this case string) and shouldn't
    send the parameter as a BigDecimal to the database.
    Given that, and having only bankcodes of null (only neccesary when using
    Oracle), the method would look like:
    public Collection getAccounts (String bankCode)
    throws Exception
    return getAccounts (Account.class, "bankcode=="+bankcode);
    which is how a transparent persistent layer, um, should be , um , I mean
    ... just transparent ;-D
    Marc Prud'hommeaux wrote:
    Stefan-
    Couldn't you just do something like:
    public Collection getAccounts (String bankCode)
    throws Exception
    String filter;
    if (bankCode == null || bankCode.length () == 0)
    filter = "(bankCode == null || bankCode == "")";
    else
    filter = "bankCode == "" + bankCode + """;
    return getAccounts (Account.class, filter);
    If I understand the problem correctly, this should work for all the
    databases.
    In article <[email protected]>, Stefan wrote:
    What operations are you performing to cause this SQL to be issued? You
    say you are having trouble removing objects, but this is clearly not a
    DELETE statement. Is this the SQL that is issued when looking up
    objects by identity?I'm not removing objects, I was removing just quotes from parameters ;-)
    A string column... is it also represented as a string field in your class?Yeah ... just to give you an impression of the code:
    First we have a class, representing a bank account:
    public class Account {
    private AccountMgr myAccountMgr;
    private String bankCode;
    private String id;
    Note, that in nearly all cases bankCode will be a number or null.
    I have a second class "AccountMgr", which does all of the persistant stuff
    (seaching, making persistent etc.)
    This class has two methods, one versatile (protected) to retrieve accounts
    by a given filterString and one who just returns accounts by bankCode,
    building the expected filterstring. Here is my current working version:
    public class AccountMgr {
    public Collection getAccounts(String bankCode) throws Exception {
    if (bankCode!=null) {
    if (bankCode.equals("")) {
    throw new Exception("check code, bankCode='' not allowed to get
    same behavior from DB2 and Oracle");
    // if set, quote the bankCode
    bankCode="""+bankCode+""";
    return getAccounts(Account.class,"bankCode=="+bankCode);
    protected Collection getAccounts(Class accountClass, String filterAdd)
    throws Exception {
    PersistenceManager pm = MyHelper.getPersistenceManager();
    String filter="";
    if (filterAdd!=null && !filterAdd.trim().equals("")) {
    filter+=filterAdd + " && ";
    filter += "myAccountMgr==_accMgr";
    Query query = pm.newQuery(accountClass, filter);
    query.declareParameters("AccountMgr _accMgr");
    return (Collection) query.execute(this);
    As you can see, in the first method I have to set the bankCode into
    quotes, when it's not null.
    This is because otherwise a filter like "bankCode=1234" will be translated
    in a way, where 1234 is send as a BigDecimal to the database:
    [...] executing statement <4239745>: (SELECT [...] FROM JDO_ACCOUNT t0
    WHERE t0.BANKCODE = ? : [reused=1;params={(BigDecimal) 1234}]
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • NULL and Empty String

    Hi There,
    As far as I know, Null is not the same as an empty string; however, when I try this out, I get some unexpected results (well, at least unexpected for my liking):
    SQL> CREATE TABLE TS (MID NUMBER,
      2  MDESC VARCHAR2(20) DEFAULT '' NOT NULL);
    Table created.
    SQL> INSERT INTO TS VALUES(1,'');
    INSERT INTO TS VALUES(1,'')
    ERROR at line 1:
    ORA-01400: cannot insert NULL into ("TT"."TS"."MDESC")So, according to the above scenario, I can't insert an empty string!! However, an empty string is a valid string that doesn't have tuples/data!!
    How come Oracle translates the null string '' as NULL?
    Thanks

    William Robertson wrote:
    There is a special case to do with CHAR values, whereby '' counts as a string and so gets blank-padded, whereas NULL does not.Are you referring to:
    SQL> DECLARE
      2      flag CHAR(2);
      3      PROCEDURE check_null (p_flag IN CHAR)
      4      IS
      5      BEGIN
      6        IF p_flag = '  '
      7        THEN
      8          dbms_output.put_line ('flag is equal to ''  ''');
      9        ELSIF p_flag IS NULL
    10        THEN
    11          dbms_output.put_line ('flag is null');
    12        ELSE
    13          dbms_output.put_line ('other');
    14        END IF;
    15      END;
    16    BEGIN
    17      flag := '';
    18      check_null (flag);
    19      flag := NULL;
    20      check_null (flag);
    21    end;
    22  /
    flag is equal to '  '
    flag is null
    PL/SQL procedure successfully completed.
    SQL> alter session set events '10932 trace name context forever, level 16384';
    Session altered.
    SQL> DECLARE
      2      flag CHAR(2);
      3      PROCEDURE check_null (p_flag IN CHAR)
      4      IS
      5      BEGIN
      6        IF p_flag = '  '
      7        THEN
      8          dbms_output.put_line ('flag is equal to ''  ''');
      9        ELSIF p_flag IS NULL
    10        THEN
    11          dbms_output.put_line ('flag is null');
    12        ELSE
    13          dbms_output.put_line ('other');
    14        END IF;
    15      END;
    16    BEGIN
    17      flag := '';
    18      check_null (flag);
    19      flag := NULL;
    20      check_null (flag);
    21    end;
    22  /
    flag is null
    flag is null
    PL/SQL procedure successfully completed.
    SQL> SY.
    P.S. Don't ask me why normal (or at least consistent) behavior is not the default.

  • Null and empty string not being the same in object?

    Hello,
    I know that null and empty string are interpreted the same in oracle.
    However I discovered the strange behaviour concerning user defined objects:
    create or replace
    TYPE object AS OBJECT (
    value VARCHAR2(2000)
    declare
    xml xmltype;
    obj object;
    begin
    obj := object('abcd');
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    obj.value := '';
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    obj.value := null;
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    end;
    When creating xml from object, all not-null fields are transformed into xml tag.
    I supposed that obj.value being either '' or null will lead to the same result.
    However this is output from Oracle 9i:
    <OBJECT_ID><VALUE>abcd</VALUE></OBJECT_ID>
    <OBJECT_ID><VALUE></VALUE></OBJECT_ID>
    <OBJECT_ID/>
    Oracle 10g behaves as expected:
    <OBJECT><VALUE>abcd</VALUE></OBJECT>
    <OBJECT/>
    <OBJECT/>
    However Oracle 9i behaviour leads me to the conclusion that oracle
    must somehow distinguish between empty string and null in user defined objects...
    Can someone clarify this behaviour?
    Thus is it possible to test if object's field is empty or null?

    However Oracle 9i behaviour leads me to the conclusion that oracle
    must somehow distinguish between empty string and null in user defined objects...
    Can someone clarify this behaviour?
    Thus is it possible to test if object's field is empty or null?A lot of "fixes" were done, relating to XML in 10g and the XML functionality of 9i was known to be buggy.
    I think you can safely assume that null and empty strings are treated the same by Oracle regardless. If you're using anything less than 10g, it's not supported any more anyway, so upgrade. Don't rely on any assumptions that may appear due to bugs.

  • 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.

  • [svn:bz-trunk] 11030: Tweak the deserialization of ASObjects to treat an empty string for the type of an object as null .

    Revision: 11030
    Author:   [email protected]
    Date:     2009-10-20 11:35:02 -0700 (Tue, 20 Oct 2009)
    Log Message:
    Tweak the deserialization of ASObjects to treat an empty string for the type of an object as null. It appears that there is some logic in the LC remoting code that relies on a non-null class name to always exist. This change reverts to the old behavior of not allowing empty string as a value for the ASObject.namedType.
    This should fix bug 2448442 and its duplicates caused by the recent serialization changes.
    I don't think this is the perfect fix. Pending further investigation, a better fix would be either:
    a. If it's OK to assume that empty string should always mean null for the type of the ASObject, the code that enforces it should be in the setter/getter inside ASObject and not in the deserializer.
    b. ASObject doesn't guarantee that a named type exists or is valid. In that sense an empty string is as bad as some random characters that cannot be a valid class name in java, so depending on how disruptive it may be, the fix should be in any logic that uses ASObject.getType().
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/io/amf/AbstractAmfInput.java

    Hi Pavan,
    "In your payload there is no namespace prefix for the elements under PayloadHeader element."
    Yes, you are right - but this message is standard AQ Adapter Header message - it's not defined by me. I just used message which was automatically added to my project when I have defined AQ Adapter.
    "In your process is the default namespace is same as namespace value of tns ??"
    Do you mean targetNamespace? If yes it's different as it points to process "targetNamespace="http://xmlns.oracle.com/PF_SOA_jws/PF_APPS/APPS_PROCESS" (names of application and process have changed as I try different ways to do that)
    ns1 is: xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/aq/PF_SOA/PF_APPS/PO_AQ"
    "another thing is tns and ns1 should have same values.."
    When I create a variable of header type, namespace ns1 is automatically created for it. I set it as property of receive activity. When process is instantiated on the serwer I get the error in which you can see that namespace is tns.
    Maybe I'm doing something wrong but I don't see how I could fix this in my process.
    You can see that the message I get on the server has nothing in common with the application/project/process names. Is it possible to define such variable?
    Regards
    Pawel
    PS:
    In Transformation xsl file, both variables (source and target) has tns namespace for Header and PayloadHeader, and no namespace for subfields.
    Edited by: pawel.fidelus on 2010-01-05 02:37

  • JDBC Receiver does not convert empty string to NULL

    Hello experts,
    I am facing a problem with an INSERT statement to ORACLE DB where some of the fields are empty, for example:
    - <STATEMENT_VLP_CONT_DETAILS>
    - <TABLE_VLP_CONT_DETAILS ACTION="INSERT">
      <TABLE>VLP_CONT_DETAILS</TABLE>
    - <ACCESS>
      <VLP_HDR_ID>43</VLP_HDR_ID>
      <VLP_CONT_LINE_ID>1</VLP_CONT_LINE_ID>
      <QUANTITY>1</QUANTITY>
      <OWNER>CBHU</OWNER>
      <SERIAL_NO>3372739</SERIAL_NO>
      <CONT_ISO_CODE>2300</CONT_ISO_CODE>
      <WEIGHT>6.44</WEIGHT>
      <POL>ILASH</POL>
      <POD>FRFOS</POD>
      <FD>FRFOS</FD>
      <OPER_CODE>COS</OPER_CODE>
      <CUR_STOW_LOC>150102</CUR_STOW_LOC>
      <PRV_STOW_LOC />
      <HAZARDOUS>N</HAZARDOUS>
    In the JDBC Receiver comm channel I selected: Interpretation of Empty String Values = NULL Value.
    It seems the empty strings are not converted to NULL values as can be seen in the reflected SQL statement in RWB:
    INSERT INTO  VLP_CONT_DETAILS (VLP_HDR_ID, VLP_CONT_LINE_ID, QUANTITY, OWNER, SERIAL_NO, CONT_ISO_CODE, WEIGHT, POL, POD, FD, OPER_CODE, CUR_STOW_LOC, PRV_STOW_LOC, HAZARDOUS, EMPTY, REFER, OOG, HAZARD_IMDG, TEMP_SET, TEMP_MIN, TEMP_MAX, FRONT_OVL, REAR_OVL, RIGHT_OVW, LEFT_OVW, OVERHEIGHT, COMMODITY, BOOKING_REF, ALLOTMENT, YARD_LOC, LD_SEQ_CRANEID, LD_SEQ_NUMBER, LD_STATUS, STACKABLE, OPT_PORT_CODE1, OPT_PORT_CODE2, OPT_PORT_CODE3) VALUES (44, 1, 1, CBHU, 3372739 , 2300,  6.44, ILASH, FRFOS, FRFOS, COS,   150102,         , N, N, N, N,      ,      ,      ,      ,    ,    ,    ,    ,    ,     ,             ,    ,           ,    ,    0,    64, N,      ,      ,      )
    So, I am getting the following error:
    Could not execute statement for table/stored proc. "VLP_CONT_DETAILS" (structure "STATEMENT_VLP_CONT_DETAILS") due to java.sql.SQLException: ORA-00936: missing expression
    Help would be appreciated.

    Hi Effi,
    There is a mismatch in the field and thier value.
    Here field id 37
    VLP_HDR_ID, VLP_CONT_LINE_ID, QUANTITY, OWNER, SERIAL_NO, CONT_ISO_CODE, WEIGHT, POL, POD, FD, OPER_CODE, CUR_STOW_LOC, PRV_STOW_LOC, HAZARDOUS, EMPTY, REFER, OOG, HAZARD_IMDG, TEMP_SET, TEMP_MIN, TEMP_MAX, FRONT_OVL, REAR_OVL, RIGHT_OVW, LEFT_OVW, OVERHEIGHT, COMMODITY, BOOKING_REF, ALLOTMENT, YARD_LOC, LD_SEQ_CRANEID, LD_SEQ_NUMBER, LD_STATUS, STACKABLE, OPT_PORT_CODE1, OPT_PORT_CODE2, OPT_PORT_CODE3
    And value is 35
    44, 1, 1, CBHU, 3372739 , 2300, 6.44, ILASH, FRFOS, FRFOS, COS, 150102, , N, N, N, N, , , , , , , , , , , , , , , 0, 64, N, , ,
    Give empty values for nuil fields so that they can be made NULL by jdbc adapter
    Regards
    Suraj

  • Distinguishing between empty string and null values

    hi all,
    I am using an ODBC connection to connect my java app to database using JDBCODBC driver. I have 2 columns 'aColumn' and 'bColumn' in my table, both allow null values. I have one row in it, which has null value in aColumn and empty string in bColumn. I retrieve this row's data and assign it to 2 columns : 'aColumnVar' and 'bColumnVar' respectively. I find out that both 'aColumnVar' and 'bColumnVar' variables has null values (although bColumnVar should has an empty string as its value). Now my ODBC connection Data Source has the option "Use ANSI nulls, paddings, and warnings" ON. I turn it off and try again. This time both 'aColumnVar' and 'bColumnVar' variables has empty string as values (although aColumnVar should has null as its value).
    How can I make sure that i can get the data exactly as it is in the database in my variables?
    Thanks

    there is a wasNull() method on ResultSet. After you
    have obtained the value of a column e.g. by calling a
    method like getString you can call wasNull and if it
    returns true then the value on the database is null.
    Check the java docs, it might explain it better
    http://java.sun.com/j2se/1.4.1/docs/api/java/sql/Result
    et.html#wasNull()I am using MS SQL Server 7.0 under Windows NT 4.0 with JDK 1.2. My ODBC connection Data Source has to have the option "Use ANSI nulls, paddings, and warnings" ON.
    I try the wasNull() method but it is doing the same thing i.e. telling me that a column is null when in database it is null (right); and a column is null when in database it is an empty string (wrong). I suspect it is something to do with the JDBC-ODBC driver I am using.

  • NULL vs. Empty String

    I am new to ORACLE, moving over from MS SQL Server. Is it true that you cannot enter an empty string into a NOT NULL VARCHAR2?
    I am trying to convert data from an existing DB and I NEED to be able to have an empty string as much of the code base is using this to validate data (vs. a NULL). Is there any solution at all for this problem? I really do not want to keep my existing DB running but there is too much time involved converting code.
    Thanks, In Advance

    Bryna,
    In Oracle database, Oracle treats NULL and empty string
    column the same. Therefore, you cannot insert an empty string into a NOT NULL column.
    In OracleDataReader, if you want to find out if the column contains the NULL values, use the OracleDataReader.IsDBNull() function.
    Thanks
    Martha

Maybe you are looking for

  • How to create one time pop-up window?

    I'd like to have a pop-up window called "how to use this app" show up just one time; the first time a user opens the folio to read it for instruction but then not appear again after it is closed. How could I do this? Thanks.

  • Speed up your Booklet 3G the right way

    I bought this booklet and was not impressed at all with the preformance issues. After a little work, here are some things that helped speed the machine up. ReadyBoost; I got an 8gb SD card, used the disk utility to reformat the card to NTFS from FAT3

  • Create idocs for FI documents posted before ALE setup

    The users were creating FI documents normally during May 2006, but the ALE financial interface was not set up until the end of that May.  We are using a FI message type which is a copy from a standard one. Is it possible to create idocs from those FI

  • Visio professional 2013 cant install because office product key does not match

    Settings: office 2007 on windows 7 I'm the IT manager for a small consulting company. We use the full microsoft stack - all paid for. When one of the consultants needed visio we went along and bought an digital version of it. We installed it and all

  • Windows audio service

    Yesterday my audio stopped working.  I replaced speakers but problem persists.  Icon of speaker on bottom has an x.  Error message is that Windows Audio Service is not enabled....it then asks if I wish it to be enabled.  I respond yes...but nothing o