|
| Total Answers and Comments: 5 |
Last Update: June 15, 2009 Asked by: gagan87 |
|
| | |
|
Submitted by: sreekanthjup Default Contraint acts the same way as the other constraints like NOT NULL, UNIQUE, PRIMARY KEY............. do; they come into picture while data insertion is done into the table. It makes oracle insert a values automatically into table without being specified in the insert; for example:
CREATE TABLE TTEMP (NM VARCHAR2(10) DEFAULT 'Sreekanth', JOB VARCHAR2(10));
now we can skip from the NM column being filled: INSERT INTO TTEMP VALUES (null,'sales'); or INSERT INTO TTEMP VALUES ('','sales'); in ordinary case without default constraint assigned.. NULL gets inserted but here 'Sreekanth' is inserted in each unspecified row.
Above answer was rated as good by the following members: neelapu, himanshu_sapra, pakashraf | Go To Top
|