How to simulate HOST command from DB Procedure

Hi,
I'm using Oracle 9.2 database on Win2000 PC.
I need to start .bat file from a database procedure. More generaly how to simulate HOST command that I'm using from Forms6i.
Thanks,

Thanks for the reply,
But, I am able to successffuly execute HOST from SQL+
only from the PC where the database is, not from the client. My .bat file is on the server side.
From the procedure I was not able to run it in either cases
Procedure TEST
IS
BEGIN
EXECUTE IMMEDIATE 'host C:\MYBATCHFILE.BAT'
END;
returns ORA-00900 INVALID SQL STATMENT
with EXECUTE IMMEDIATE '$ C:\MYBATCHFILE.BAT' returns Invalid Character Error.
BR,

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

  • 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

  • How to execute Operating System commands from Stored procedure.

    Any help on how to execute Operating System commands from stored procedures will be appreciated.
    Nanditha.

    Search the forums for 'External Procedure' and you will find example code that has been posted before.

  • Run multiple unix commands from ODI procedure

    I want to run a series of unix commands from ODI procedure. I dont want to use Unix shell scripts. (I know that works).I am just trying to place the contents of the shell scripts in ODI procedure with Operating system as technology. But I am unable to execute the proecedure.
    For example below is a very small 3 line commands I would execute
    filename="/var/test.txt"
    ls -l $filename > /var/anotherfile.txt
    chmod 777 $filename
    I am not sure if there is any specific syntax that I have to follow for executing unix commands. Also I dont want to write a Jython and use os.system command as well.
    Appreciate any help on this

    First your original question... You can put more than one DOS command on a single line, simply separate each command with an ampersand (&). For example:
    mkdir c:\abc & cd abc & dir*
    Regarding your concerns about performance, well that would depend on exactly what you mean. Using CLIENT_HOST (or HOST on the server) simply opens a shell (DOS in this case) then passes your command to it. The performance of performing this action really isn't measurable. Basically you are just pressing a button and you should get a near immediate action. As for the performance of executing each command, that has nothing to do with Forms. Once the command is passed to the shell, the rest is a function of the shell and whatever command you passed.
    Having said that, if you were to write something sloppy like a loop (in pl/sql) which called CLIENT_HOST lots of times repeatedly, then yes there would be a performance problem because the pushing of the button will cause an exchange to and from the server and each cycle in the loop will do the same.
    So the answer to how performance is impacted will depend on what exactly you need to accomplish. If it is a single call to CLIENT_HOST, this should be fine.

  • Executing OS command from sql procedure

    i want to execute an OS command from the procedure, can i do this way? looks like it is not executing the command move....
    declare
    begin
    dbms_output.put_line(' moving...');
    host;
    move c:\file1\test.txt C:\moved
    exit;
    /

    True. But that job is going to run in a separate session, some time after the current transaction commits (depending on the number of jobs queued up to run). So if you need to pass information back from the job, or you want the procedure to handle exceptions thrown by the job, or you want to tie job related failures back to a particular application level event, or you want the rest of your procedure to wait for the operating system command to finish, using the DBMS_SCHEDULER for this sort of thing is going to require a fair amount of additional coordination/ monitoring/ infrastructure code. It's certainly not a Herculean task to write that additional code, and it's reasonable in some situations, but the Java stored procedure approach strikes me as substantially easier to deal with in most cases.
    Justin

  • 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 execute Linux command from Java app.

    Hi all,
    Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
    Thanks a lot,

    You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
    If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
    You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
    java.io.BufferedReader br =
    new java.io.BufferedReader(new java.io.InputStreamReader(
    Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
    getInputStream()));
    while ((s = br.readLine()) != null) {...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Execute Unix Mail Command from Store Procedure

    Hi Colleagues!
    I designed a store procedure that Monitoring some Critical tables in my Oracle 8.0.6.1.0 Database But I need to send some Emails from the Store Procedures to Information System Staff when the amount of rows increase too much. I read about UTL_SMTP but my database version is too old to run this package. Also I have the option of Maildemo8i that execute MS Oulook from a Client System But I looking to Send it from my Database(OS HPUX). So please take a look of this issue and I will appreciate any help.
    Your Friend.
    Emmanuel Carrillo Trejos.
    LNB, Republic of Panama(Central America).
    P.D. You can email to: [email protected]

    Do you mean that you want to execute mail or mailx unix commands to send mails.If i am right then probably you are looking for a way to execute operating system commands from your procedure.
    You can refer this link if you want to do that. You need java support in your Oracle database and i believe that Oracle 8 does have jvm running in the instance.
    http://asktom.oracle.com/pls/ask/f?p=4950:8:5079825575573830264::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:952229840241
    Thank you!

  • How to call gnuplot command from java

    Hi there,
    In our course, we are required to develop an GUI for gnuplot. In case you don't know about gnuplot, it's a plotting program and has lots of command. We want to use java and swing, but now we don't know how to call gnuplot command from java, or how to execute a shell command(script) from java.
    By the way, since we need read in files with several columns of data and allow user to select a column, we want to use JTable. Is that reasonable?
    Thanks a lot for any suggestions!
    Jack

    Hi, there:
    Will using JTable add much overhead? I may have to use several JTables and switch among them. I can add scroll bar to or edit JTables, right?
    BTW, do you have experience about gnuplot? Can I find the command tree of gnuplot somewhere? Or do you know a better place to post question about gnuplot? unix/linux group, maybe.
    Thanks,
    Jack
    P.S. Would you guys answer my question after I use up my duke dollars? :- )

  • Host command from D2K Forms

    Am calling the sql loader (sqlldr73) using HOST command from D2K Forms 4.5.
    my code has following sequence,
    <sequence of stmts 1>
    Host(....);
    <sequence of stmts 2>
    the stmts(<sequence of stmts 2>) following the call to HOST commant should be executed only after successful execution of the sql loader.
    curently the sql loader and stmts(<sequence of stmts 2>) are running parallely
    Is there any work around?

    Hi,
    Better way to do it would be to write a batch / shell script with the sequence of statements you want to execute and call the batch file using the host command.
    Regards,
    Arun

  • Issue with Executing OS commands from Stored Procedure

    I am trying to execute the scripts provided at :
    http://github.com/xtender/XT_SHELL
    provided by xtender user.
    As required, I have asked my DBAs to grant privileges by executing the following scripts:
    Begin
      --change to needed permissions and execute
      dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/factiva/ODS/bin/CVIM_Rpt_ExportCSVFile’, 'read,write,execute' );
    end;
    /where CVIM_Rpt_ExportCSVFile is my script residing in the Unix server where my Oracle is installed.
    The error I am facing when I try to execute the following command is:
    select * from table(xt_shell.shell_exec('/var/scripts/CVIM_Rpt_ExportCSVFile',100))
    Exception:the Permission (java.io.FilePermission /var/scripts/CVIM_Rpt_ExportCSVFile execute) has not been granted to ODS. The PL/SQL to grant this is dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/scripts/CVIM_Rpt_ExportCSVFile', 'execute' )I have asked my DBA to also execute the following scripts: - But I still see the same error as above. I am not able to figure out whats going on. Can anyone pls help me out??
    EXEC Dbms_Java.Grant_Permission('ODS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC Dbms_Java.Grant_Permission(ODS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/scripts/CVIM_Rpt_ExportCSVFile', 'execute' )

    DUPLICATE
    ===============================================================
    Issue with Executing OS commands from Stored Procedure
    ==============================================================

  • How to generate load commands from cap (ijc)

    I don't understand how to generate load command from cap (in my case ijc)-file.
    This is the example from GPShell, first command of three:
    Command --> 1. 80E80000EFC48203DE01001ADECAFFED01020400011048656C6C6F576F726C64303030305F5002001F001A001F00140031006E00180147004E0036000000F1000A0005003503010004003103000107A0000000620101060210A0000000090003FFFFFFFF8910710002000110A0000000090005FFFFFFFF8913000000030014011048656C6C6F576F726C64303030305F410031060018438003020001070200000041004480020081010108810000070147000A40188C0002188D00058700181100FFAD007B0003037B00039210210303038B0004538901AD00058B0006188B00077A05308F0008181D1E1100FF538C00097A0020
    questions:
    1. Why the length of each command is equal to EF (239 bytes)? Maybe 239 bytes + Mac len + cla, ins, p1,p2, cmdLen. I mean, will the length always be EF?
    2. C48203DE - what is it. In the GP221 i found:
    'C4' 1-n Load File Data Block Mandatory. So if it is right, is the 8203DE - Load File Data Block? Because real data from my ijc-file starts after DE - 01001...
    3. Is all data from the file used for load? (i notised that the last command does'nt used all the rest bytes)

    So, I will help myself
    CAP is zip, but with other filename extension. Inside there are following files:
    Applet.cap
    Class.cap
    ConstantPool.cap
    Debug.cap
    Descriptor.cap
    Directory.cap
    Header.cap
    Import.cap
    Method.cap
    RefLocation.cap
    StaticField.cap
    Order of reading these files for loading by commands 80E8 the following:
    loading Header.cap (51 byte)
    loading Directory.cap (36 byte)
    loading Import.cap (55 byte)
    loading Applet.cap (19 byte)
    loading Class.cap (19 byte)
    loading Method.cap (6779 byte)
    loading StaticField.cap (13 byte)
    loading ConstantPool.cap (397 byte)
    loading RefLocation.cap (663 byte)
    loading Descriptor.cap (1005 byte)
    loading Debug.cap (12115 byte)
    But ijc the file is not cap (zip) and while I didn't understand how to load ijc

  • How to run a HOST command from Report 2.5

    Hello everybody,
    I want to pass an unix command from a Report. I am running the report (Report 2.5) on an Unix server and I want to pass a unix host command inside the Before Report Trigger of the report. But Report2.5 is not recognising the HOST built-in. Is there is any way around?
    Thank in advance.
    Samujjwal Basu

    First off is that openssl command correct? Should it be this instead:
    openssl pkcs8 -inform der -nocrypt -in test.der -out result.pem
    Try out your openssl command within a command prompt so that you know that it works ok. I think the command line you specified waits on stdin (well it does for me).
    After that.....
    runtime.exec creates a Process object. If you do this:
    Process openssl = runtime.exec("....")
    then you can examine the return code from openssl to see the exit code - for instance if the input file does not exist then exit = 1. You can test for this with Java
    Alternatively you could get the stderr from the process and look inside it - if it is 0 length then all is good, if it has some text in there then it has likely failed. You could then throw an exception and include the stderr output in the exception messgae. You may need to experiment with this, runnig it first when openssl is happy then running it again when openssl is upset.
    M

  • How to execute host command in trigger

    dear professional:
    i'm trying to create a trigger that when a certain value inserts into a table , it fires some UNIX command to do the job following
    here is what i tried ,create a trigger that gives host command , but when i tried insert , it fails to work
    i also tried dbms_pipe ,but seems same when using dynamic sql to do the job
    any idea of how to accomplish this task ?
    many thanks ~
    br/ricky
    SQL> CREATE OR REPLACE TRIGGER price_exec
    2 BEFORE INSERT ON omc.price_test
    FOR EACH ROW
    BEGIN
    IF :NEW.price = 4 THEN
    execute immediate 'host ll';
    END IF;
    END price_exec;
    / 3 4 5 6 7 8 9
    Trigger created.
    SQL> insert into price values ('test',4);
    insert into price values ('test',4)
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> insert into price_test values ('test',4);
    insert into price_test values ('test',4)
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at "OMC.PRICE_EXEC", line 3
    ORA-04088: error during execution of trigger 'OMC.PRICE_EXEC'

    hi,
    my db is 9.2
    i'm aware of schedule you mentioned , but if it's up to the task , you don't know when a row with certain value is inserted
    simple way :
    when a row inserted into a table with value "catch me" you want to know who inserted this test value
    so you tried to create a trigger to catch program, machine, module ,and terminal info from v$session
    so you can figure out where it is coming from
    and i want to go a step further , by executing some os command to digging out more
    and i come up with this , when value 4 is inserted i exec a procedure host to execute command,
    the problem is it's not working as i exepcted , so spare me the lecture of reading docs and just tell me what to do
    i'd really appreciate it , thanks
    CREATE OR REPLACE TRIGGER price_exec
    BEFORE INSERT ON omc.price_test
    FOR EACH ROW
    BEGIN
    IF :NEW.price = 4 THEN
    execute immediate 'host('echo')';
    END IF;
    END;
    Warning: Trigger created with compilation errors.
    SQL> show errors
    Errors for TRIGGER PRICE_EXEC:
    LINE/COL ERROR
    3/30 PLS-00103: Encountered the symbol "ECHO" when expecting one of
    the following:
    . ( * @ % & = - + ; < / > at in is mod not rem return
    returning <an exponent (**)> <> or != or ~= >= <= <> and or
    like between into using || bulk
    The symbol ". was inserted before "ECHO" to continue.

Maybe you are looking for

  • No email in Outlook 2011 for mac since yosemite upgrade

    I installed yosemite 10.10.2 two days ago and cant get my gmail anymore. Using Outlook for mac 2011, ver 14.2.7 and gmail. Called microsoft, they created new identity but now I can only see what has come in the last 2 days, All other history, drafts,

  • Document Set default content type

    When defining a document set, you can define what content types can be used in a document set.  If, after uploading a document, the user cancels the properties page, the default content type for the library is assigned to the document (even though th

  • Which of these cameras should I go with?

    Hi all,     I am buying my wife a new digital camera for Christmas.  My budget is $200-$300.  I have it narrowed down to these: Olympus Factory Refurbished SP-800 UZ- $229 Nikon Coolpix P100- $319 Kodak Easyshare Z981-$ 200 Nikon Coolpix L110 $195 Ni

  • After updating Camera Window DC, camera lens will not open

    I had been for a few years using with no problems my Powershot SX100 IS with the software provided at the time of purchase on an earlier Macmini. I would connect the power cable and usb cable and was able to take macro photos of coins etc. I recently

  • Transfer og

    How could I transfer purchased apps and music of the iTunes from my old computer to the new computer?