Execute .exe file thru oracle pl/sql

Hello Everyone,
Actually I had to execute a .exe file thru pl/sql..............Can you all plz tell me how to do so??????
Thanx in Advance

Good Morning Paritosh
I have solution for u..
just try following link , it will work for u.
http://orafaq.com/scripts/plsql/oscmd.txt
and post ur feedback
regards,
Abhijit.

Similar Messages

  • Linking an exe file thru JEditorPane

    Hi All,
    I would like to link an exe file thru a JEditor Pane...
    I have constructed a gui for an application using Swing and want to link a local exe file
    thru it ie i would like the exe file to execute when i click on the link provided in the JEditorPane.
    How should i go about it?
    Thanx...

    Are you talking about linking to your EXE in terms of a compiler link or just a communication link so your EXE takes care of the functionality and your java program provides the GUI only ?
    I do not know if a compiler link is possible. I've never seen anything that allows you to do it.
    If you just want your EXE to provide functionality then it is possible, but would take a fair amount of work. You can open sockets in both the EXE and Java programs and send messages back and forth. The GUI could request work to be done by the EXE and the EXE passes the results back to the GUI for display. An interesting note about this is that the EXE and GUI do not have to reside on the same machine.
    Good luck,
    Peter

  • Reg : Executing .exe file from application server

    Dear Experts,
                        i have a requirement to execute an .exe file from application server,i tried with method CL_GUI_FRONTEND_SERVICES=>EXECUTE but it executes .exe file from presentation server only.can
    anyone kindly clarify to execute .exe file from application server?
    Thanks in advance,
    Sujay

    Hi,
    Did you search before posting?
    Re: Execute a .exe file present in the Application Server
    Vikranth

  • Executing exe files from java program

    Hi,
    I need to execute exe files and pass arguments to them from my java code.
    Can you give me guidelines to do that as i haven't done that before.
    Thanks.

    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    getRuntime() method.
    exec() method.

  • How to execute ".exe" files using java

    Hi,
      This is guruvulu,
         I have a problem in executing ".exe" files.For Example InternetExplorer.

    Hi,
    You can execute .exe files in JAVA using the following code.
    Runtime rt1 = Runtime.getRuntime();
    Process pc = rt1.exec("someexe.exe");
    you can get the output of the executed exe file in
    in = pc.getInputStream(); //this returns a InputStream
    hope this solves your problem.
    regards,
    P.Venkat

  • PL/SQL to execute exe file with parameters from DB

    Hi all,
    I have a bit of a problem.
    I am in need to write all Logon, Logoff and Logon fail data onto the Windows Application Log. To do this I already tried various solutions but with my configuration (Oracle EE 10.2.0.4 and Windows Server 2003 R2 X64) the only possible solution (apparently) is the following.
    I create a Table with the info I need:
    CREATE TABLE logonaudittable
    event VARCHAR2(15),
    sid NUMBER,
    serial# NUMBER,
    orario DATE,
    username VARCHAR2(30),
    osuserid VARCHAR2(30),
    machinename VARCHAR2(64)
    I create a trigger for Logon Data, one for Logoff and one for Logon Fail:
    LOGON trigger.
    CREATE OR REPLACE TRIGGER logonauditing AFTER LOGON ON database
    DECLARE
    machinename VARCHAR2(64);
    osuserid VARCHAR2(30);
    v_sid NUMBER(10);
    v_serial NUMBER(10);
    CURSOR c1 IS
    SELECT sid, serial#, osuser, machine
    FROM v$session WHERE audsid = userenv('sessionid');
    BEGIN
    OPEN c1;
    FETCH c1 INTO v_sid, v_serial, osuserid, machinename;
    INSERT INTO logonaudittable VALUES ( 'LOGON', v_sid, v_serial, sysdate,
    user, osuserid, machinename );
    CLOSE c1;
    END;
    LOGOFF trigger
    CREATE OR REPLACE TRIGGER logoffauditing
    BEFORE LOGOFF ON database
    DECLARE
    machinename VARCHAR2(64);
    osuserid VARCHAR2(30);
    v_sid NUMBER(10);
    v_serial NUMBER(10);
    CURSOR c1 IS
    SELECT sid, serial#, osuser, machine
    FROM v$session WHERE audsid = userenv('sessionid');
    BEGIN
    OPEN c1;
    FETCH c1 INTO v_sid, v_serial, osuserid, machinename;
    INSERT INTO logonaudittable VALUES ( 'LOGOFF', v_sid, v_serial, sysdate,
    user, osuserid, machinename );
    CLOSE c1;
    END;
    LOGON FAIL trigger
    CREATE OR REPLACE TRIGGER logonfailauditing
    AFTER SERVERERROR ON database
    DECLARE
    machinename VARCHAR2(64);
    osuserid VARCHAR2(30);
    v_sid NUMBER(10);
    v_serial NUMBER(10);
    CURSOR c1 IS
    SELECT sid, serial#, osuser, machine
    FROM v$session WHERE audsid = userenv('sessionid');
    BEGIN
    IF (IS_SERVERERROR(1017)) THEN
    OPEN c1;
    FETCH c1 INTO v_sid, v_serial, osuserid, machinename;
    INSERT INTO logonaudittable VALUES ( 'FAILLOGON', v_sid, v_serial, sysdate,
    user, osuserid, machinename );
    CLOSE c1;
    END IF;
    END;
    The I create a trigger that starts every time something is written on the table.
    This trigger needs to start an EXE file that writes the latest data written on the table into the Windows Application Log.
    So I need a trigger that executes my WRITELOG.EXE file adding the parameters. For example:
    Execute WRITELOG.EXE event sid orario username
    So my program will write a Log in Windows with this data:
    Event: LOGON
    Sid: 2938473
    Orario: 12/12/2011 11:45:32
    Username: Scott
    And so on.
    I already have the program that does this, I need to execute the program with the right data directly from trigger or from a procedure executed by my trigger.
    Hope I've been clear and REALLY hope someone can help me!!!
    Thank you all!

    The java and PL/SQL you need to set up is in the very first response in the link. (I don't have a windows Oracle DB DBMS_JAVA to try it myself). Change the UNIX command '/usr/bin/ls' to your Windows command 'c:\yourdirectory\FILE.EXE'. Assuming you created everything and set permissions as Tom describes (later in the thread), your PL/SQL call in your trigger might look something like this:
    CREATE OR REPLACE TRIGGER logonauditing AFTER LOGON ON database
    DECLARE
    machinename VARCHAR2(64);
    osuserid VARCHAR2(30);
    v_sid NUMBER(10);
    v_serial NUMBER(10);
    CURSOR c1 IS
    SELECT sid, serial#, osuser, machine
    FROM v$session WHERE audsid = userenv('sessionid');
    BEGIN
    OPEN c1;
    FETCH c1 INTO v_sid, v_serial, osuserid, machinename;
    INSERT INTO logonaudittable VALUES ( 'LOGON', v_sid, v_serial, sysdate,
    user, osuserid, machinename );
    RUN_CMD('c:\yourdirectory\FILE.EXE LOGON '||v_sid||' '||v_serial||' '||to_char(sysdate,'MM/DD/YYYY')||' '||user||' '||osuserid||' '||machinename);
    CLOSE c1;
    END;
    Since you want to log what the trigger is writing to the table, you can call the executable with the same information you are writing, instead of writing then reading it back out again.

  • How to execute exe file from pl/sql

    How to execute an exe file or an operating system command from pl/sql in oracle 9i.

    If it is part of a pl/sql block, use the java suggestion. If you are not in a blck, you can use the "HOST" command. see
    http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a82950/ch2.htm#1001697

  • How to UpLoad the Diffent type of files Through Oracle Pl/Sql...?

    Hi TOM,
    I want one reusable component to be developed, My requirement is as follows...
    We get .CSV,.XML,.DOC.PDF files on the N/w drive. One Batch Job will be running every night and this job should upload all the files present in that N/w drive to the database (Each File should be stored in one row with unique ID) and after loading of each file is done , move the uploaded file to the backup directory.
    Note : Average file size is 10-15 MB.
    Loading of files in database should be done only using Oracle procedure/function.
    Already return this process in Pro*C. But I don't know How to write in Oravle Pl/Sl...?
    Functionality of this FUNCTION(In Pro*C):
    ===================================
    *****set_item_blob
    *****Input:     
    *****======
    *****1. Path of the file in Windows folder which contains the part number's content
    *****2. Item number in the T_ITEM table
    *****3. Revision level in the T_ITEM table
    *****Processing:
    *****===========
    *****1. Get the BLOB pointer for the ITM_BLOB column,
    ***** for the corresponding item number and revision level
    *****2. Update the ITM_BLOB column with the content of the input file
    ***** ( using the EXEC SQL LOB WRITE function )
    *****Output:
    *****=======
    *****1. ITM_BLOB column updated with the content of input file
    int set_item_blob (char chr_item_number,int revision_level,char file_path)
         exec sql begin declare section;
              OCIBlobLocator     *blob_locator;
              varchar               vc_item_number[12];
              long               file_length=0;
              varchar               alert_message [500+1];
              int                    plsql_err_code = 0;
         exec sql end declare section;
         FILE     *fp_input_file;
         char     *blob_buffer;
         EXEC SQL VAR blob_buffer IS RAW(BUFFER_LENGTH);
         EXEC SQL ALLOCATE :blob_locator;
         memset ( vc_item_number.arr, '\0', 12 );
         strcpy ( vc_item_number.arr, chr_item_number );
         vc_item_number.len = strlen ( vc_item_number.arr );
         fp_input_file = fopen( file_path, "rb" );
         if( fp_input_file == NULL)
              sprintf ( alert_message.arr, "ngetupld BLOB upload failed for item_number = [%s], rev_level = [%d]. Failure in opening the file to be uploaded [%s]", chr_item_number, revision_level , file_path );
              alert_message.len = strlen ( alert_message.arr );
              EXEC SQL EXECUTE
              BEGIN
                   P_INSERT_INTO_INFO_MESSAGES('AL',:alert_message,'BLB',NULL,NULL,:plsql_err_code);
              END;
              END-EXEC;
              exec sql commit;
              return 1;
         else
              (void) fseek(fp_input_file, 0L, SEEK_END) ;
              file_length = (unsigned int)ftell(fp_input_file) ;     
              (void) fseek(fp_input_file, 0L, SEEK_SET) ;
              if ( file_length > BUFFER_LENGTH )
                   sprintf ( alert_message.arr, "ngetupld BLOB upload failed for item_number = [%s], rev_level = [%d]. Length of the file to be uploaded(%ld) is more than the supported length(%ld)", chr_item_number, revision_level , file_length, BUFFER_LENGTH );
                   alert_message.len = strlen ( alert_message.arr );
                   EXEC SQL EXECUTE
                   BEGIN
                        P_INSERT_INTO_INFO_MESSAGES('AL',:alert_message,'BLB',NULL,NULL,:plsql_err_code);
                   END;
                   END-EXEC;
                   exec sql commit;
                   return 1;
              EXEC SQL
                   UPDATE          T_ITEM
                   SET               ITM_BLOB = EMPTY_BLOB()
                   WHERE          ITM_NUMBER = :vc_item_number
                   AND               ITM_REVISION_LEVEL = :revision_level
                   RETURNING     ITM_BLOB INTO :blob_locator;
              if ( sqlca.sqlcode != 0 )
                   sprintf ( alert_message.arr, "ngetupld BLOB upload failed for item_number = [%s], rev_level = [%d]. SQL error %d occured while trying to get the BLOB locator", chr_item_number, revision_level , sqlca.sqlcode );
                   alert_message.len = strlen ( alert_message.arr );
                   EXEC SQL EXECUTE
                   BEGIN
                        P_INSERT_INTO_INFO_MESSAGES('AL',:alert_message,'BLB',NULL,NULL,:plsql_err_code);
                   END;
                   END-EXEC;
                   exec sql commit;
                   return 1;
              blob_buffer=(char *)malloc(BUFFER_LENGTH); // Dynamic Memory Allocation for Itm_Blob
              fread((void *)blob_buffer, (size_t)BUFFER_LENGTH, (size_t)1, fp_input_file);
              EXEC SQL LOB WRITE ONE :file_length FROM :blob_buffer INTO :blob_locator;
              if ( sqlca.sqlcode != 0 )
                   sprintf ( alert_message.arr, "ngetupld BLOB upload failed for item_number = [%s], rev_level = [%d]. SQL error %d occured while trying to update the BLOB content", chr_item_number, revision_level , sqlca.sqlcode );
                   alert_message.len = strlen ( alert_message.arr );
                   EXEC SQL EXECUTE
                   BEGIN
                        P_INSERT_INTO_INFO_MESSAGES('AL',:alert_message,'BLB',NULL,NULL,:plsql_err_code);
                   END;
                   END-EXEC;
                   exec sql commit;
                   return 1;
              exec sql commit;
         fclose(fp_input_file);
         free(blob_buffer);
         return 0;
    Can Possible to do in Oacle Pl/Sql...?

    > Hi TOM,
    This is not asktom.oracle.com.
    > Can Possible to do in Oacle Pl/Sql...?
    Yes it can be done. Simply consult the applicable manuals that contains all of the details on how to do it. The manuals are:
    - Oracle® Database Application Developer's Guide - Large Objects (refer to Chapter 6 section on Using PL/SQL (DBMS_LOB Package) to Work with LOBs)
    - Oracle® Database PL/SQL Packages and Types Reference (refer to the chapter on DBMS_LOB)

  • How to run exe file using oracles procedure (ASAP) ?

    i am finding difficulties in running an exe file using an oracle procedure.I need this for a pure .NET application

    I want the solution for both,An Oracle stored procedure cannot generally run an executable on the client machine. Stored procedures run on the server and have no access to your client machine. You could potentially do something convoluted like run a web server on the client with an ASP page that called the executable and have the stored procedure make a UTL_HTTP call to the ASP page, but that's generally not an option.
    If the executable is on the server and it's only available as an executable, you could write a Java stored procedure that called out to the command line and invoked the executable (assuming the operating system user running the Oracle database has permission to do so). If the Oracle database is on Windows and you've got 10.2, you may also be able to write a .Net stored procedure that would do the same sort of thing.
    If you can expose the functionality as a DLL, a more elegant solution would be to use an external procedure.
    Justin

  • Reading Text Files using Oracle PL/SQL and UTL_FILE

    Hi, experts. I tried to read a text file into oracle. Here is what i did:
    1. Create a text file in the directory: C:\temp\New Text Document.txt
    2. Run the following SQL in PL/SQL:
    CREATE or replace DIRECTORY sampledata AS 'C:\temp\';
    grant read, write on directory sampledata to public;
    3. When I run the following code, it caused an error: ora-29280: invalid directory path. I have alread checked the directory path, it is correct. Would someone know what wrong is my code?
    declare
    f utl_file.file_type;
    s varchar2(3000);
    begin
    f := utl_file.fopen('sampledata','New Text Document.txt','R');
    utl_file.get_line(f,s);
    utl_file.fclose(f);
    dbms_output.put_line(s);
    end;
    Thank you

    Try with a filename without spaces:No problem with spaces
    SQL> declare
      2  f utl_file.file_type;
      3  s varchar2(3000);
      4  begin
      5  f := utl_file.fopen('SAMPLEDATA','New Text Document.txt','R');
      6  utl_file.get_line(f,s);
      7  utl_file.fclose(f);
      8  dbms_output.put_line(s);
      9  end;
    10  /
    line1
    PL/SQL procedure successfully completed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Reading an EXCEL file from Oracle PL/SQL (HP-Unix server)

    Hi,
    I have the following requirement:
    1. Get the EXCEL file from the remote FTP location
    2. Read the EXCEL file and convert it into the CSV file format.
    3. Put the CSV file into another FTP location.
    I need to get all these points done using Oracle PL/SQL procedure.
    I am using the Oracle 9i installed in HP-Unix environment.
    Please help me in getting this done.
    Thanks

    Ok, setting up Excel as an External Database connection....
    1- Go to Control Panel>Administrative Tools>Data Sources (ODBC)>System DSN and create a data source with appropriate driver. Name it EXCL.
    2- In %ORACLE_HOME%\Network\Admin\Tnsnames.ora fie add entry:
    EXCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.0.24)(PORT = 1521))
    (CONNECT_DATA =
    (SID = EXCL)
    (HS = OK)
    Here SID is the name of data source that you have just created.
    3- In %ORACLE_HOME%\Network\Admin\Listener.ora file add:
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = <hs_sid>)
    (ORACLE_HOME = <oracle home>)
    under SID_LIST_LISTENER like:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = d:\ORA9DB)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = ORA9DB)
    (ORACLE_HOME = d:\ORA9DB)
    (SID_NAME = ORA9DB)
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = EXCL)
    (ORACLE_HOME = D:\ora9db)
    Dont forget to reload the listener
    c:\> lsnrctl reload
    4- In %ORACLE_HOME%\hs\admin create init<HS_SID>.ora. For our sid EXCL we create file initexcl.ora.
    In this file set following two parameters:
    HS_FDS_CONNECT_INFO = excl
    HS_FDS_TRACE_LEVEL = 0
    5- Now connect to Oracle database and create database link with following command:
    SQL> CREATE DATABASE LINK excl
    2 USING 'excl'
    3 /
    Database link created.
    Now you can perform query against this database like you would for any remote database.
    SQL> SELECT table_name FROM all_tables@excl;
    TABLE_NAME
    DEPT
    EMP
    But you're limited to Windows based servers for this.
    As for converting Excel to CSV and doing it yourself. I hope you know the internal format of MS Excel files cos you're gonna need to know it. It would be far easier if the "user" creating the Excel file could save a copy out in CSV format for you and then it's just a case of FTP'ing the file and using external tables to read the data.

  • Problems executing exe file outside vignette(HAL)

    Hi, when trying to execute my exe file generated with vignette I'm getting an error:
    C:\WINDOWS\system32\cmd.exe - cas33.bat
    The NTVDM CPU has encountered an illegal instruction
    CS:05a7IP:016b OP:63 65 64 20 77 Chose 'Close' to terminate the application.
    The thing is that I've executed it before in other computer and it was working. But now I've to execute it in other computer where I have to specify other parameters in my .ini file ( as server, user, password, filename...)
    Any idea??
    Thank you

    Hi,
    No I just write them in the ini file(replacing the old values with the new ones).
    I don't have dll in the folder. It was working in the other computer by just executing the .bat file...I don't know what is happening know.
    Thank you so much

  • Problem with executing .exe file

    I am executing a .exe file in sun studio (Web Project) .... but it generate Control Access Exception, File Permission <<ALL FILES>> Denied . But the same command execute with simple java file and in DOS command....
    kindly someone give me help
    Thanks

    You have posted your message on the Sun Java Studio Creator forum. I believe you need to repost your message on a Sun Studio forum. Please see http://developers.sun.com/prodtech/cc/community/index.jsp.

  • Does LCDS permit executing .exe files

    hi
    Let me explain what I want to do...Actually I'm working on an
    AIR app which is a GUI for ffmpeg(a video converter which uses
    command prompt). A user can upload files to the FMS using this AIR
    app... When the user uploads a video, I want my flex app to
    automatically invoke the video converter and convert it to .flv
    format.. (After the upload) ...So I'm using LCDS... What I'm asking
    is can I invoke a .exe file from an AIR app..??? I read about some
    security issues with this..So I wrote a Java code to invoke the
    .exe....The Java code executes fine when run separately...But when
    I used Remote object in the flex code, although the java code
    executes....The .exe doesnt get invoked...How do I manage???

    If it is an exe file and your running osx, it's not going to work.
    You can try crossover office (http://codeweavers.com), but that may or may not work.

  • Executable Jar files with Oracle drivers and Oracle classes

    I have a program which works perfectly that is used to do file
    maintenace on an oracle table. Now I am ready to make this into
    an executable jar file. I know how to do this, but my problem is
    now how do I get the Oracle classes into my jar? I think they
    are all in classes12.zip, but just adding classes12.zip into the
    jar doesnt work. I still get an error when running the program
    that says it can't find oracle.jdbc.drivers.oracledriver.
    You can use the jar command to add all classes in a directory,
    but this doesnt work either.
    Has anyone out there ever done this? Please help if you know how
    to do this. How do you put the oracle classes into you
    executable jar file?
    Wah!!!

    Me again. I forgot to mention that I am only using Java. We
    don't have Oracle forms or jdeveloper. This is just straight
    java. Everything worked until I tried to executable jar creation.

Maybe you are looking for