In my table i have 4 columns with 100 records
but in that 4 columns one column contains all NULL values
so can i add NOT NULL CONSTRAINT on that column......... ok
if it is not possible, can i add NOT NULL CONSTRAINT from
101 Record Onwards?
Answers were Sorted based on User's Feedback
Answer / manish kumar
this is not possible we can't create Not Null Constraint in
this column. b'case existing record in column is already
null so oracle through
error: null record found.
| Is This Answer Correct ? | 15 Yes | 2 No |
Answer / sudipta santra
Yes, Krupananda, U r very right..I am explainning the trigger:
Create or replace trigger bri_tab_101_rec
before insert on table1
for each row
declare
usr_ins_excep exception;
begin
if :new.column4 is null then
raise usr_ins_exception;
end if;
exception
when usr_ins_excep
<< do exception code>>
rollback;
end;
| Is This Answer Correct ? | 4 Yes | 0 No |
It is not possible to add not null constraint on existing
column which contains null values.
but we can add not null constraint from 101 record onwards
using triggers.
using triggers it is possible to restrict not null values
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / preethi raju
Yes it is possible by using novalidate with alter table command:
alter table table_name modify(column_with_null constraint constraint_name not null novalidate);
So the novalidate does not check the existing columns which contains the null values.
| Is This Answer Correct ? | 2 Yes | 0 No |
Please explain me all types of Data models. Also give me the details if each model can have other name.for example:schematic data model is also known as conceptual data model and entity relation data model.
what r tyhe major differences between oracle 9i & 10g?
What is a table in oracle?
what is dynamic SGA and static SGA
How many types of table in Oracle?
How to create an oracle database?
How to retrieve data from an explicit cursor?
What is a private synonym?
How to create DSN..Explain?
2 Answers Accenture, BeBo Technologies, Infosys,
How to commit the current transaction in oracle?
In the oracle version 9.3.0.5.0, what does each number shows?
How to pass a parameter to a cursor in oracle?