2

Imagine you have a table which all of its columns were created with the DEFAULT clause included, for example

BOX
----------
height
width
depth

currently I'd make the following query to use default values:

INSERT INTO BOX VALUES(DEFAULT,DEFAULT,DEFAULT);

is there any other way to do this in Oracle? Preferably to indicate insert clause to use all default values but without specifying it for every column.

1 Answer 1

4

You can specify DEFAULT for one column and omit other columns.

INSERT INTO box (height) VALUES (DEFAULT);

As a result you'll get all columns with default values.

Here is SQLFiddle demo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.