title: Oracle ODI: Creating Tables with Dynamic Names using a Knowledge Module
body: <p>I need to create auditing tables in Oracle using a Loading Knowledge Module (LKM).</p>
  
  <p>Knowledge Modules typically create various tables, triggers and views which are named dynamically, e.g.: C$_tablename, J$_tablename, T$_tablename, JV$_tablename, etc. etc.</p>
  
  <p>I would like to do something similar for my auditing tables, i.e. all audit tables would be called "tablename_audit", but do not how to set this up in the LKM code.</p>
  
  <p>As an example, the following LKM code is used to create a C$ work table:</p>
  
  <pre><code>create table &lt;%=odiRef.getTable("L", "COLL_NAME", "A")%&gt;
  (
      &lt;%=odiRef.getColList("", "[CX_COL_NAME]\t[DEST_WRI_DT] NULL", ",\n\t", "","")%&gt;
  )
  </code></pre>
  
  <p>And the following IKM code creates an I$ flow table:</p>
  
  <pre><code>create table &lt;%=odiRef.getTable("L", "INT_NAME", "W")%&gt;
  (
      &lt;%=odiRef.getColList("", "[COL_NAME]\t[DEST_WRI_DT] NULL", ",\n\t", "", "")%&gt;
      ,IND_UPDATE     char(1)
  )
  </code></pre>
  
  <p>INT_NAME and COLL_NAME seem to be constants defined in the Substitution API, as specified <a href="http://docs.oracle.com/cd/E14571_01/integrate.1111/e12645/odiref_reference.htm" rel="nofollow">here</a>.</p>
  
  <p>So, how can I use the knowledge module to create similar tables with dynamic names in an Oracle Database?</p>
  
  <p>Thank you.</p>