Oracle 18c allows you to initialize a record using qualified expressions :
declare type location_record_type is record ( street_address varchar2(40), postal_code varchar2(12), city varchar2(30), state_province varchar2(25), country_id char(2) not null := 'US' ); --Oracle 18c Qualified Expression: v_location location_record_type := location_record_type('1234 Fake Street', '90210', 'Springfield', 'KY', 'US'); begin dbms_output.put_line('It worked!'); end; /
You can run the above code example in Oracle Live SQL here . (Unfortunately, this site requires a login. Since 18c is not available for download, there are several convenient ways to test new features.)
Jon heller
source share