How to execute unix command through odi and store the result in table

I have to reconcile  if data is loaded in table from csv file or not . I have to create a oracle data integrator package/interface/procedure to execute unix command to count number of rows in the csv files and store the count result in a table then i have to query the loaded table and count number of rows there and store in the table and have to compare is counts are same or not,  Please assist me how to make package/interface/procedure to  execute unix command and store result in oracle table.
Thanks in Advance

Use ODI OS command tool in the ODI package.
create an interface in ODI using LKM File to Sql and the output file generated with the csv file's row count as a source and the db table(where the count needs to be stored) as a target

Similar Messages

  • How to execute unix command from ODI Procedure

    Hi,
    I am trying to execute below unix command from ODI Procedure (Command on Target tab) but I am getting the error "java.io.IOException: Cannot run program "cd": error=2, No such file or directory" but when I try to execute the same command using OdiOSCommand, it is executing successfully. I don't want to use shell script to execute this command. Is there any specific syntax am I missing to execute this command from ODI procedure?
    cd /project3/tmt/;ls *.dmp > dmplist.lst
    Please help me on this...
    Thanks
    MT

    Hi nahlikh,
    Thank you for the reply.
    I used below command in Procedure but still getting the same error as "java.io.IOException: Cannot run program "OdiOSCommand": error=2, No such file or directory".
    OdiOSCommand "-COMMAND=cd /project3/tmt/;ls *.dmp > dmplist.lst"
    as I mentioned earlier if I use the command cd /project3/tmt/;ls *.dmp > dmplist.lst in OdiOSCommand tool it is executing successfully without any issues.
    any thoughts appreciated to get a solution for this issue.
    Thanks
    MT

  • How to execute unix command line from cocoa?

    how to execute unix command line from cocoa?
    for example, if I want to call "ping" from cocoa, how should I do it? and how can I obtain the return value?
    thank you.
    Power G5 Quad Mac OS X (10.4.3)

    The following article may also help:
    http://cocoadevcentral.com/articles/000025.php
    Mihalis.
    Dual G5 @ 2GHz   Mac OS X (10.4.6)  

  • Executing Procedure in SQL SERVER and Storing the results in Oracle 10g

    Hello,
    I am trying execute SQL SERVER procedure from Oracle 10g and store the results in a oracle table. When I tried executing the procedure i am getting errors.
    I am using Oracle Heteroeneous Services.
    Steps I followed.
    1. Created ODBC DSN on Oracle Server connecting to SQL SERVER database.
    2. Created Listner entry and TNSNAMES entries.
    3. Created Database link and able to select the data from the SQL SERVER tables.
    Here is the code i tried to execute the procedure.
    BEGIN
    "META"."extract"@abc;
    END;
    "META"."extract"@abc;
    ERROR at line 2:
    ORA-06550: line 2, column 1:
    PLS-00201: identifier 'META.extract@ABC' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    Please help me.
    Thank You,
    Seshadri Thope

    Hi thopevs,
    Can you please tell me the right syntax of calling procedures(on sql server) from oracle?
    I am getting following error:
    SQL> execute "GetdateSys"@oratosql;
    begin "GetdateSys"@oratosql; end;
    ORA-06550: line 2, column 7:
    PLS-00201: identifier 'GetdateSys@ORATOSQL' must be declared
    ORA-06550: line 2, column 7:
    PL/SQL: Statement ignored
    SQL>
    Your help will be highly appreciated.
    Thanks & Regards,
    M.U.N.A

  • How to execute unix command in plsql block( urgent)

    Hi All,
    i want rename the unix folder to New name on update non_employee table . So, please give me idea how to use unix command here.... Please suggest me ASAP ... Its urgent
    CREATE or REPLACE TRIGGER NON_EMPLOYEE_AftUpd_trg
    AFTER UPDATE ON NON_EMPLOYEE
    FOR EACH ROW
    BEGIN
    IF :new.DIST_LIVELINK_PATH <> :old.DIST_LIVELINK_PATH THEN
    rename unixfolder1 to :new.dist_livelink_path.
    end IF;
    END;

    The solution will depend a lot on your Oracle version, which you forgot to mention ;)
    btw shouldn't that be (in pseudocode)
    rename :old.dist_livelink_path to :new.dist_livelink_pathotherwise it will always fail after the first time?
    In Unix that would require the mv command.

  • Executing Unix command through Java

    Hi,
    Hi, I am trying to run some unix command through:
    Runtime.getRuntime().exec("some unix command line");
    I am running the code on Linux platform. However, I always got some errors. Here are the stack trace of them:
    java.io.IOException: Cannot allocate memory
    java.io.IOException: java.io.IOException: Cannot allocate memory
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
            at java.lang.ProcessImpl.start(ProcessImpl.java:65)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
            at java.lang.Runtime.exec(Runtime.java:591)
            at java.lang.Runtime.exec(Runtime.java:429)
            at java.lang.Runtime.exec(Runtime.java:326)Anybody has any idea why is this happening? Thanks.
    Aulia

    Hi, thanks for your reply so far. I tried the following code:
         public boolean executeCommand() {
              boolean success = true;
              for (int i = 0; i < 5; i++) {
                   Process p = null;
                   try {
                        p = Runtime
                        .getRuntime()
                        .exec("ls");
                        InputStreamReader inR = new InputStreamReader(p
                                  .getErrorStream());
                        BufferedReader buf = new BufferedReader(inR);
                        String line;
                        while ((line = buf.readLine()) != null) {
                             System.out.println(line);
                        p.destroy();
                   } catch (Exception e) {
                        System.err.println(e.getMessage());
                        e.printStackTrace();
                        success = false;
                   } finally {
                        p = null;
              return success;
         }However, it still throws the same exception. Yes, I put it in a tight loop, but not recursively.

  • Execute a VO '4' times and show the result in single table at once.

    Hi,
    I want to execute single a VO query multiple times with different parameters and show the results together in a Table at once
    In Detail
    I have a table to which is associated with a VO.
    The VO contains SQL whose WhereClauseParameters need to be dynamically binded.say headerId and lineId
    Select ... from ....where headerId = :1 AND lineId = :2
    I have to pass these 4 values and show all the results in a single table
    headerId lineid
    H1 ............... L1
    H1 ............... L2
    H2 ............... L1
    H2 ............... L2
    I understand that i need to bind parameters dynamically and exceute the VO.
    As i have 4 different set of parameters, the view object will be executed 4 times.
    I want to show all the results together in a single table.
    How can I do it.
    thanks,
    Gowtam

    Hi Mani,
    Thanks a lot for the patience and detailed solution.I will try it out and tell you the status.
    Meanwhile, I have 2 questions on this solution(just curious)
    I will give you the snapshot of the table
    Table - ModelInfo
    Model......Tube..... Float....Size......Col5.....Col6.......Col7.......
    M1............T1.......... F1. .....1..........C15......C16.....C17.....
    M1............T1...........F1.......2..........C25......C26.....C27.....
    M1............T2......... .F2.......1..........C35......C36.....C37.....
    M1............T2...........F2.......2..........C45......C46.....C47.....
    M2............T1.......... F1. .....1..........
    M2.............T1..........F1.....2.........Cn5.......Cn6........Cn7
    .<continues...>
    .<till>
    .Mn............Tn..........Fn.......n........Cxy.......Cpq.......Crs....
    Question 1:
    if you notice this data,
    The Columns 5 to 7 are dependent on Combination of Model,Tube,Float and Size.
    Hence will this query work properly(without mixing up data from other Pk combination) and will it be efficient?(I Know this is a stupid qst, still double checking..As your solution assumes that each row is unique for Model only..which is not true)
    Select ...From....Where
    Model in(M1,M2,..Mn) AND Tube in(T1,T2..Tn) AND Float in(F1,F2,....Fn) and Size in(1,2...n).
    In short, will C15,C16 and C17 appear only with M1,T1,F1,1..I believe it will.
    Question 2:
    As I told,
    Third party program will return Array of Objects.
    Each object will have a variable called Flow along with
    Model,Tube,Float and Size.
    Flow is not stored in the database(can not be stored due to functional reasons).I want to show this Flow also along with other columns fetched from the DB for all 100+ rows.
    How can I do it?
    I will give u the scenario(with just 2 rows)...please check(Flow is not stored in DB)
    Third Party object : ObjModel
    Model......Tube..... Float....Size......Flow
    M1............T1.......... F1. .....1..........100
    M1............T1...........F2.......2...........200.
    M1............T2.......... F1.......1..........300
    M1............T2...........F2.......2..........400
    My concern is,
    After the VO executes and shows other 6 columns, it should show Flow appropriately.(associated with each object in the array)
    I understand that I need to have a Transient attribute in VO called[b] Flow.But I don't know how to perform the two tasks simultaneously..
    Task1:Your solution on showing table columns
    Task2:Showing Transient data for each object returned from program.
    thanks,
    Gowtam

  • How to execute unix command from the Java program running on Windows

    Hello,
    I need to
    1. Execute a unix shell script from a Java program running on the Windows.
    2. I also need to capture the output of this shell script in my program.
    Please suggest me how to achieve this.
    Thanks in Advance.

    Hi...
    Something is missing here
    If you want to execute a shell script in windows that not posible unless you find or develop a unix shell script parser for windows.
    But if you are trying the execute a unix shell script on a remote unix computer from your java program running on a windows platform you can do that by logging on to the UNIX terminal which is running on port 23 I think.
    You can test this using telnet tool on windows
    just type on command prompt
    telnet <ip of the unix pc> <port number this case 23>
    you should get the unix terminal. If that works you can do the same through java or you can directly conect to port 23 of that pc using sockets that way your program will be platform independant

  • Execute MaxL command througth ODI and encrypt password

    Hi
    I am looking for a solution to not use plain text password for my Maxl command in ODI.
    Anyone know how should I do that?
    Up to now, I found nothing.
    Thanks
    Alain

    Hi,
    Here is a example of encrypting the login credentials in a maxl scipt.
    First run something like this from a command prompt
    essmsh -gk >> c:\temp\encryptKeys.txt
    This will create a text file with the public and private keys e.g.
    e.g.
    Public Key for Encryption: 5407,1453704157
    Private Key for Decryption: 406488703,1453704157
    Now say you have a maxl file called login.mxl like
    login admin password on localhost;
    logout;
    You can encrypt it by calling
    essmsh -E c:\temp\login.mxl PUBLIC KEY
    So for this example it would be
    essmsh -E c:\temp\login.mxl 5407,1453704157
    This will create an file called login.mxls with encrypted login details e.g.
    login $key 6343689380045143584028576355606972733930 $key 1468602100275634090163724540502857635560 on localhost;
    logout;
    Now to execute the file you need to use the command
    essmsh -D c:\temp\login.mxls PRIVATE KEY
    so in this example
    essmsh -D c:\temp\login.mxls 406488703,1453704157
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to execute System command through Applet

    Hi all,
    How can I execute a System command through Applet.
    I have written a code Runtime.exec("ls") in my applet but it gives me
    this execption even if I certify the applet ->
    java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
         at java.security.AccessController.checkPermission(AccessController.java:399)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
         at java.lang.SecurityManager.checkExec(SecurityManager.java:802)
         at java.lang.Runtime.exec(Runtime.java:548)
         at java.lang.Runtime.exec(Runtime.java:418)
         at java.lang.Runtime.exec(Runtime.java:361)
         at java.lang.Runtime.exec(Runtime.java:325)
         at Test.init(Test.java:24)
         at sun.applet.AppletPanel.run(AppletPanel.java:344)
         at sun.plugin.navig.motif.MotifAppletViewer.maf_run(MotifAppletViewer.java:123)
         at sun.plugin.navig.motif.MotifAppletViewer.run(MotifAppletViewer.java:119)
         at java.lang.Thread.run(Thread.java:484)
    Thanks,
    Manoj.

    There should be a lesson about this somewhere.
    When you visit a web page, does it ask you if you want to have an applet loaded?
    Answer: No
    So, if you visit a page, and an applet is silently loaded which can then execute commands on your computer, is this good?
    Answer: No
    So why do you want to do this?
    Is it good for anyone?
    I mean, if I want to do "ls", can't I just open a command line? Do I need an applet to do it for me?
    Either you have devious desires or your hacking together something that probably shouldn't be.
    If you want to learn start here:
    http://java.sun.com/docs/books/tutorial/security1.2/index.html
    With the article entitled:
    Quick Tour of Controlling Applets
    Ian

  • How to execute unix command in java  or jsp

    have a peace day,
    please send some sample code for
    "execute the unix command in java or jsp"
    thank you
    regards
    rex

    i execute this coding
    its compiling. while running i get the error " java.io.IOException: CreateProcess: \ls-l error=2 "
    import java.io.*;
    import java.util.*;
    public class Test
       public static void main(String[] args) throws Exception
         try
              String[] cmd = {"/ls-l"};
    Runtime.getRuntime().exec(cmd);
         catch (Exception e)
               System.out.println(e);
      }what can i do for that
    thank u

  • How to Compare 2 CSV file and store the result to 3rd csv file using PowerShell script?

    I want to do the below task using powershell script only.
    I have 2 csv files and I want to compare those two files and I want to store the comparision result to 3rd csv file. Please look at the follwingsnap:
    This image is csv file only. 
    Could you please any one help me.
    Thanks in advance.
    By
    A Path finder 
    JoSwa
    If a post answers your question, please click &quot;Mark As Answer&quot; on that post and &quot;Mark as Helpful&quot;
    Best Online Journal

    Not certain this is what you're after, but this :
    #import the contents of both csv files
    $dbexcel=import-csv c:\dbexcel.csv
    $liveexcel=import-csv C:\liveexcel.csv
    #prepare the output csv and create the headers
    $outputexcel="c:\outputexcel.csv"
    $outputline="Name,Connection Status,Version,DbExcel,LiveExcel"
    $outputline | out-file $outputexcel
    #Loop through each record based on the number of records (assuming equal number in both files)
    for ($i=0; $i -le $dbexcel.Length-1;$i++)
    # Assign the yes / null values to equal the word equivalent
    if ($dbexcel.isavail[$i] -eq "yes") {$dbavail="Available"} else {$dbavail="Unavailable"}
    if ($liveexcel.isavail[$i] -eq "yes") {$liveavail="Available"} else {$liveavail="Unavailable"}
    #create the live of csv content from the two input csv files
    $outputline=$dbexcel.name[$i] + "," + $liveexcel.'connection status'[$i] + "," + $dbexcel.version[$i] + "," + $dbavail + "," + $liveavail
    #output that line to the csv file
    $outputline | out-file $outputexcel -Append
    should do what you're looking for, or give you enough to edit it to your exact need.
    I've assumed that the dbexcel.csv and liveexcel.csv files live in the root of c:\ for this, that they include the header information, and that the outputexcel.csv file will be saved to the same place (including headers).

  • How to parse XML and store the data in  tables using sql or plsql?

    I want to parse the xml
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xmlListWrapper>
        <size>2</size>
    <AppTypeID>10</AppTypeID>
    </xmlListWrapper>
    and store in a table
    |pk|apptypeid|
    1     10

    You can extract data from your XML along these lines...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select xmltype('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      2  <xmlListWrapper>
      3    <size>2</size>
      4    <AppTypeID>10</AppTypeID>
      5    <AppTypeID>20</AppTypeID>
      6  </xmlListWrapper>') as xml from dual)
      7  --
      8  -- end of example data
      9  --
    10  select x.*
    11  from   t
    12        ,xmltable('/xmlListWrapper/AppTypeID'
    13                  passing t.xml
    14                  columns pk for ordinality
    15                         ,apptypeid number path '.'
    16*                ) x
    SQL> /
            PK  APPTYPEID
             1         10
             2         20
    SQL>
    Inserting it to a table is obviously achieved using an INSERT ... SELECT ... where the SELECT is extracting the data from the XML.

  • How do I read from a file and store the information in an array?

    Here is my problem:
    I am going to have to use a bufferedReader to read a file containing information on 10 vehicles. And after I read that file I want to store the info in Vehicle [] V.
    Where should I start?
    Thanks
    Steve

    Thank you for the quick response.
    As of right now our code is the same. Now I have to "parse" the information. What exactly do you mean?
    My code is as follows:
    while((str = br.readLine()) != null)
    String[] tokenArray = str.split(" ");
    for(int i = 0; i < tokenArray.length; i++)
    System.out.print(" Token: " + tokenArray);
    System.out.println("\n");
    Is that what you mean by parsing?
    I am not quite sure what e slpit(" ") is doing. Is there a better way?
    And just to make sure I am understanding my own code, I am storing the information from the br in tokenArray. Followed by a series of print statements which output the info.Correct?
    Thanks again,
    Steve                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Execute UNIX Command in ODI

    Hi I have the fiollowing command which i am running in a procedure which is a DOS command.
    cmd /c dir c:\XYZ\testfile_ML_fusion_*.txt /b /a:-d > c:\ABC\ML_Files_Names.txt.
    The equivalent command in UNIX is
    ls filetest*.txt > All_File_Names.txt
    Please let me know whether we can use this command in Procedure.. I have used this but it is throwing an error with Wrong Process Return Code.
    Let me know as soon as possible.
    Thanks,
    Mansur

    Use ODI OS command tool in the ODI package.
    create an interface in ODI using LKM File to Sql and the output file generated with the csv file's row count as a source and the db table(where the count needs to be stored) as a target

Maybe you are looking for

  • Any Way To Put A Saved Watermark You Created On All Your Images At Once?

    I have a whole bunch of pictures that I wanted to put a copyright watermark on.  I created the watermark I in Photoshop and saved it.  Now, I am wondering if there is any way I can apply this watermark to all my images I have?  I know how to use the

  • MIRO Price difference book in Inventory acount

    Hi, When we book an invoice via MIRO, the amount difference between the PO and the invoice is book in the inventory account and do not hit our P&L variance account. Does anybody know which setting should be corrected so that we hit the P&L account fo

  • Dynamic expression evaluater

    I have a dynamic expression of this sort: { (( A || B ) && ( C || D )) || E } where A,B,C,D,E...(and so on) are boolean variables and the operators between them keep changing. How can i do this through some methods?

  • Displaying pdf files in Internet Explorer 8

    Hi, I recently bought Acrobat 10 pro and loaded it on my PC running windows 7 32 bit. Now, I can't display pdf's in IE8.  It gives me a grey blank box.  Anybody have any clue what is going on.  There is no problems with the pdfs, as I can easily disp

  • Downloading Oracle Express (Link) opens up media player page

    Has anybody else seen this one yet? Going to this link in Red Hat Linux (Feodora) http://www.oracle.com/technology/products/database/xe Then click on the 'Free Download' tab on right. This brings you to: Oracle Database 10g Express Edition      Oracl