title: Calling a PL/SQL constructor with default values and named parameters
body: <p>In Oracle 11g I've got the following type:</p>
  
  <pre><code>CREATE OR REPLACE TYPE "T_XMLTABLE" AS OBJECT (
   zeile NUMBER,
   spalte NUMBER,
   wert VARCHAR2(1000),
   xml NUMBER,
   link VARCHAR2(1000),
   target VARCHAR2(100),
   srt NUMBER,
   typ NUMBER,
   format VARCHAR2(100),
   uebersetzbar NUMBER,
   tooltip VARCHAR2(100),
   kommentar NUMBER,
   output NUMBER,
  
   CONSTRUCTOR FUNCTION t_xmltable(p_zeile        NUMBER,
                                   p_spalte       NUMBER,
                                   p_wert         VARCHAR2,
                                   p_xml          NUMBER,
                                   p_link         VARCHAR2 DEFAULT NULL,
                                   p_target       VARCHAR2 DEFAULT NULL,
                                   p_srt          NUMBER DEFAULT 0,
                                   p_typ          NUMBER DEFAULT 1,
                                   p_format       VARCHAR2 DEFAULT NULL,
                                   p_uebersetzbar NUMBER DEFAULT 0,
                                   p_tooltip      VARCHAR2 DEFAULT NULL,
                                   p_kommentar    NUMBER DEFAULT 0,
                                   p_output       NUMBER DEFAULT 7) RETURN SELF AS RESULT
  )
  
  CREATE OR REPLACE TYPE BODY t_xmltable AS
   CONSTRUCTOR FUNCTION t_xmltable(p_zeile        NUMBER,
                                   p_spalte       NUMBER,
                                   p_wert         VARCHAR2,
                                   p_xml          NUMBER,
                                   p_link         VARCHAR2 DEFAULT NULL,
                                   p_target       VARCHAR2 DEFAULT NULL,
                                   p_srt          NUMBER DEFAULT 0,
                                   p_typ          NUMBER DEFAULT 1,
                                   p_format       VARCHAR2 DEFAULT NULL,
                                   p_uebersetzbar NUMBER DEFAULT 0,
                                   p_tooltip      VARCHAR2 DEFAULT NULL,
                                   p_kommentar    NUMBER DEFAULT 0,
                                   p_output       NUMBER DEFAULT 7) RETURN SELF AS RESULT 
  
  AS
       BEGIN
         self.zeile        := p_zeile;
         self.spalte       := p_spalte;
         self.wert         := p_wert;
         self.xml          := p_xml;
         self.link         := p_link;
         self.target       := p_target;
         self.srt          := p_srt;
         self.typ          := p_typ;
         self.format       := p_format;
         self.uebersetzbar := p_uebersetzbar;
         self.tooltip      := p_tooltip;
         self.kommentar    := p_kommentar;
         self.output       := p_output;
         RETURN;
       END;
      END;
  </code></pre>
  
  <p>As you can see, it's got quite some members, which are initialized via the constructor with default values. Before we've got the constructor, the type was initiated like this:</p>
  
  <pre><code>t_xmltable(zeile        =&gt; v_y,
             spalte       =&gt; v_x,
             wert         =&gt; 'someval',
             xml          =&gt; 1337,
             link         =&gt; NULL,
             target       =&gt; NULL,
             srt          =&gt; 0,
             typ          =&gt; 1,
             format       =&gt; NULL,
             uebersetzbar =&gt; 1,
             tooltip      =&gt; NULL,
             kommentar    =&gt; 0,
             output       =&gt; 7);
  </code></pre>
  
  <p>Now, I introduced the constructor to get rid of the unnecessary default values. But it seems, that these default values can't be used in conjunction with named parameters. I don't really want to lose the comfort of them and it would be quite some work to refactor all the code that uses the type.</p>
  
  <p>The following works:</p>
  
  <pre><code>DECLARE
    x t_xmltable;
  BEGIN
    x := t_xmltable(1, 1, 'a', 1);
  END;
  </code></pre>
  
  <p>The following not:</p>
  
  <pre><code>DECLARE
    x t_xmltable;
  BEGIN
    x := t_xmltable(zeile =&gt; 1, spalte =&gt; 1, wert =&gt; 'a', xml =&gt; 1);
  END;
  </code></pre>
  
  <p>Has someone got some ingenious ideas how to solve the problem?</p>