Skip to Main Content
Feature Request FR-1885
Product Area Application Builder
Status DELIVERED

9 Voters

Edit default value of table columns

dirk_strack Public
· Sep 1 2021

Idea Summary
Allow edit of the defaults for a database table columns in the SQL Workshop Object Browser

Use Case
When a new data entry form is generated in a database table within the page designer, the default values can be set to the default value (or function) defined for the columns. The default clause lets you specify a value to be assigned to the column if a form omits the column.

Preferred Solution (Optional)
Add fields ‘Default Value’ and ‘Default on Null’ to the forms to add and edit columns on the SQL Workshop Object Browser.

This has been delivered in Oracle APEX 23.1!

Comments

Comments

  • carsten.czarski APEX Team OP 2.4 years ago

    Hi Dirk,

    can you please describe the idea in more detail. I'm now wondering whether you are after SQL Workshop only, or whether you want to have the table defaults reflected in APEX forms - if the latter, how exactly would you like to use them?

    For instance, if you have no item for a database column on your form page, the table default would be applied today. If you have an item, but it is empty, the DEFAULT ON NULL value would be applied today. So I might not understood that idea - would you mind elaborating a bit more?

    Best regards

    -Carsten

  • dirk_strack OP 2.4 years ago

    Hi Carsten, 

    Here is a detailed Feature Request: Use database column default definition in APEX forms

    Add a new field called 'Default SQL Expression' to the SQL Workshop / Object Browser / Tables / Modify Columns form, which would allow developers to modify the default value or expression of a database column.

    Display the database column default value in form fields when creating new records. This would help users understand which fields have default values and avoid any unexpected behavior when saving a new record. Additionally, APEX should automatically format the default value in number items as 0,00 for example when the default is 0, scale is 2 and a not null constraint exists.

    For items types that cannot show the null state, such as the Yes/No Switch and Select-List without a null entry, APEX should use the default value from the database schema instead of assuming a default value. This would help avoid inconsistencies and ensure that default values are accurately represented in the form.

    To achieve these goals, I suggest adding a new 'Default Type' option called 'From Database Column Definition', which would be set by default for new form fields where appropriate. Alternatively, APEX could set the Default Type to 'PL/SQL Expression' and copy the default expression from the database column for new created form-fields.

    Thank you for considering this feature request. I believe that implementing these changes would improve the user experience of APEX forms and make it easier for developers to work with default values in the database schema.

    Best regards,

    Dirk