title: How do I populate a user-defined record that has default values?
body: <h1>TL; DR:</h1>
  
  <p><strong>How can I declare a user-defined record type so that if I don't populate one of the fields, that field will honor its <code>DEFAULT</code>?</strong></p>
  
  <hr>
  
  <h1>Details:</h1>
  
  <p>In my package spec, I define the following record and table types:</p>
  
  <pre><code>/* set up a custom datatypes that will allow us to pass an array of values into CCD_UI procedures and functions */
  TYPE RECORD_OPTION_ATTRIBUTES IS RECORD(
      option_name             VARCHAR2(200)   NOT NULL DEFAULT 'INVALID NAME"', /* default intentionally breaks HTML */
      option_value            VARCHAR2(200)   NOT NULL DEFAULT 'INVALID VALUE"', /* default intentionally breaks HTML */
      option_selected_ind     NUMBER(1)       NOT NULL DEFAULT '0',
      option_class            VARCHAR2(200)   DEFAULT NULL,
      option_attributes       VARCHAR2(200)   DEFAULT NULL
  );
  
  TYPE TABLE_OPTION_ATTRIBUTES IS TABLE OF RECORD_OPTION_ATTRIBUTES
      INDEX BY BINARY_INTEGER;
  </code></pre>
  
  <p>In the package body, I have functionality very similar to this:</p>
  
  <pre><code>PROCEDURE populate_user_defined_table()
  AS
  
      v_criteria_pairs        TABLE_OPTION_ATTRIBUTES;
  
  BEGIN
  
      SELECT some_column1 AS option_name, some_column2 AS option_value, some_column3 AS selected_ind,
          some_column4 AS option_class
      BULK COLLECT INTO v_criteria_pairs
      FROM Some_Table
      WHERE some_column='whatever';
  
  END;
  </code></pre>
  
  <p>The sharp eye will notice that I am not inserting any values into the <code>option_attributes</code> field; I am populating only 4 of the 5 available fields.</p>
  
  <p>When I attempt to compile this package, I receive the following error from the package body:</p>
  
  <blockquote>
    <p>PL/SQL: ORA-00913: too many values</p>
  </blockquote>
  
  <p>If I drop the <code>option_attributes</code> field from the <code>RECORD_OPTION_ATTRIBUTES</code> declaration, the package will compile.</p>
  
  <p><strong>How can I declare the record type so that if I don't specify a value for <code>option_attributes</code>, that field will default to <code>NULL</code>?</strong></p>