How to use odiRef.getJDBCConnection("WORKREP") to store data in ODI Vars

[blog |http://bahchis.com/2011/03/03/odi-repositories/] Sergey Bahchissaraitsev
Hi Everyone,
I saw in this blog the new 11g functionality to get the JDBC Connection Object for the Work Repository. I really want to use this in an ODI variable. Specifically I want to read the current Operator logs in the Work Repository and store this one value in an ODI Variable.
Previously I used topology to guide me to the correct Work Repository but this is cumbersome. I want to go directly to the current Work Repository for my connection and the new parameter "WORKREP" allows for this.
Here's my old code in an ODI variable. This code requires a Schema to be setup.
select count(*)
from snp_sess_task_log
where sess_no = <%=odiRef.getSession("SESS_NO")%>
How can I get the same result in an ODI variable using the odiRef.getJDBCConnection("WORKREP") function to point me to the correct Work repository? Using this would be a huge improvement to how I retrieve operator data in ODI. Appreciate your thoughts.
Sincerely,
Chris Rothermel

Hi Sergey,
Thanks for responding here as well! As I wrote on your blog...
Thanks for writing back. I have been using the logical and physical schemas but there are limitations and it becomes overly complex.
Thanks to your post on the new functionality of pointing out the new 'WORKREP' parameter. With it I'm now able to write some Jython code to pull in the values from 'WORKREP' regardless of topology settings. Once that is done I write it to the temporary memory DB and then read the values into my ODI variables.
Your blog and specifically the 'WORKREP' parameter is the key to this solution. It took me most of the day, but I got it working.
Yes i hear your concerns with the In-Memory Engine. I got this tip from ODI Experts and it is actually serving my needs very well. I did have a hiccup with it when I CLOSED the connection I couldn't access the values in my Session from the temporary table. I think closing it may have wiped the memory. Something to look at further.
The good news is I only need the In-Memory Engine for temporary storage. All of the permanent values are in the Operator repository, I just use the In-Memory Engine as a way to populate ODI variables since we can't use JDBC to populate ODBC variables.
It was a good day and I appreciate your blog as well as the ODI Experts website where I found a nice Jython for ODI Beginners document.
Have a great weekend!

Similar Messages

  • Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files but still have them on the TC for future reference..

    Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files on iMac 20inch but still have them on the TC for future reference..eg some movies on iTunes. I want to directly save them on the drive so I can delete them from iTunes and gain some storage. (Ps on iMac 20 inch (it's almost full - 320 GB) when I enter time machine, a tab comes up on finder which reads "Time Machine backups" it's able to be ejected like a disc or a connected device. On the iMac 20 inch, I dragged some files onto there as if using it like a hard drive. Is this the correct method? Then I went to my 27inch iMac and saw the "Time Machine Backups" hoping to see the files I dragged from the 20inch iMac. But the files were not there except a folder that said "Backups.backupdb". Can someone help me?

    It's not a good idea to use a network disk for both Time Machine backups and other things.  By design Time Machine will eventually consume all the space on its output disk, which will then cause problem for your other files.  I'd store those other files on an external disk connected to the Time Capsule.  The problem with that is that Time Machine will only back up files that are local to your Mac.  That means that you'll only have one copy of the files on or attached to your Time Capsule.
    By the way, you've been misled by poor field labeling on this forum into typing a large part of your message into the field intended for the subject.  In the future just type a short summary of your post into that field and type the whole message into the field below that.

  • How to Use Transient View Objects to Store Session-level Global Variables

    hi
    Please consider section "40.8.5 How to Use Transient View Objects to Store Session-level Global Variables"
    at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
    Based on this documentation I created the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.01.zip
    It behaves as show in the screencast at http://screencast.com/t/qDvSQCgpvYdd
    Its Application Module has a Transient View Object instance "MyEmployeesContextVOVI", as master for the child View Object instance "EmpInCtxJobVI".
    On rollback the Transient View Object instance keeps its row and attribute values.
    Also when passivation and activation is forced (using jbo.ampool.doampooling=false ) the Transient View Object instance seems to keep its row and attribute values.
    questions:
    - (q1) Why does the expression #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty} evaluate as true when a Transient View Object instance attribute value is changed (as shown in screencast at http://screencast.com/t/qDvSQCgpvYdd )?
    - (q2) What would be a robust approach to make a Transient View Object instance more self-contained, and manage itself to have only one single row (per instance) at all times (and as such removing the dependency on the Application Module prepareSession() as documented in "5. Create an empty row in the view object when a new user begins using the application module.")?
    many thanks
    Jan Vervecken

    Thanks for your reply Frank.
    q1) Does sample 90 help ? http://blogs.oracle.com/smuenchadf/examples/
    Yes, the sample from Steve Muench does help, "90. Avoiding Dirtying the ADF Model Transaction When Transient Attributes are Set [10.1.3] "
    at http://blogs.oracle.com/smuenchadf/examples/#90
    It does point out a difference in marking transactions dirty by different layers of the framework, "... When any attribute's value is changed through an ADFM binding, the ADFM-layer transaction is marked as dirty. ...".
    This can be illustrate with a small change in the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.02.zip
    It now shows the result of both these expressions on the page ...
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty}
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.dataProvider.transaction.dirty}... where one can be true and the other false respectively.
    See also the screencast at http://screencast.com/t/k8vgNqdKgD
    Similar to the sample from Steve Muench, another modification to the example application introduces MyCustomADFBCDataControl
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.03.zip
    public class MyCustomADFBCDataControl
      extends JUApplication
      @Override
      public void setTransactionModified()
        ApplicationModule vApplicationModule = (ApplicationModule)getDataProvider();
        Transaction vTransaction = vApplicationModule.getTransaction();
        if (vTransaction.isDirty())
          super.setTransactionModified();
    }Resulting in what seems to be more consistent/expected transaction (dirty) information,
    see also the screencast at http://screencast.com/t/756yCs1L1
    Any feedback on why the ADF Model layer is so eager to mark a transaction dirty is always welcome.
    Currently, question (q2) remains.
    regards
    Jan

  • I have a Time Capsule with 2tb of storage, and an I-Mac with 500Gb. (which is at capacity) Can I use the Time Capsule to store data in addition to backing up the hard drive?

    I have a Time Capsule with 2tb of storage, and an I-Mac with 500Gb. (which is at capacity) Can I use the Time Capsule to store data from my hard drive that I want to access later in addition to backing up the hard drive?

    Can I use the Time Capsule to store data from my hard drive that I want to access later in addition to backing up the hard drive?
    Yes, but if you move the "original" data on your iMac to the Time Capsule....then the "original" data is now on the Time Capsule disk. 
    When...not if...the Time Capsule disk has a problem, you have no backups for this data.
    Perhaps a much safer plan might be to add an external hard drive attached directly to your iMac. Then, move the data to that drive from the iMac.
    Now, Time Machine will back up both your iMac and the external hard drive so you have "originals" on one drive and backups on another. Would that plan work for you?

  • How to use vCloud Director Catalog into vFabric Data Director

    Hi,
        How to use vCloud Director Catalog into vFabric Data Director.....

    When you install Data Director, you have the option of selecting a Global or Organizational installation.  When you select Organizational, you have an additional option to specify the vCD instance from which you can get Organizations and Users.  This must be set up at installation time.

  • How to use Replacement Path Variables to perform Date Calculations

    Hi Experts,
    Can anyone make me clear about:How to use Replacement Path Variables to perform Date Calculations???????
    Thankyou in advance..
    shankar

    In left panel select the time Dimension
    Then hit new variable in that
    give the Name and Description for the Variable
    In processing by hit Replacement Path
    In reference characterisitcs use Calendar Day...
    As ur intention is to use it for Date
    Then in adjacent tab use
    Replace variable with Query / Variable
    Then u can use Offset length and offset start for controoling the display of your variable.
    Use as single, multiple single, interval, selection option as uwish
    HIt okey
    and you are good to go

  • How to use Apple ID in itunes Store

    How to use Apple ID in itunes Store

    Go to settings>itunes & app store and sign in. From there on purchase and download content from the itunes & app store.

  • How to use multiple selection parameters in the data model

    Hi, after have looked all the previous threads about how to use multiple selection parameters , I still have a problem;
    I'm using Oracle BI Publisher 10.1.3.3.2 and I'm tried to define more than one multiple selection parameters inside the data template;
    Inside a simple SQL queries they work perfectly....but inside the data template I have errors.
    My data template is the following (it's very simple...I am just testing how the parameters work):
    <dataTemplate name="Test" defaultPackage="bip_departments_2_parameters">
    <parameters>
    <parameter name="p_dep_2_param" include_in_output="false" datatype="character"/>
    <parameter name="p_loc_1_param" include_in_output="false" datatype="character"/>
    </parameters>
    <dataTrigger name="beforeReport" source="bip_departments_2_parameters.beforeReportTrigger"/>
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    select deptno, dname,loc
    from dept
    &p_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_DEPT" source="Q2">
    <element name="deptno" value="deptno"/>
    <element name="dname" value="dname"/>
    <element name="loc" value="loc"/>
    </group>
    </dataStructure>
    </dataTemplate>
    The 2 parameters are based on these LOV:
    1) select distinct dname from dept (p_dep_2_param)
    2) select distinct loc from dept (p_loc_1_param)
    and both of them have checked the "Multiple selection" and "Can select all" boxes
    The package I created, in order to use the lexical refence is:
    CREATE OR REPLACE package SCOTT.bip_departments_2_parameters
    as
    p_dep_2_param varchar2(14);
    p_loc_1_param varchar2(20);
    p_where_clause varchar2(100);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    CREATE OR REPLACE package body SCOTT.bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    if (p_dep_2_param is not null) --and (p_loc_1_param is not null)
    then
    p_where_clause := 'where (dname in (' || replace (p_dep_1_param, '''') || ') and loc in (' || replace (p_loc_1_param, '''') || '))';
    else
    p_where_clause := 'where 1=1';
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    As you see, I tried to have only one p_where_clause (with more than one parameter inside)....but it doesn't work...
    Using only the first parameter (based on deptno (which is number), the p_where_clause is: p_where_clause := 'where (deptno in (' || replace (p_dep_2_param, '''') || '))';
    it works perfectly....
    Now I don't know if the problem is the datatype, but I noticed that with a single parameter (deptno is number), the lexical refence (inside the data template) works.....with a varchar parameter it doesn't work....
    So my questions are these:
    1) how can I define the p_where_clause (inside the package) with a single varchar parameter (for example, the department location name)
    2) how can I define the p_where_clause using more than one parameter (for example, the department location name and the department name) not number.
    Thanks in advance for any suggestion
    Alex

    Alex,
    the missing thing in your example is the fact, that if only one value is selected, the parameter has exact this value like BOSTON. If you choose more than one value, the parameter includes the *'*, so that it looks like *'BOSTON','NEW YORK'*. So you need to check in the package, if there's a *,* in the parameter or not. If yes there's more than one value, if not it's only one value or it's null.
    So change your package to (you need to expand your variables)
    create or replace package bip_departments_2_parameters
    as
    p_dep_2_param varchar2(1000);
    p_loc_1_param varchar2(1000);
    p_where_clause varchar2(1000);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    create or replace package body bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    p_where_clause := ' ';
    if p_dep_2_param is not null then
    if instr(p_dep_2_param,',')>0 then
    p_where_clause := 'WHERE DNAME in ('||p_dep_2_param||')';
    else
    p_where_clause := 'WHERE DNAME = '''||p_dep_2_param||'''';
    end if;
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || ' AND LOC IN ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || ' AND LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    else
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || 'WHERE LOC in ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || 'WHERE LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    I've written a similar example at http://www.oracle.com/global/de/community/bip/tipps/Dynamische_Queries/index.html ... but it's in german.
    Regards
    Rainer

  • I have an iMac with 2 internal drives and set-up with multiple user accounts.  How do I create a path to store data files on my second drive within an application?

    I have an iMac with 2 internal drives and a multiple user account set-up.  Hw do I create a path to store data files on the second drive within an application?

    This is the Mac mini forum not the iMac forum however...
    Applications written for average users like Photoshop, Word, i.e. GUI based applications provide a 'Save' dialog box which while allow selecting second drives or any drive. The dialob box initially shown might be in the simple mode but you just need to click on the triangle to show the full set of options. You should then see the different drive names amongst other options.
    If your referring to an application your writing yourself then you need to build a pathname. This can be in one of two styles depending on the programming system your using. This could be a POSIX style path or a Mac style path.
    POSIX = /Volumes/volname/foldername
    Mac style = Volname:foldername:

  • How to use XmlModify to sort the XML Data?

    Hello,
    I saw some examples explain how to use XmlModify in BDB XML package. I want to sort the XML data by several elements but my Java program could not work correctly.
    <CustomerData>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>002</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>102</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    // many nodes like transaction ...
    </CustomerData>
    My XQuery script was executed successfully in the shell. The script looks as follows:
    "for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD), xs:decimal($i//CLT_IRD_NBR) return $i".
    The Java code :
    // create XmlManager
    XmlManager manager = // ...;
    // open XmlContainer
    XmlContainer container = // ...;
    XmlQueryContext context = manager.createQueryContext(XmlQueryContext.LiveValues, XmlQueryContext.Eager);
    XmlQueryExpression expression = manager.prepare("for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD),xs:decimal($i//CLT_IRD_NBR) return $i", context);
    XmlModify modify = manager.createModify();
    XmlUpdateContext uc = manager.createUpdateContext();
    XmlDocument xmldoc = container.getDocument("sample.xml");
    XmlValue value = new XmlValue(xmldoc);
    long numMod = modify.execute(value, context, uc);
    System.out.println("Peformed " + numMod     + " modification operations");
    Could you point out the errors above or offer some suggestion?
    Thanks.

    I have other question of the sorting issue. Here are a large XML need to sort so I have to split it to multiple small XML files. After importing these files, I will use the XmlModify and XQuery to sort them. I'm not clear on the multiple XML files processing.
    1. Can the BDB XML ensure that all these XML files were sorted or how to update all documents with same logic.
    2. If I want export all these sorted documents, how can I ensure these files processed in sequence? Which document needs process first?
    The export method:
    public void export(String outputfile)throws Exception{
    final int BLOCK_SIZE = 5 * 1024 * 1024; // 5Mb
    try{
    File theFile = new File(outputfile);
    FileOutputStream fos = new FileOutputStream(theFile);
    byte[] buff= new byte[BLOCK_SIZE];                         
    XmlResults rs = container.getAllDocuments(new XmlDocumentConfig());               
    while(rs.hasNext()){
         XmlDocument xmlDoc = rs.next().asDocument();
         XmlInputStream inputStream = xmlDoc.getContentAsXmlInputStream();                    
         long read=0;
         while(true){
         read = inputStream.readBytes(buff, BLOCK_SIZE);
    fos.write(buff,0,(int)read);                    
         if(read < BLOCK_SIZE) break;
    inputStream.delete();
    xmlDoc.delete();
    rs.delete();
    //MUST CLOSE!
    fos.close();               
    catch(Exception e){
    System.err.println("Error exporting file from container " + container);
    System.err.println(" Message: " + e.getMessage());
    Thanks.

  • How to use CSV format in making a data connection.

    Hello All,
    I have got a form to develop. There are over 1000 entries to be imported. Can I use CSV format to embed those data in the forms. Mainly those data would be embedded as dropdowns.If I can use how to do it ? If i can not use is there any better way without using the Database like MySQL or something.
    Thanks.
    Bibhu.

    Hi Afroz,
    To be more specific, if the csv file doesn't has header, please refer to this script to add header:
    $csv = Import-Csv d:\haha.csv -Header "UserA","UserXYZ","EmailA"
    Then you can loop this csv file to run the "add-mailboxpermission" cmdlet, I recommend you can test this script before running against production environment, please also note I haven't tested this script:
    $csv = Import-Csv d:\users.csv -Header "UserA","UserXYZ","EmailA"
    foreach($each in $csv){
    write-host "assign fullaccess permission of user $($each.UserXYZ) on mailbox $($each.EmailA)"
    get-mailbox -identity $each.EmailA | add-mailboxpermission -user $each.UserXYZ -accessrights 'fullaccess'
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How to use the JE database with other data types than byte arrays?

    Hi! I searched the javadoc of Berkley DB JE, for a way to introduce entry (but I need also retrieve) data with other type than byte arrays, e.g. String, or anything else, as int may be, etc.
    Still, I didn't find any such way, because the main (only?!) method to entry data into an open database - according what I found in javadoc - is:
    "public OperationStatus put(Transaction txn, DatabaseEntry key, DatabaseEntry data) throws DatabaseException"
    and both this and the corresponding method for retrieves, are based on the same DatabaseEntry type, which allow only entry data on byte[] support.
    What if I need to use Strings or int, or even char? I must do a special conversion from these types, to byte[], to use the database?
    Thank you!

    On the doc page (this is also in the download package),
    http://download.oracle.com/docs/cd/E17277_02/html/index.html
    see:
    Getting Started Guide
    Java Collections Tutorial
    Direct Persistence Layer (DPL)
    All of these describe how to use data types other than byte arrays.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Any one know how to use "custom" option present under the data access tab in XLS file format of Data Services

    Hi Experts,
            Any one know how to use or what is the purpose of "custom" option present under the data access tab in Excel workbook file format of Data Services
    Thanks in Advance,
    Rajesh.

    Rajesh, what is the Custom Protocol you are trying to use? It should be  something like PSFTP, etc.,
    Cheers
    Ganesh Sampath

  • HT204053 how to use same id for different stores

    How can i use the same apple id to access apps on different apple stores (in different regions)?

    You can only buy content from your own country's store, if you want to but from a different country's store then you will need a valid billing address in that other country, and be in that country when buying from it.
    Otherwise you can try requesting that the app that you want to buy be added to your country's store, though ultimately it's the developers of those apps that will have to grant Apple a license to sell them there : http://www.apple.com/feedback/itunes.html

  • OWSM: How to use Generic Key in Credential Store 11g

    Hi there,
    I am facing the following issue with the Weblogic Credential Store Framework (CSF):
    Context:
    I have a web service exposed somewhere in a Tomcat server. This service is not secured, initially it was, but the idea was to deport it to a mediator using OWSM WS policy . The service internally extracts the username from SOAP Header and perform some authorization checks prior performing some business logic.
    So our idea was first to configure a new authentication provider in the default Weblogic's realm to hit our LDAP system. When this was done, we created a simple composite to virtualize the web service and apply a WS Security with username. In order to do that, we did create a new key in the Credential Store under oracle.wsm.security.map and declare our username + password for a particular user in LDAP. We tested it and it works fine!
    Issue: Now we want to leverage this using any user from the authentication provider. We created a new key which has the type "Generic" on the entreprise manager. We don't know though what to do next to specify "every user in our authentication provider", the documentation here is very evasive and we are stick to guess the grammar the CSF expects. We saw that WSLT could be used too to create the key.
    Soa Suite version: 11.1.1.3
    Does anyone has a clue to solve this issue ?
    Thanks

    It is unclear where you are having a problem.  Is your issue at runtime (when the form runs in the browser) or when working in the Builder on the form?
    Also be aware that you will need to sign your jar and include some new manifest entries.  Refer to the Java 7u51 documentation and blogs that discuss the changes.
    https://blogs.oracle.com/java-platform-group/entry/new_security_requirements_for_rias
    http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html

Maybe you are looking for