How to run os command from oracle 10.1.0.1.0 plsql.....

hi,
is any one able to resolve my problem.
thanks in advance
my problem is that i want to run os command (dir/b to get list of all files and directory names) using oracle 10.1.0.1.0 plsql.
what will be the code snippet in oracle plsql.
if any one have an idea then please let me know.
thanks.

First bullet of the thread no one reads
Posters, please mind these common-sense rules when participating here:
- When asking a question, provide all the details that someone would need to answer it. Consulting documentation first is highly recommended.
For me that includes perusing available resources. The 'Search Forum' button of this forum is. Http://asktom.oracle.com also is. Ninety nine percent of all users posting here did zero to resolve their own problem. This is why the results of 'Search Forum' are such a mess. As Oracle does nothing to moderate or clean up this forum, the mess stays and is aggravated because most people....
etc.
But then consilodating threads in a series of FAQs wouldn't help, as most people wouldn't read them.
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • How to run unix command from Oracle Foms 10g

    OS: UNIX Solaries, Oracle Application Server 10g
    To run shell script from Oracle Forms, I used the following host('/bin/bash /u01/compile.sh') and it works well
    Now, I need to run unix command something like
    host('mv form1.fmx FORM1.FMX') but it's not working
    I tried to append the command "mv form1.fmx FORM1.FMX" to the compile.sh shell script but also it's not working although the rest lines of the shell script is running well
    Edited by: slamonty on Aug 23, 2012 12:36 AM

    Yes, Thank you so much, it works well as follow
    $ /bin/mv /u01/oracle/runtime/test/form1.fmx  /u01/oracle/runtime/test/FORM1.FMX Edited by: slamonty on Aug 23, 2012 9:59 AM
    Edited by: slamonty on Aug 23, 2012 11:14 AM

  • How to run a report from oracle 10g form in .csv format

    dear all,
    how to run a report from oracle 10g form in .csv format? i've already run in pdf & excel format.
    i'm using
    SET_REPORT_OBJECT_PROPERTY (ro_report_id, report_desformat, 'PDF'); --for pdf
    SET_REPORT_OBJECT_PROPERTY (ro_report_id, report_desformat, 'SPREADSHEET'); ---for excel
    Please Help..

    i have already tried.
    but the report show in htm or html format. that file will not save into csv. please help.

  • How execute pl/sql command from Oracle ADF Business Components

    can't find examples for how execute pl/sql command from Oracle ADF Business Components and how call pl/sql package procedure from ADF Business Components.
    insert,update,delete rows in view object instance cache is good but if i must do some complex operations while insert,update,delete rows..it's more better for me to call
    pl/sql procedure from oracle db.Am i wrong ????

    Roman,
    this should be similar to how it worked in JDeveloper 9.0.3. hava a look at <JDev903 Home>\BC4J\samples\StoredProc for a code example.
    Frank

  • How to run batch file from oracle forms 9i

    Hi everyone.
    i have a data in csv file. i want to upload it to my database. i am using sql loader for it.
    i have made a batch file which run the sql loader and transfer my data to database.
    How to run batch file from oracle forms 9i.
    when i press the button, nothing uploads in my database. (when i simply run the batch file it works).
    here is my code
    Begin
    HOST('C:\temp\batchfile.bat');
    message('done');
    end;
    Thanks in advance
    regards
    sajid

    this is my log file, when i run manually.
    SQL*Loader: Release 10.2.0.1.0 - Production on Thu Jul 1 23:27:53 2010
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Control File: file_to_upload.ctl
    There are 2 data files:
    Data File: sk.csv
    Bad File: sk.bad
    Discard File: none specified
    (Allow all discards)
    Data File: sk1.csv
    Bad File: sk1.bad
    Discard File: none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array: 64 rows, maximum of 256000 bytes
    Continuation: none specified
    Path used: Conventional
    Table KHAN, loaded from every logical record.
    Insert option in effect for this table: APPEND
    Column Name Position Len Term Encl Datatype
    SR FIRST * , O(") CHARACTER
    DATES NEXT * , O(") CHARACTER
    AGENT NEXT * , O(") CHARACTER
    COUNTRY NEXT * , O(") CHARACTER
    TRANSACTIONS NEXT * , O(") CHARACTER
    PKR NEXT * , O(") CHARACTER
    USD NEXT * , O(") CHARACTER
    BANK NEXT * , O(") CHARACTER
    Table KHAN:
    11088 Rows successfully loaded.
    0 Rows not loaded due to data errors.
    0 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Space allocated for bind array: 132096 bytes(64 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 11088
    Total logical records rejected: 0
    Total logical records discarded: 0
    Run began on Thu Jul 01 23:27:53 2010
    Run ended on Thu Jul 01 23:27:54 2010
    Elapsed time was: 00:00:00.63
    CPU time was: 00:00:00.17

  • How to run OS commands from PL/SQL???

    Hi
    Is there any way to run OS commands(Windows Platform) from within PL/SQL?
    Thanks

    APC,
    I am working on Discoverer, having lots of BAs & Workbooks created & stored in Database. Now if i want to move all the workbooks from one place to another (like from development to test or production) i can use Command line interface of Disco to do this. But i don't see any option there to export all the workbooks, so i thought of writing a pl/sql to get all the workbook names from the EUL then fire export Command for each record(although not a good practice but its a one time work). This is the place where i need to run OS command from within PL/SQL. Although it doesn't seem possible now(as you all said) without external procedure.
    Lastly, you are right that "Oracle make databases not operating systems" but my first impression/comment about oracle is:
    "Oracle is far Bigger, Powerful, Complex, Vast and Interesting System than any other..." so i believe it can do/capable doing anything :-)
    thx Ashutosh,
    Host is definitely an option but i can't run it from pl/sql(that i am looking for)..

  • Run OS command from Oracle

    Hi All!!
    Which package can help me to run OS command from SQL script?
    Thanks.

    If you are using SQL*Plus to execute the script, you can use the SQL*Plus command HOST. If you are trying to execute an operating system command from a PL/SQL block (i.e. a stored procedure), you would need to use an external procedure or a Java stored procedure that uses Java's shell functionality.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to run a script from Oracle Form (Beside using HOST command)

    I would like to run a script from Forms 6.0. I know that we can actually issue this command :
    host('plus80.exe' username/password@connect_string @c:\scriptname);
    BUT, is there any other alternative ?

    Sqlplus is a different program, so one way or the other you have to leave Forms to run sqlplus. What is you objection against HOST?
    You can also run sqlplus from the database, but again you need a stored java procedure to call sqlplus (sort of HOST command that runs in the database).
    Francois' solution works if your script just has a query to run, but if you have specific sqlplus commands (spool etc.) forms_ddl is probably not a solution.

  • How to run system commands from JAVA

    Hi Friends,
    How to run windows system commands from JAVA
    Runtime r=Runtime.getRuntime();
    r.exec("dir");
    Throwing following Exception
    CreateProcess :dir error=2
    Thanks in advance
    Hamsa

    Hi ,
    in Windows NT this is not possible, you can use the following :
    Runtime r=Runtime.getRuntime();
    StringBuffer sbuf = new StringBuffer();
    String dir = new String();
    java.lang.Process proc = r.exec("cmd /c dir");
    InputStream is = proc.getInputStream();
    int ch ;
    while((ch=is.read() ) != -1)
    sbuf.append((char)ch);
    is.close();
    dir = sbuf.toString();
    System.out.println(dir );

  • Run Raw commands from Oracle FTP adpater

    Hi,
    The target system we are having is mainframes.We need to ftp a file in some location on the mainframes using Oracle Fusion Middleware 11.1.1.5 ftp adapter.Before sending the files there is requirement to run some raw commands.Can someone help me regarding this.
    Thanks & Regards
    Edited by: Nitin on Aug 22, 2012 6:30 AM

    Consider the following alternative.
    Have DBMS_SCHEDULER invoke a task that only oracle controls at OS level.
    You control what, if anything, that gets passed to this script.
    You control who & when DBMS_SCHEDULER invokes this script.
    By doing so, no Java is involved & no use for UTL_FILE to be used.
    ALL OS file activity is controlled by YOUR script.
    OS activities are best handled by OS shell script; without involving Oracle's extensions (UTL_FILE, Java, etc.) to diddle at the OS level.

  • How do run dos command from form

    Hi all,
    I need to run a file.bat (dos), someone can help me, please?
    I know the command HOST(..), but when execute the command exit a black window. Are there other command?
    Thank you
    Silvia

    Hello,
    I know the command HOST(..), but when execute the command exit a black window. Are there other command?Version Dependent.
    For less then or equal 6i version
    HOST('CMD /C C:\batch_file_name.bat');For the web based...
    The same above command will work for AS level. If you need on client side then
    CLIENT_HOST('CMD /C C:\batch_file_name.bat');-Ammad

  • How can I use unix commands from oracle report

    I have to use the following command from oracle reports.
    In oracle forms we can use the HOST command but what about oracle reports2.5.
    I have to email the attached file 100245.pdf from oracle reports to the given email id
    uuencode 100245.pdf 100245.pdf | mailx -s "test" [email protected]

    Hi,
    It's because .bat (or .cmd) files are scripts and not executables and are interpreted using the command line executable - which is normally cmd.exe (although you can buy others).
    So you need to call cmd.exe passing the bat file name as a parameter, something like
    cmd.exe /c batchfilename
    Without the /c you will never get a response.
    However, this brings us to the bizarre conclusion that you are going to:
    call cmd.exe (a shell interpreter)
    to launch a batch file
    that calls cygwin (another shell interpreter)
    which then runs ls
    When shouldn't that just be:
    call cmd.exe to run the dir command
    Or better yet, If you are just after a file name listing and you seem to understand Java stored procs, why not just write a JSP to list the contents of a directory? No problems with OS dependant commands, scripts and 3rd party interpreters. Plenty of examples of that out on the internet as well.
    HTH
    Chris

  • Is it possible to run host command from SAP environment? How do you run?

    Hi
    Is it possible to run host command from SAP environment? How do you run?
    Thank You

    Hello Subhash
    You will more details in the following thread:
    Re: How to define command for SXPG_COMMAND_EXECUTE
    Regards
      Uwe

  • Running ssh command from java and then answering password prompt

    Hi,
    I have a situation that has not solved yet. I am running ssh command from unix terminal without any problem, and then i enter password.
    For example :
    [oracle@fuata]:/export/home/oracle> ssh -N [email protected] -L 9901:127.0.0.1:9999
    Password:
    It is working. I have question that how can i perform this in java? I am thinking that i can run ssh command by using Runtime Class, it is ok. But how can i answer the password? I am a bit confused. Is there any example looks like this?
    Thanks for responses.

    futi wrote:
    Thanx. Firstly i insisted to do this without jsch but actually this is harder than jsch. I edit some of code pieces PortForwardingL.java and could run it. It works problem-free. Could you say why you "insisted" on this approach. It can't be for speed+ since jsch is very fast. It can't be for portability+ since jsch is portable but the use of Runtime.exec() requires the installation of ssh software. It can't be because of limitations+ since jsch is a fully featured library. It can't be for security+ since jsch is secure. It can't be for ease of use+ since jsch is much easier to use than ssh with Runtime.exec(). Unless it's a licensing issue, it can't be for commercial+ reasons since jsch is free. The only reason I can think of why one would "insisted" on this approach is if it is for some college project.

  • Running ls command from Java stroed procedure no output

    Hi ,
    I am trying to run ls command from java stored procedure in oracle
    Process p = Runtime.getRuntime().exec("ls");
    BufferedReader stdInput = new BufferedReader(new
    InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new
    InputStreamReader(p.getErrorStream()));
    // read the output from the command
    System.out.println("output of the command run:\n");
    while ((s = stdInput.readLine()) != null) {
    System.out.println(s);
    from java stored procedure in oracle.
    i get output of println statments but it does not go into while loop to print from stdInput.
    Result of running Java stored procedure is -
    output of the command run:
    Call completed.
    when i run the program on client side it works fine.
    Has anybody tried this from java stroed procedure.
    Thanks,
    Jag

    Jag,
    Actually, the question of whether it works for me seems to depend on the version of the OS (or Oracle). On RedHat Linux (Oracle 8.1.6) it didn't work at all, but on Solaris (Oracle 9.0.2) it did. Here's the output from that run:
    SQL> /
    output of the command run:
    init.ora
    initDBPart9i.DBPSun01.ora
    initdw.ora
    lkDBPART9I
    orapw
    orapwDBPart9i
    spfileDBPart9i.ora
    Done
    PL/SQL procedure successfully completed.
    But, I did need to change a line of your code to this:
    Process p = Runtime.getRuntime().exec("/usr/bin/ls");
    your original was:
    Process p = Runtime.getRuntime().exec("ls");
    You might consider, if possible, use of some of the Java File classes instead of ls, as this might make things more predictable for you. There were some examples in oramag.com a few months ago, but they were pretty simple (you might not need them).
    Hope this helps,
    -Dan
    http://www.compuware.com/products/devpartner/db/oracle_debug.htm
    Debug PL/SQL and Java in the Oracle Database

Maybe you are looking for

  • Rollovers not working in CS3 - HELP!

    I imported a site into Dreamweaver, and on the pages I haven't touched the rollovers work fine.  On the pages I've made changes, the rollovers no longer work although the links work.  I tried replacing the head tag on the page with the disfunctional

  • Create File Object from a remote file

    Hi, I would like to know about how to create a new File object from a file in a remote machine, it is a web application, i have the remote route of the file, and if I need the ip of the remote machine, I would like to know how to get it too. File fil

  • JDBC to JDBC

    Hi all, I am doing jdbc to jdbc scenario, my scenario is like this: I got two databases, i need to read the table from first database and send it to XI, after that i need to check the record is exist in one of the table in second database, if that re

  • Class names not sticking when output as book?

    Indesign CC, outputting to ePUB from a book file with 4 chapters, does not output the correct, named class in the CSS and source code, the class takes the name of the style instead. As a check, I output a single chapter using File > export and my nam

  • Oil Paint Filter not working in Photoshop CS6?

    Ok, so I have had PS CS6 for a couple of months with no problems. I downloaded the oil paint filter, but to use it i needed to update my GPU drivers, so I did and it started working. Last week, i noticed that when i attempt to use the filter, it says