Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Nulls

Re: Nulls

From: Michael Serbanescu <mserban_at_postoffice.worldnet.att.net>
Date: 1997/10/02
Message-ID: <611hin$6ma@bgtnsc03.worldnet.att.net>#1/1

ORACLE treats NULL according to the SQL (-89, -92) standard, i.e. a NULL represents an "unknown" value, regardless of the datatype of the column.

In regards to how to define your tables, ORACLE allows you to do something very similar to INGRES' NOT NULL WITH DEFAULT.

If you already have defined your table and column(s), try this:

ALTER TABLE <your_table> MODIFY (<table_column> DEFAULT <default_value> NOT NULL); Make sure you have the DEFAULT clause before the NOT NULL clause !

You can do the same thing when you create a new table (replace ALTER with CREATE and don't use MODIFY).

Hope this helps.

Michael Serbanescu



Mark Parssey wrote:
>
> As an Oracle newbie I'm just creating my first db & application.
>
> Past practice for us as an Ingres site has been to set the non reqd. fields
> to NOT NULL WITH DEFAULT. This ensured that fields where either 0 or blank,
> depending on type.
>
> This then meant searches had no problems with null fields & you didn't have
> to do thinks like search for both is null & = ''.
>
> This approach doesn't seem appropriate for Oracle as it would/did cause
> problems when leaving non-required fields empty on the form.
>
> I have amended the fields to allow null but will I now have a prob. with
> searches as above.
>
> I would appreciate advice on the best way of defing my tables.
> Also how can I execute a query to find empty fields?
Received on Thu Oct 02 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US