Also in addition for understanding null values in oracle please have a look at that page.
http://www.dba-oracle.com/
Take care.
Main Topics
Browse All TopicsSELECT * FROM user_constraints uc WHERE
uc.constraint_type = 'C' and uc.search_condition LIKE '%NOT NULL%'
but since uc.search_condition is of type LONG, this crashes. ORA-00932 inconsistent data type
how to get the NOT NULL Constraints all?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Also in addition for understanding null values in oracle please have a look at that page.
http://www.dba-oracle.com/
Take care.
@Cakinci,
thx good idea, but I would like to get explicitly only the "NOT NULL" Constraints, not all Check Constraints.
Oracle has the following constraint types
c - check -- NOT NULL is just a special case of a Check Constraint.
p - primary key
u - unique
r - references (fkey)
v - view with check option -- only Views
o - read only on a view -- only Views
Can you please be more spesific. You wanted to select only not null values in a table or select only the columns which has check constraint not null set.
(
i can also recommend to sort your query.
In ascending order, NULL values will always be sorted last and thus appear after the other data. In descending order NULL values will appear first. The sort order of NULL values can be overridden using the NULLS FIRST/LAST clause.
Examples:
select * from emp order by sal desc NULLS FIRST;
select * from emp order by sal desc NULLS LAST;
Not the fastest solution : but it gets the job done.
CREATE OR REPLACE FUNCTION CC (P_CONSTRAINT VARCHAR2)
RETURN VARCHAR2
IS
BEGIN
FOR R1 IN (SELECT SEARCH_CONDITION FROM USER_CONSTRAINTS
WHERE CONSTRAINT_NAME = P_CONSTRAINT) LOOP
DBMS_OUTPUT.PUT_LINE(R1.SE
RETURN R1.SEARCH_CONDITION;
EXIT;
END LOOP;
RETURN NULL;
END;
/
SELECT CONSTRAINT_NAME, SEARCH_CONDITION FROM USER_CONSTRAINTS
WHERE ROWNUM < 11
AND CC(CONSTRAINT_NAME) LIKE '%NOT NULL%'
/
(For an dba add owner argument and use dba_constraints)
Business Accounts
Answer for Membership
by: CakinciPosted on 2009-01-30 at 05:43:36ID: 23508036
Can you please try like below.
SELECT * FROM user_constraints uc WHERE
uc.constraint_type = 'C' and uc.search_condition is not null