title: Oracle View loop on specific tables only
body: <p>I got many tables of which some end with digits (date).</p>
  <p>Due to technical reasons I had to create a view on every table (just a workaround)</p>
  <p>The current state is something like:</p>
  <pre class="lang-sql prettyprint-override"><code>begin
    for i in (select table_name 
                from   user_tables 
                where  table_name like 'XXX_%'
               )
    loop
      execute immediate 'CREATE VIEW '||replace(i.TABLE_NAME,'XXX_','YYY_')||' AS SELECT * FROM '||i.TABLE_NAME;
    end loop;             
  end;
  /
  </code></pre>
  <p>All it does is creating views for every table which begins with 'XXX_'. Its almost what I need.</p>
  <p>But now, sometimes tablenames look like &quot;XXX_tablename_20210302&quot;, which is a manual backup.</p>
  <p>Its not always 8 digits (date), sometimes shorter, soemtimes longer numbers. I would like to avoid all tables, which do have numbers in the end of the tablename (from right to left till first &quot;_&quot; checkup, its a number maybe?)</p>
  <p>Does anyone know how to solve it?</p>
  <p>Im kind of stuck here.</p>