Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9128957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:38:18+00:00 2026-06-17T07:38:18+00:00

I need to create auditing tables in Oracle using a Loading Knowledge Module (LKM).

  • 0

I need to create auditing tables in Oracle using a Loading Knowledge Module (LKM).

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.

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.

As an example, the following LKM code is used to create a C$ work table:

create table <%=odiRef.getTable("L", "COLL_NAME", "A")%>
(
    <%=odiRef.getColList("", "[CX_COL_NAME]\t[DEST_WRI_DT] NULL", ",\n\t", "","")%>
)

And the following IKM code creates an I$ flow table:

create table <%=odiRef.getTable("L", "INT_NAME", "W")%>
(
    <%=odiRef.getColList("", "[COL_NAME]\t[DEST_WRI_DT] NULL", ",\n\t", "", "")%>
    ,IND_UPDATE     char(1)
)

INT_NAME and COLL_NAME seem to be constants defined in the Substitution API, as specified here.

So, how can I use the knowledge module to create similar tables with dynamic names in an Oracle Database?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:38:19+00:00Added an answer on June 17, 2026 at 7:38 am

    I managed to solve this as follows.

    <%=odiRef.getTable("L", "TARG_NAME", "A")%> returns the target table name in DATABASE.”tablename” format.

    I therefore added a step to my LKM which uses Jython to extract the tablename from the DATABASE.”tablename” string, append “_audit” to the table name, and then save the DATABASE.”tablename_audit” string to a Jython variable, as shown below.

    targTableName = '<%=odiRef.getTable("L", "TARG_NAME", "A")%>'
    splitStr = targTableName.split('"')
    JYTHON_AUDIT_TABLE = splitStr[0] + '\"' + splitStr[1] + '_audit\"'
    

    However, since Jython variables cannot be used from SQL scripts in ODI, I added another step to my LKM which fetches the Jython variable into a Java variable (which can then be used by ODI objects) using ODI Expert’s Jython to Java API.

    import api.getInfo as info;
    
    info.setJythonVariable(JYTHON_AUDIT_TABLE);
    
    <@
    import api.getInfo;
    String JAVA_AUDIT_TABLE = getInfo.getJythonVariable();
    @>
    

    I could then easily use the JAVA_AUDIT_TABLE variable in my SQL scripts to create the required tables in my target database.

    create table <@=JAVA_AUDIT_TABLE@>...
    
    insert into <@=JAVA_AUDIT_TABLE@>...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need to create a custom DNS name server using C which will check against
I to need create a programmatic equivalent using delphi language... or could someone post
We recently added auditing to our database. A colleague implemented it using triggers and
I need create a very big project, the project has a lot of tables
I need create sql script for insert in many tables - total near 2000,
Using boost python I need create nested namespace. Assume I have following cpp class
I need to create a database table to store different changelog/auditing (when something was
I'm using Asp.net and C#, I need create and UNDO feature for a webspace.
I need create custom dialog and put JPanel into it. Is it possible?
i need create an email list sending to many emails. what is best solution

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.