Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: "undef" is not NULL and what to do about it

by Tux (Abbot)
on Feb 21, 2013 at 06:58 UTC ( #1019905=note: print w/replies, xml ) Need Help??


in reply to Re^2: "undef" is not NULL and what to do about it
in thread "undef" is not NULL and what to do about it

"unknown" values are represented - in our case - by a value that falls outside the legal range. e.g. a for numeric values defined to be 0 or greater, we use -1 to be the "undefined" value and -2 to be the "known to be wrong or invalid" value. For strings that decision is taken on each case, some already have a value for "known to be unknown": . (not our choice, it is a law in that database) others might be a single space.

varchar2 is Oracle-only, yet another reason to loathe Oracle. Indeed we use varchar2 instead of varchar, but they suck nevertheless.

I just don't understand how you can say that an empty string equals to NULL. That is only true in the rotten Oracle world.

FWIW I use a lot of database types (Oracle, Unify, MySQL, PostgreSQL, MariaDB, SQLite, CSV, TSV, MonetDB) and NONE is perfect. Oracle is not the only database with drawbacks.

The is more btw, how to represent (in a database)

  • Known, valid ("normal" state in databases)
  • Known to be unknown (I checked it, but the value cannot be set)
  • Known to be absent/unavailable
  • Unknown ("NULL" in databases)
  • Known to be illegal (cannot use the illegal value, like date of birth 23770245)

Enjoy, Have FUN! H.Merijn
pmsig

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019905]
help
Chatterbox?
[tye]: could be an unclosed m//, qr//, s///, or even q// (etc.) from earlier
talexb just used & intentionally in a script and feels pretty good about it.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2016-12-07 18:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (131 votes). Check out past polls.