I don't know it this is the correct channel to submit a suggestion for an enhancement to the PL/SQL syntax, (If someone knows better, I would be grateful if I get pointed to the right direction)
Currently we have these syntaxes:
I have been working with pl/SQL for two decades and I have always felt we need also to be able to do this:
rec := MYTABLE%DEFAULTVALUES;
simpleval := MYTABLE.MYFIELD%DEFAULTVALUE;
the idea is to be able to be able to initialize a variable (even a record variable) by using the same defaults that have been defined for a column (or for all the columns, in case of a record variable) of a table.
The bigger problem is for record types: not being able to initialize a new record with the table default values makes the “whole record insert” syntax (insert into MYTABLE values rec) dangerous to be used, because whatever code you write to insert a new record is going to break at runtime whenever someone adds a new mandatory field, even if it has a default value, since MYTABLE%ROWTYPE gives you a record whose fields are all null, regardless of the default values declared on the table.