Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

forcing a view column to not null

siromegaAug 1 2012 — edited Aug 1 2012
I'm having trouble creating a view that has a not null column. Using this script you can see that the resulting table doesn't have a not null constraint for the first column even though both source columns for that row are not null. Is there anyway to force the view to mark that first column as not null? (I need it for ODP.NET otherwise I get an error there)

DROP TABLE MYTABLE;

CREATE table MYTABLE
( COL1 NUMBER(2) NOT NULL,
col2 number(2)) ;

drop table mytable2;

CREATE table MYTABLE2
( COLA NUMBER(2) NOT NULL,
colB number(2)) ;

create or replace view myview as select col1, col2 from mytable union select cola, colb from mytable2;

desc myview;
This post has been answered by unknown-7404 on Aug 1 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 29 2012
Added on Aug 1 2012
7 comments
6,381 views