[Sussex] Postgresql date fields

Paul Morris pablo at wildfireprojects.com
Thu Oct 27 21:17:19 UTC 2005


On Thursday 27 October 2005 11:36, Angelo Servini wrote:
>
> However, it may be like ORACLE where NULL values are treated as empty
> string, so
>
it's the other way around, empty strings are treated as NULL values see 
example below

SQL> desc test
 Name                                      Null?    Type
 ----------------------------------------- -------- 
----------------------------
 TESTID                                    NOT NULL NUMBER(38)
 TEXT                                               VARCHAR2(100)



SQL> insert into test values (1,NULL);

1 row created.

SQL> commit;

Commit complete.


SQL> select * from test where text is null;

    TESTID
----------
TEXT
--------------------------------------------------------------------------------
         1



SQL> insert into test values(2,'');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from test where text is null;

    TESTID
----------
TEXT
--------------------------------------------------------------------------------
         1


         2



SQL> select * from test where text = '';

no rows selected



-- 
Paul




More information about the Sussex mailing list