Oracle SQL - How To Specify Default Values in INSERT Statement
Interview Question Database For Software Developers
|
|
| How To Specify Default Values in INSERT Statement | | How To Specify Default Values in INSERT Statement? - Oracle DBA FAQ - Understanding SQL DML Statements | | By: FYIcenter.com | If a column is defined with a default value in a table, you can use the key word DEFAULT
in the INSERT statement to take the default value for that column. The following
tutorial exercise gives a good example:
INSERT INTO fyi_links VALUES (102,
'http://dba.fyicenter.com',
NULL,
0,
DEFAULT);
1 row created.
SELECT * FROM fyi_links;
ID URL NOTES COUNTS CREATED
----- ------------------------ -------- ------- ---------
101 http://dev.fyicenter.com NULL 0 30-Apr-06
102 http://dba.fyicenter.com NULL 0 07-MAY-06
| | ID: 843 | Rank: 1075 | Votes: 0 | Views: 27 | Submitted: 20070421 |
Copyright © 2009 FYIcenter.com
All rights in the contents of this Website are reserved by the individual author.
No part of the contents may be reproduced in any form without author's permission.
|
|
|