Work with result of a select in an external Java Program

Hi!
i would like work with a field of a select in a external java program. I give you an example:
i want copy a table into another table, but i want do a little modification (before insert action) in one parameter via Java class wich parameter is a field in the select.
Example:
i've two tables:
TABLE_BACK (ID, CARACT)
TABLE_NEW (ID, CARACT)
and i've a java Method in an external class com.upc.myClass.modifyCaract(String paramS)
Then, before insert a row in table_new, i want do a transformation in Caract field from table_back. I want do something like this:
INSERT INTO TABLE_NEW (ID, NAME) ( SELECT ID, <%=com.upc.myClass.modifyCaract('I WANT HERE CARACT FIELD FROM TABLE_BACK') FROM TABLE_BACK )
is it possible? how can i do it?
Thanks!!
Message was edited by:
valdomir

Hola Valdomir,
Que tal estas? Ya ha empezado el calor en Barcelona ? jejejejejejej
Well, I think to be possible do what you need.
1) In a procedure step, at source tab query the values, something like:
select caract as MY_CARACT from TABLE_BACK
2) at target tab, use the tags "<@ @>" to import the java class (after put it in the correct ODI directory).
3) at same target tab, after the tag just write (as your example):
INSERT INTO TABLE_NEW (ID, NAME) ( SELECT ID, <@=com.upc.myClass.modifyCaract('I #MY_CARACT) FROM TABLE_BACK )@>
I think this will be enough....
Un saludo,
Cezar Santos

Similar Messages

  • Why is Adobe Flashplayer not working with Apple? Do you have an other flash program you recommend?

    Why is Adobe Flashplayer not working with Apple? Do you have an other flash program you recommend?

    maj-brittfromsjöbo wrote:
    Thank you for your interest in Adobe Flash Player. Unfortunately Apple does not allow Flash Player to be installed on iPhone or iPad.
    May I add, this is the answer I get When I try to Download Adobe Flash Player
    You get the message because that is exactly the situation. Apple has not allowed any Flash on iOS devices.
    What site are you trying to see? Many sites now provide Flash alternatives. For example, if you want to listen to Pandora, instead of using the Flash on the Pandora website, instead you download the Pandora app for the iPad.
    In the future, even if Apple wants to add Flash to the iPad, it won't be able to because Adobe will no longer be making it at all, for any mobile device:
    http://www.wired.com/gadgetlab/2011/11/adobe-kills-mobile-flash/
    If you often go to sites that use a lot of Flash and they don't have an alternative, you should write to them and tell them to stop using Flash.

  • Execute an external java program with Runtime, problem with classpath

    Hi,
    I m calling an external java program by the command:
    Runtime.getRuntime().exec("java -classpath \"library/*\" org.mypackage.TestMainProgram param1 c:/input/files c:/output/files");All my classes are stored in the relative directory "library", and it contains ONLY .jar files. However, I keep getting errors like:
    "java.lang.NoClassDefFoundError: library/antlr/jarCaused by: java.lang.ClassNotFoundException: library.antlr.jar     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)Could not find the main class: library/antlr.jar. Program will exit.Exception in thread "main" where "antlr.jar" is a jar file in "library". It is there but still the program keeps complaining it cannot be found. The problem applies to any jars in "library", ie.., if i have "mylib.jar" then it will complain "NoClassDefFoundError: library/mylib/jar".
    Could anyone give some pointers please?
    Many thanks!
    Edited by: 836590 on 14-Feb-2011 09:03

    836590 wrote:
    Hi,
    I m calling an external java program by the command:
    Runtime.getRuntime().exec("java -classpath \"library/*\" org.mypackage.TestMainProgram param1 c:/input/files c:/output/files");All my classes are stored in the relative directory "library", and it contains ONLY .jar files. However, I keep getting errors like:
    "java.lang.NoClassDefFoundError: library/antlr/jarCaused by: java.lang.ClassNotFoundException: library.antlr.jar     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)Could not find the main class: library/antlr.jar. Program will exit.Exception in thread "main" where "antlr.jar" is a jar file in "library". It is there but still the program keeps complaining it cannot be found. The problem applies to any jars in "library", ie.., if i have "mylib.jar" then it will complain "NoClassDefFoundError: library/mylib/jar".
    Could anyone give some pointers please?
    Many thanks!
    Edited by: 836590 on 14-Feb-2011 09:03First, if you run from the command line
    java -classpath "library/*" org.mypackage.TestMainProgram param1 c:/input/files c:/output/filesfrom the parent directory of library, does it work?
    Despite what I said to Kayaman about Runtime.exec not expanding the asterisk, it looks like that's what's happening, so that you're getting
    java -claspath library/aaaa_something_before_antlr.jar library/antlr.jar library/bbb.jar library/ccc.jar  org.mypackage.TestMainProgram param1 c:/input/files c:/output/filesThat is, it *is* expanding the asterisk to a list of files in the directory, and the first one is being taken as the classpath, and the second one--library/antlr.jar is being taken as the class to execute. I'm certain this doesn't happen on Linux, so it must be a Windows thing.
    Two suggestions:
    1) Try single quotes instead of double.
    2) Try the exec that takes an array
    Runtime.getRuntime().exec(new String[] {"java", "-classpath", "'library/*'", "org.mypackage.TestMainProgram", "param1", "c:/input/files", "c:/output/files");Edited by: jverd on Feb 14, 2011 9:41 AM

  • Issues Working with Results of GetWebAnalyticsReportData(Global.Site,Global.ReportLevel,"TopPageForPageReport",$B4,$B5)

    I created a custom Web Analytics Report in SharePoint. I went into the associated Excel file and tried to perform a vlookup to modify the report. No matter what I do, all references to any cell in the result ALWAYS end up as 0. I tried just doing a direct
    reference to a cell and the result is 0. I tried changing the value to TEXT and it still is a 0.
    So for example:
    The returned array covers A31 to D2030. If I go to some random cell in the workbook and enter "=A32" instead of returning the value in the cell (or even the formula), it returns 0. It doesn't matter what is in the cell, whether text or number.
    The formula in the cells are "=IFERROR(GetWebAnalyticsReportData(Global.Site,Global.ReportLevel,"TopPageForPageReport",$B4,$B5),$A31:$D2030)
    The value in A32 is the URL of a aspx page.
    I wanted to use a VLOOKUP to make the chart more readable since the URL is quite long and I wanted to strip out the common portion of the URL

    Hi,
    According to your description, Excel formula not working in the web analytics report.
    I tried to open a “Site Web Analytics Reports - Top Visitors” report in the desktop Office application, select an empty cell, input something like “=D4”, it is populated
    with the value of D4 cell immediately.
    By default, SharePoint Web Analytics Service produce the analytics data and save it in an Excel file, then we should be able to manipulate this Excel file with its
    data as what we do in a normal Excel file.
    To narrow down the issue, I would suggest you create a new Excel file with some data in your local machine or other machines, test some simple formulas on it to see
    if it is an issue of the desktop Office application.
    Feel free to reply if there any progress.
    Thanks
    Patrick Liang
    Forum Support
    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 Subscriber Support,
    contact [email protected]
    Patrick Liang
    TechNet Community Support

  • Working with Result in BEx Query Designer

    Dear All,
    I have a report showing sales amount customer wise. The result is aggregated for "total" sales amount. Now I want to use that value, total result value in a formula variable for calculation. Can that be done? How can I catch that result to work on it.
    Regards,
    Jack Silverz

    HI Jack,
    The result values cannot be used in the formula variables. But it can be used in the calculated key figures using the Overall Result function.
    Hope this Helps.
    Regards.
    Shafi.

  • IPhone does not work with IPOD Dock to select next song / pause - play

    After using the iPhone at the gym, the IPhone quit working using the remote for the Docking station to navigate to next song nor pause / play. Suspect Iphone connector....
    Also the iMuffs Headset bluetooth adapter that plugged into the iphone connector quit working. Tested iMuffs bluetooth connector on another iPhone and is still functioning.
    any ideas?? clean connector?? short?? service??
    Note, the iPhone still syncs with iMac via docking port (USB). So the connector is not totally bad.
    Message was edited by: java_boy
    Message was edited by: java_boy
    Message was edited by: java_boy

    Have you tried a reset...and if that doesn't work ..a restore? Back up your phone before you restore.

  • Working with results in FlowN

    I have FlowN in my BPEL process. In branch of FlowN I invoke web service. I have to compare results from all N results and choose one that has one node (date node) that is earliest. This result will be choosen as reply.
    Currently, I've created variable that is the same type as reply from web service and in branch and I append result from WS to it. I use:
    orcl:min-value-among-nodeset(bpws:getVariableData('tempSets','/ns1:fulfillmentLineSetResult/ExpectedGroupArrivalDate'))
    to get "earliest date" (btw, I am not sure if this is correct). If yes, how I find "index" in tempSets that has this "earliestDate"? I want to use (copy) that set to my final reply.

    Why dont you just select the earliest date instead of appending?
    in every flow
    if flowDate < earliestDate
    earliestDate = flowDate

  • Working with result set i need a solution..... plz treat it as urgent

    i have a query which returns 12 records so the result set contains 12...
    now i want to display in the set of 5 rows... so
    out put must me
    Name Rate Name Rate Name Rate
    1 6 11
    2 7 12
    3 8
    4 9
    5 10
    how can i achieve this output...
    I guess this will clear the question......

    You create a for loop that indexes from 1 to 5. You get a row(item) from the result each time through the loop. You all check next() and break out of the loop when it returns false.

  • Is there a way to export all of my music from my hard drive to an external drive, connected to my computer and have iTunes still work with the music library located on the external drive?

    I do not have enough room on my hard drive for all of my music collection and want to export the music files to my external 300GB hard drive rather than purchase and configure a new, larger hard drive for my computer.  Can I export all of my music library to the external drive and configure iTunes to always store music there, and operate seemlessly with the music library on the external drive?

    http://www.wideanglesoftware.com/touchcopy/index.php

  • Can i run and work with OSX 10.3.9 on an external hard drive???

    Hi There all,
    I'm getting a 250gb External firewire HDD, i want to do this:
    I want to install Tiger on my PowerBook's HDD, But everything i've got on it now with Panther is perfect, but some of the software is'nt compatible with Tiger, so i was hoping i could save everything (Panther, Software & files) on to the external HDD and when i want to use panther through the External drive and have tiger on the internal drive, so effectively have to useable OS's, the reason i need to upgrade is to use the latest FCEHD.
    Any help much appreciated.
    - Mike

    Hi Niel,
    So say the space used on my PowerBook is 55Gb, if i make a Partition on the External drive that's about 80GB, can i then, use Panther through the External drive and add to it aswell, but keep the rest of the drive for use in tiger, if that makes sense.
    thanks for the quick reply
    - Mike

  • Issue with creation of a specific field for a java program.

    Hey everyone,
    This is homework which is end of chapter "challenges" to practice what we've learnt.
    The chapter covers inheritance (super class and all things related)
    I'm having quite an annoying issue with the very beginning of the instructions, where it tells me to make the following fields:
    - Employee name
    - Employee number in the format XXX-L , where each X is a digit within the range 0-9 and the L is a letter within the range A-M.
    - Hire date
    This is what I wrote for code so far
    private String name;
    //private WTF
    private String date;I really have no idea what to do for the second field, how to even constrain integers and letters in the same field with a rule for number range and letter range, and that for each character independently, for what I understand.
    Any advice with this? It's blocking me from continuing -_-, because I can't make accessors and mutators and constructors, etc, if i'm still unsure of how the fields unfold.
    Thanks in advance.

    You can create a HireDate class.
    public class HireDate{
       private final int day;
       private final String month;
       private final int year;
       public HireDate(int day, String month, int year){
          this.day = day;
          this.month = month;
          this.year = year;
    }In the HireDate Constructor you could put if statements to ensure that only correct information is present. The fields are final because the hire date will not change. Override the toString() method so that when you print it out it will be in the correct format. Create some getter methods to get the private fields.
    Then in your other class just do this
    HireDate hired = new HireDate(10, July, 1991);Now you have an object that stores all 3 fields for you. You can use the object as you like and when it prints it will be in the format you want.
    Or you could just make hireDate a String variable. That is what I always did and I never lost marks for it. The reason I suggest this way is because you mentioned rules and constraints.

  • Bug with ovi suite 2.2.1.23 and java programs

    Hi,
    since I've installed Ovisuite 2.2.1.23 I have problems with java : Each time I try to launch a *.jar file, which must be loaded by my java environment, it's ovisuite that is launched!!
    So now I have to remove ovisuite from my computer and re-install it each time I want to connect my phone to my computer...

    Hey rainbowcrypt,
    i feel this is not a bug as we do have some .jar and .jad software installation files available to install in Symbian phones thru ovisuite. This might be the reason for associating the .jar files to ovisuite. As satari told either you could use 'open with' to change the application you use everytime. Or in the same 'open with' option you have one more option to use the same application everytime you use. In this way you can permanently make the .jar files to be opened in java and not in ovisuite.
    Regards
    Regards
    Like my post? Give me a Kudos...... Ur problem solved? Accept my Solution :-)

  • Execute Multiple "select" queries from a java program

    Hi,
    Please take time to see the code below.
    What my problem is:
    All the queries given will be executed one by one. So, if there is large data to be retrieved then each query will take so much of time.
    Is there any way that i can execute all the 3 queries simultaneously so that i can get quicker response time.
    Please send me the way to do it and any sample code if available
    Thanks.........
    public static void main(String argv[])
    float spr=0;
    float spr1=0;
    float spr2=0;
    int db_block_size=0;
    String query1;
    String query2;
    String query3;
    query1="select count(distinct(substr(dbms_rowid.rowid_to_Restricted(rowid,0),1,8))) from table1";
         query2="select count(distinct(substr(dbms_rowid.rowid_to_Restricted(rowid,0),1,8))) from table2";
         query3="select count(distinct(substr(dbms_rowid.rowid_to_Restricted(rowid,0),1,8))) from table3";
    Connection conn;
    Statement stmt;
    String name;
         try {
    Class.forName("com.inet.ora.OraDriver");
              catch(java.lang.ClassNotFoundException e)
                   System.err.print("ClassNotFoundException: ");
                   System.err.println(e.getMessage());
    try
         conn = DriverManager.getConnection("jdbc:inetora:135.112.22.51:1521:S","dacscan","mnc");
    stmt = conn.createStatement();
    ResultSet rset=stmt.executeQuery("select value from v$parameter where name='db_block_size' ");
    rset.next();
         db_block_size=rset.getInt(1);
    System.out.println(db_block_size);
         rset.close();
    rset=stmt.executeQuery(query1);
    rset.next();     
    spr=rset.getFloat(1);
              System.out.println (spr);
         rset.close();
    rset=stmt.executeQuery(query2);
    rset.next();
         spr2=rset.getFloat(1);
              System.out.println (spr2);
         rset.close();
    rset=stmt.executeQuery(query3);
    rset.next();
         spr3=rset.getFloat(1);
              System.out.println (spr3);
         rset.close();
    catch(SQLException ex)
                   System.err.println("SQLException: " + ex.getMessage());
                   ex.printStackTrace();
              }

    Is there any way that i can execute all the 3 queries simultaneously so that i can get quicker response time.
    Yes, you can execute queries #1 and #2 each in its own thread. Execute query #3 in the original thread. Then use Thread.join() to wait for each of the other two queries to finish.
    - Saish

  • Working With A Result Set

    Hi Everybody,
    I'm working on a application with will retrive data from a database for the past seven days, and then find the average for each of the days, the database is basically (id,date,hour,houraverage) - I can connect to the databse okay, but the problem i have is working with result set:
    ResultSet rs = d.PerformQuery("0");
    while (rs.next())
    if (firsttime)
    recorddate = rs.getString(2);
    firsttime = false;
    System.out.println("First Time");
    numberofdays = 1;
    if (!firsttime)
    if (recorddate == rs.getString(2))
    System.out.println(" Not First Time");
    thisdaystotal = thisdaystotal + Float.parseFloat(rs.getString(4));
    numberofrecords = numberofrecords + 1;
    System.out.println(thisdaysaverage);
    System.out.println(rs.getString(2));
    if (recorddate != rs.getString(2))
    thisdaystotal = thisdaystotal + Float.parseFloat(rs.getString(4));
    numberofdays = numberofdays + 1;
    thisdaysaverage = thisdaysaverage / numberofrecords;
    recorddate = rs.getString(2);
    for (int dayssofar=1;dayssofar<=numberofdays;dayssofar++)
    System.out.println("Daily Average: " + dailyaverages[dayssofar]);
    Basiclly the flaw in the program is that it can't tell if a record has the same date as the records before it - It can tell if they are different but not same, can anybody see any flaws in the logic?
    Andrew

    Why don't you try to use SQL to get what you need. For example, you can use:
    SELECT DATE, AVG(HOURAVERAGE)
    FROM TableName
    WHERE DATE > 'DATE1'
    GROUP BY DATE
    (replace 'DATE1' with your specific date. If you are using Oracle replace it with: trunc(sysdate) -7 to get most recent 7 days).
    Then you will get your averge values. There is no need to average them in your Java program.

  • Right click in preview is not working with mountain lion??

    The right click is not working with my preview to select the single page view or double page view or many other such options..can anybody help me finding the solution.it was working well with the lion version of the preview.
    I am really stuck now reading PDFs.help me please.

    Look at the menu under View.

Maybe you are looking for

  • Reg: Open goods receipt

    Hi,          Can anybody explain me the difference between we101 and we103 selection parameter in ME2L tcode as both having the same discription as " open good receipt" . Please help me in this issue.

  • File Load is not working on Mac but Windows

    Hi i'm developing an app which simply load files (images and sounds) and uses binary data. Application is working fine on Windows, but it raises error on Mac. Now i dont own Mac so i cant debug it, I also googled but couldnt find anything close to it

  • Status of a PO

    Hi All, How can we find out the status of a PO which was submitted by a person. ie. do not have PO #,No info only we have Person name who has submitted. Thanks

  • Usage Tracking in OBIEE 11g - S_NQ_DB_ACCT and S_NQ_ACCT

    Hi Experts, How to fetch the physical query using usage tracking in OBIEE 11g, i hope in OBIEE 11g there is a feature to capture the physical query using S_NQ_DB_ACCT. I have imported the table S_NQ_ACCT and S_NQ_DB_ACCT in to RPD. Please let me know

  • XMLLists as Dataprovider problem

    I have an XML variable "theResult" equal to the following xml from a flickr webservice call (without data): <rsp> <photos> <photo> <tags> <tag>here1</tag> <tag>here2</tag> <tag>here3</tag> </tags> </photo> <photo/> <photo/> <photo/> <photo/> </photos