I'm trying to alter a table in Oracle. I have to give a column in a table a default value of 1
. This is simple enough when making the table but I have to do it using the ALTER TABLE
feature, This is what I have:
ALTER TABLE Stock_Qty
ADD CONSTRAINT Qty_DEFAULT_Value DEFAULT (Qty 1);
It doesn't seem to work.
Select the column for which you want to specify a default value. In the Column Properties tab, enter the new default value in the Default Value or Binding property. To enter a numeric default value, enter the number. For an object or function enter its name.
Here's the correct syntax:
ALTER TABLE Stock_Qty
MODIFY Qty DEFAULT 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With