title: H2: How to create a linked table from Oracle view?
body: <p>How to create a linked table from Oracle view? I can create linked table from Oracle table by code below</p>
  
  <pre><code>--TEST is a table in Oracle
  CREATE LINKED TABLE LINK('', 'jdbc:oracle:thin:@url:1521:se', 'sa', 'sa', '(SELECT * FROM TEST)');
  </code></pre>
  
  <p>But when I change table <code>TEST</code> to view <code>VIEW_TEST</code> as below,</p>
  
  <pre><code>--VIEW_TEST is an view in Oracle
  CREATE LINKED TABLE LINK('', 'jdbc:oracle:thin:@url:1521:se', 'sa', 'sa', '(SELECT * FROM VIEW_TEST)');
  </code></pre>
  
  <p>exception will throw: <em>ORA-00942: table or view does not exist</em>.</p>
  
  <p>So How to create a linked table from Oracle view?</p>
  
  <p><strong>update:</strong></p>
  
  <p>If the I change the view to materialized view, it is also work.</p>
  
  <pre><code>--MV_TEST is a materialized view in Oracle
  CREATE LINKED TABLE LINK('', 'jdbc:oracle:thin:@url:1521:se', 'sa', 'sa', '(SELECT * FROM MV_TEST)');
  </code></pre>