Toad World® Forums

F4 view Enhancement Possibility


#1

Hi Folks … When I do F4 on a table name the column window does not show a
column as NOT NULLABLE if it made so by creating a check constraint.

I know there is many other ways to find it out.

But it would be great if somehow it gets reflected in F4 view.

Is there already an existing option ?

Thanks,

Shiva.


#2

It will show the column as not nullable if the constraint is made like this:

ALTER TABLE EMP

MODIFY(JOB NOT NULL);

But not like this:

ALTER TABLE EMP ADD

CHECK (JOB IS NOT NULL)

The reason is that the former will be reflected in DBA_TAB_COLUMNS.NULLABLE. The
latter will not.

-John


#3

Yes John … that makes sense.

But Currently, lot of old tables which my team has to deal with are having
columns with NOT NULL CHECK constraint.

As a habit of checking weather a column is NULL or not most of us ( in my team )
use F4 and miss it.

I am being greedy/lazy but wish there was an option/check box which when
opted/checked

would look at the NOT NULL check constraints too before populating "NULL? "
column in F4 view.

Is it possible now ?

If not then we have got our new year resolution … get rid of F4 habits :slight_smile:

Thanks,

Shiva


#4

Well, I think most people expect that columns tab to show you what is in
DBA_TAB_COLUMNS. So if I started doing something else, someone else would say
it’s a bug. But setting that argument aside, if we tried to interpret your
check constraints to determine what can really be not null and what
cannot…I think we would inevitably be incorrect due to the way some check
constraint was written.

For example:

ALTER TABLE EMP ADD

CONSTRAINT EMP_C01

CHECK ((emp is not null) or (ename is not null))

Here, I would be wrong if I just looked for a column name followed by ‘is
not null’.

As for a new years resolution, I some ideas too:


#5

Agreed !!!

In my opinion, removing the check constrain and using modify will give some
performance gains too !!!

Thanks,

Shiva