title: JOOQ: Type class org.jooq.impl.SelectImpl is not supported in dialect DEFAULT
body: <p>My question about writing query in jooq dsl.</p>
  
  <p>I have some list of client attributes stored in an Oracle database.</p>
  
  <p>Table structure is following:</p>
  
  <ul>
  <li><code>CLIENT_ATTRIBUTE_DICT</code> (ID, CODE, DEFAULT_VALUE) - list of all possible attributes</li>
  <li><code>CLIENT_ATTRIBUTE</code> (ATTRIBUTE_ID, CLIENT_ID, VALUE) - attributes values for different clients</li>
  </ul>
  
  <p>I'm trying to select values of all existing attributes (in dict) for given client: </p>
  
  <p>If exist row in CLIENT_ATTRIBUTE with given clientId than attribute value =  <code>CLIENT_ATTRIBUTE.VALUE</code> else <code>CLIENT_ATTRIBUTE_DICT.DEFAULT_VALUE</code></p>
  
  <p>My query in SQL (works fine):</p>
  
  <pre><code>SELECT d.code,
    NVL 
   (
    (
     SELECT value
     FROM CLIENT_ATTRIBUTE a
     WHERE a.ATTRIBUTE_ID = d.id
     AND a.CLIENT_ID      = 1 
    ),
    ( 
     SELECT DEFAULT_VALUE 
     FROM CLIENT_ATTRIBUTE_DICT dd 
     WHERE dd.id=d.id
    ) 
   ) value
  FROM CLIENT_ATTRIBUTE_DICT d;
  </code></pre>
  
  <p>My query in Jooq dsl:</p>
  
  <pre><code>ClientAttributeDictTable dict = CLIENT_ATTRIBUTE_DICT.as("d");
  Map&lt;String, String&gt; attributes = 
  dsl.select(
   dict.CODE,
   DSL.nvl(
          dsl.select(CLIENT_ATTRIBUTE.VALUE)
             .from(CLIENT_ATTRIBUTE)
             .where(
                    CLIENT_ATTRIBUTE.ATTRIBUTE_ID.eq(dict.ID),
                    CLIENT_ATTRIBUTE.CLIENT_ID.eq(clientId)
                   ),
  
          dsl.select(CLIENT_ATTRIBUTE_DICT.DEFAULT_VALUE)
             .from(CLIENT_ATTRIBUTE_DICT)
             .where(CLIENT_ATTRIBUTE_DICT.ID.eq(dict.ID))
         ).as("value")
      ).from(dict)
       .fetchMap(String.class, String.class);
  </code></pre>
  
  <p>When jooq query runs it fails with error message:</p>
  
  <blockquote>
    <p>Caused by: Type class org.jooq.impl.SelectImpl is not supported in dialect DEFAULT  </p>
    
    <blockquote>
      <p>at org.jooq.impl.DefaultDataType.getDataType(DefaultDataType.java:757) ~[na:na]<br>
      at org.jooq.impl.DefaultDataType.getDataType(DefaultDataType.java:704) ~[na:na]<br>
      at org.jooq.impl.DSL.getDataType(DSL.java:14378) ~[na:na]<br>
      at org.jooq.impl.DSL.val(DSL.java:12766) ~[na:na]<br>
      at org.jooq.impl.Utils.field(Utils.java:802) ~[na:na]<br>
      at org.jooq.impl.DSL.nvl(DSL.java:8403) ~[na:na]                                                                                </p>
    </blockquote>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>UPD</strong>
  JOOQ version <strong>3.7.2</strong></p>