Re: NULLS with ORACLE

From: Lee McAllister <avernus_at_iag.net>
Date: 1995/08/12
Message-ID: <40h0s8$spr_at_news.iag.net>#1/1


In <3vkedi$ic7_at_raffles.technet.sg> apxafoo_at_technet.sg (Anthony Foo) writes:
>
>
>Wonder if anyone can help me. I am currently writing an application
>in PB4.0 that is accessing the Oracle database (ver 7.0) on my
 company's
>AIX machine.
>
>The tables in the database are defined such that all columns are set
 with
>NOT NULL constraint. However, when I create a datawindow that has,
 say, 5
>columns out of 15 columns in a table and I do a insertrow and then an
 update,
>Oracle return with the error that there are null values in the insert
>statement. What actually happened was that PB 4.0 send an insert
 statement with
>only the 5 columns in the datawindow. The remaining 10 columns that
 were not
>passed, Oracle tried writing nulls into them, thus the error.
>
>I had tried altering the table with the column set as NOT NULL DEFAULT
 SPACES
>but Oracle return telling me I can't set the column as such. It's
 either I set
>the column as NOT NULL or I accept NULL with default.
>
>Question is, is there anyway I can overcome this problem without
 altering
>the columns' NOT NULL constraint? I had thought of a possibility which
 is
>to select all the columns in the table even if I only needed 5 out of
>15
>columns in the datawindow. I DON'T wish to use this solution as it
 means
>nightmare doing maintenance and delay in retrieval.
>
>Appreciate any help or advice given.
>
>Thanks

The obvious question would be why are you not supplying values for columns that are deemed to be not null ?

Playing tricks with spaces etc. will only make things worse in the long run.

If there is a blanket definition that every column is not null and this is not a business requirement, then you need to redesign your physical. Problems like this tend to be indicative of either bad application or database design. Either way finding a work around is probably not a good idea.

LeeM. Received on Sat Aug 12 1995 - 00:00:00 CEST

Original text of this message