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

Similar Messages

  • Calling SQL Loader using HOST command from Developer Forms 4.5

    I want to execute a set of code from D2K Forms 4.5 which has interfface with Client - OS ( In my case Windows NT/XP). I want to execute SQL Loader from Forms using Host Command and then after completion of that process, I want to do next transcations ( depending upond success of HOST/SQL Loader).
    How to achive this?
    I tried writing code like this ...
    l_vc_command := 'sqlldr73'
                        ||' USERID='||l_vc_username||'/'||l_vc_password||'@'||l_vc_connect_string
                        ||' CONTROL='||l_vc_filepath||'Upload.ctl'
                        ||' DATA='||LTRIM(RTRIM(l_vc_fileloc))
                        ||' LOG='||l_vc_filepath|| l_vc_log_file || '_' || l_dt_sysdate_str ||'.log'                    
                        ||' BAD='||l_vc_filepath|| l_vc_bad_file || '_' || l_dt_sysdate_str ||'.bad'
                        ||' DISCARD='||l_vc_filepath|| l_vc_discard_file || '_' || l_dt_sysdate_str ||'.dsc';
    HOST(l_vc_command,NO_PROMPT);
    After this command i want to do some other code execution. so even if it fails or success, next code is executed. How to control this?
    Please help..
    Regards,
    Milind

    Forms6i running on W2000, Rdbms 8.1.7
    in Forms I added a button TEST,
    Trigger when-button-pressed : host('test.bat') ;
    in directory .......\frm I added file test.bat :
    REM ===============
    cd /d C:\........\ldr
    pause
    sqlldr parfile=test.par
    pause
    type test.log
    pause
    exit
    REM ================
    now, pressing TEST button opens DOS window, telling me what's going on, running sqlldr, finally going back to forms
    Are you using NO_PROMPT or NO_SCREEN option of HOST command ?
    Had a look at Forms 4.5 manuals, there is no mentioning of (a)synchronously operation in connection with HOST command.

  • Call HOST command FROM FORMS 4.5 AND 6.0

    I have a problem that I found out about yesterday, and have no idea how to fixe it.
    I created a form to run on form 4.5.9.7 In this form i call up the host command, but it does not work properly, because by using the host oracle stops there until i close the application that i called with the host, it hangs there. But now it doesn't do it, once the host is executed, it continues the rest of the code that i have, which should not.
    On the same computer i created another form on forms 6.0.5.2 and call the host command again, and finally it worked perfect! I mean until the program called by host command is running forms does not continue, it hangs there.
    Could someone explains me that please, is there some patch I need on forms 4.5?
    null

    We converted forms from 4.5 to 6.0. Basically all you have to do is recompile the forms. but, the very first thing you have to do is recompile all the libraries. The forms will not work if you don't recompile the libraries first. So, open and compile the libraries in 6.0, then open and compile the forms in 6.0. They should then work fine. If they do not, try deleting and reattaching the libraries and compile again.
    Good luck.

  • Host command in application FORMS (access denied)

    i try to use a host command in a form in apllication server vs 1.0.2.2a that call a copyfile.bat.
    J see that this operation send me a message to the server console with "access denied", instead if a use this file from the server works.
    Do you Know something??

    Check out the file and directory permission for the files you are trying to manipulate. Make sure that the user that runs the Forms Seever have the requiered permissions to manipulate these files and directories.

  • 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

  • HOST Command Equivalent In Forms 9i

    We are migrating from Forms 5.0 to 9i. The current application is using lot of HOST commands in Forms 5.0.
    As we knw HOST command is deprecated in Forms 9i, what method to be followed to recode this feature?
    Thanks in advance.

    The client_host command that ships with the WebUtil package runs the command on the client workstation in a web deployed environment.
    HOST runs the command on the machine where the Forms application/executable is running. This can a number of places:
    - When running the later versions (web deployed) this is your application server
    - When running GUI Forms in client/server mode this is the client workstation
    - When running character bases Forms this is the machine that runs Oracle Forms. That could either be the client itself or a server that you access through telnet.
    To come back to your question: client_host cannot be used to execute an operating system command at the database server. Personally, I would use DBMS_SCHEDULER for this an schedule an EXTERNAL JOB to be executed immediately. A Job of type External contains an Operating System command or script that gets executed.
    Forms 5.0 is mostly deployed as a GUI client/server application. I don't know if it still supported character mode. Forms 3.0 was a true character mode application (no GUI yet). Forms 4.0 and 4.5 supported GUI and character mode as well.
    You state that character mode Forms run on the database server, which is not necessarily true. Character mode Forms can run on whatever machine you want; a client desktop, a central Unix/Linux server or the database server itself. If it doesn't run on your local workstation you just need telnet access to the central server running Forms.
    You are correct that client_host is used when migrating from client/server to the web. If you're still running character based Forms on the same server as your database, I would advice using the DBMS_SCHEDULER approach previously described. This keeps you from writing and maintaining a Pro*C program.

  • 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 change the commands from a Form when a certain item is selected???

    Hello,
    I'm developing a J2ME application and I'm having some problems. I have more items on a form and I when i"m moving from an item to another I want that the commands of the form to change. Is that possible? How can it be done? I've tried some ways but without success. Please help.
    Thanks

    There is no focusListener and there ain't any focus events in j2me,
    if you want to have this effect you need to have only one command per item
    so that it won't appear in 'options' menu

  • Use Host command in Oracle forms 6i

    hi
    all
    i use Oracle forms 6i i run in a web and in that i have connect one server so,
    i have to use Host Command and i have to fire this command
    host (' net use \\windchillsvr\e\jyotionline /user:dwg_users dwg_users');
    But it's Not Connect
    My Forms in run in Web
    so help

    JavaBean does d othe job for you but it requires signing process; I used it when I was working on forms6i for our project.
    I could use another approach that is the file type command executable which it stays in client's PC to do it and it does not requires signing at all since I am now working on the Java EE project for downloading and launching the third party tool in client's PC.
    I plan to write a article for forms use, which could do all the heavy WebUtil can do, but not need to go thru the signing process.

  • Host command from sqlplus based on a condition

    I am on an Oracle 10.2.0.3.0 database running on sun solaris.
    Am using my sqlplusw on my windows xp professional to do the below :
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE 10.2.0.3.0 Production
    TNS for Solaris: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    I have 4 variables declared in sqlplus for which I get my values from anonymous pl/sql blocks :
    print db1_status;
    DB1_STATUS
    3
    print db2_status;
    DB2_STATUS
    0
    print db3_status;
    DB3_STATUS
    1
    print db4_status;
    DB4_STATUS
    0
    I needed some help with doing this :
    Based on the values of each these variables, I wanted to invoke the host command to run stuff like
    if db1_status = 3 then
    host ...something
    if db2_status = 0 then
    host ...something
    I am looking for a way to do this without creating an external procedure or java stored programs. Are there any?
    Thanks

    Need to use a batch file (.bat) to utilize SQL Plus while generating the SQL statements within the .bat file.
    Example:
    Inside SQL Plus
    SQL> create table testme (name varchar2(255), value number(5));
    Table created.
    SQL> insert into testme(name, value) values ('db1_status', 3);
    1 row created.
    SQL> insert into testme(name, value) values ('db2_status', 0);
    1 row created.Create a .bat file (Using test.bat)
    test.bat
    @echo off
    echo select value from testme where name = 'db1_status';>temp.sql
    echo exit >> temp.sql
    sqlplus -S %2/%3@%1 @temp.sql > result.dat
    for /f %%x in ('more result.dat') do set RESULT=%%x
    if "%RESULT%" == "3" goto :DB1_STATUS_3
    if not "%RESULT%" == "3" goto :DB1_STATUS_NOT_3
    goto :EOF
    :DB1_STATUS_3
    echo db1_status = 3
    **ENTER SYS COMMANDS HERE**
    goto :EOF
    :DB1_STATUS_NOT_3
    echo db1_status != 3
    **ENTER SYS COMMANDS HERE**
    goto :EOF
    echo select value from testme where name = 'db2_status';>temp.sql
    echo exit >> temp.sql
    sqlplus -S %2/%3@%1 @temp.sql > result.dat
    for /f %%x in ('more result.dat') do set RESULT=%%x
    if "%RESULT%" == "0" goto :DB2_STATUS_0
    if not "%RESULT%" == "0" goto :DB2_STATUS_NOT_0
    goto :EOF
    :DB2_STATUS_0
    echo db2_status = 0
    **ENTER SYS COMMANDS HERE**
    goto :EOF
    :DB2_STATUS_NOT_0
    echo db2_status != 0
    **ENTER SYS COMMANDS HERE**
    goto :EOF
    :EOF
    del temp.sql
    del result.dat
    @echo onAs you can see, this is a simple if/then which takes the value from a dynamically created SQL file (temp.sql) and uses it do determine the next system commands to execute.
    Hope this is what ya needed.
    -Tim

  • HOST Command in oracle forms 10g

    Hi,
    I need to use HOST command to run an OS(Unix) command in Oracle Forms 10g.
    Its throwing a non-oracle exception during run time.
    Is there any kind of configuration/settings that I need to check before using HOST command?
    Is there any way to capture the error description?
    Any help will be highly appreciated!
    Thanks,
    Ankit

    Thanks Thangaraj for your valuable suggestion!!
    One question though..
    Should'nt ORACLE_HOME be an absolute path?
    I have added "/bin" in FORMS_PATH but not sure if we can do the same with ORACLE_HOME.
    Can you please suggest?
    Regards,
    Ankit

  • 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,

  • Host Command from PL/SQL

    Hi,
    We use JAVA source in Oracle to execute some unix commands directly from within stored procedures in Oracle.
    Our Java source looks like this :
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "HOST" AS
    import java.lang.*;
    import java.io.*;
    public class Host
    public static void executeCommand (String command, String etype) throws IOException
    String[] wFullCommand = {"C:\\winnt\\system32\\cmd.exe", "/y", "/c", command};
    String[] uFullCommand = {"/bin/sh", "-c", command};
    if (etype.toUpperCase().equals("W"))
    Runtime.getRuntime().exec(wFullCommand);
    else if(etype.toUpperCase().equals("U+"))
    Runtime.getRuntime().exec(uFullCommand);
    else if(etype.toUpperCase().equals("U"))
    Runtime.getRuntime().exec(command);
    CREATE OR REPLACE PROCEDURE Host_Command (p_command IN VARCHAR2, p_etype IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String, java.lang.String)';
    We call one unix shell script and discover that some UNIX commands from this shell script are executed and others not. A cp & touch command don't give problems whilst cat & unix2dos commands don't function.
    Can anybody help me on this subject?
    Thanks !
    Kris

    Thanks for your reactions. Got it to work with the unix scripts, the problem was a syntax error in the script itself.
    However I don't get it to function when I try to run a unix command directly. Normally the parameter U+ should decide to start it in a shell for scripts and otherwise it should run the command directly. (whithout the /bin/sh in front of it).
    I already adapted my source to try to execute the command in a new shell but without success :
    String[] uFullCommand = {"/bin/sh", "-c", "\'cp /export/home/caluwaek/test/bestand2 /export/home/caluwaek/test/bestand8\'"};
    I tried to put the whole command in one string, in 3 strings, to just call the cp command without bothering the shell. Nothing seems to work.
    In unix both the following work :
    cp /export/home/caluwaek/test/bestand2 /export/home/caluwaek/test/bestand8
    and
    /bin/sh -c 'cp /export/home/caluwaek/test/bestand2 /export/home/caluwaek/test/bestand8'
    Thanks for your help!
    Kris

  • Host Commands from Java

    Hello everyone,
    I'm trying to run openVMS host commands via Java using the code listed below, which essentially runs the following host commands, each in turn:
    terry :== "hello"
    sho sym terry
    sho log robin4
    I've tried a few other commands as well, but the ones which assign variables (such as the terry example above), never work, either producing no output as in the example above, or if I did
    define/group "hello" terry
    would produce:
    DCL-W-NOCOMD, no command on line - reenter with alphabetic first character
    So commands that don't print anything to the screen are the ones that are causing problems (they're just setting variables or what not).
    Does anyone have any ideas as to how to get these commands working via java? I really don't know what to think..I've tried checking the format of the commands I'm trying to do, and it's not down to that - the host command I'm running is right and works if done directly.
    Please help! Thank you so much in advance.
    Robin
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    String s = "hello";
    String s2 = "sho log robin4";
    String s3 = "assign/system "+command+"hello"+command+" robin5";
    try {
    String[] finalCommand;
    System.out.println(System.getProperty("os.name"));
    finalCommand = new String[3];
    finalCommand[0] = "terry :== \"hello\"";
    finalCommand[1] = "sho sym terry";
    finalCommand[2] = s2;
    for(int i = 0;i< finalCommand.length; i++){
    // Execute the command...
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    // Capture output from STDOUT...
    BufferedReader br_in = null;
    try {
    br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("stdout: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_in.close();
    } catch (IOException ioe) {
    System.out.println("Error printing process output.");
    ioe.printStackTrace();
    } finally {
    try {
    br_in.close();
    } catch (Exception ex) {}
    // Capture output from STDERR...
    BufferedReader br_err = null;
    try {
    br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("stderr: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_err.close();
    } catch (IOException ioe) {
    System.out.println("Error printing execution errors.");
    ioe.printStackTrace();
    } finally {
    try {
    br_err.close();
    } catch (Exception ex) {}
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());

    User_resU wrote:
    Hello everyone,
    I'm trying to run openVMS host commands via Java using the code listed below, which essentially runs the following host commands, each in turn:
    terry :== "hello"
    sho sym terry
    sho log robin4
    1. Presumably this represents some sort of character user interface (CUI) which is console based.
    finalCommand = new String[3];
    finalCommand[0] = "terry :== \"hello\"";
    finalCommand[1] = "sho sym terry";
    finalCommand[2] = s2;
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    2. This represents an executable to which you are passing command line arguments.
    This isn't a java problem because 1 and 2 are not even close to being the same.
    Java won't do anything that you cannot get the application to do itself.
    Your choices:
    1. Find a way to run the app such that it takes commands from a file. You put the commands in a file and pass that to exec()
    2. Find a way that use stdio (the CUI might represent that but there is no guarantee.) You then use exec() to start the app then use the IO streams to pass the commands to it.
    Notice that my choices do not include an option for passing as command line parameters because I am almost certain that it does not exist.

  • Host command in oracle forms

    can anyone any one help me on this issue
    i am trying to use host command in a.s which is running in unix o.s to rename one of the file i am using the below command but its not working . can any one tell me whats worng or how to perform this
    the_command := 'mv /dir/filename1 /dir/filename2' ;     
         HOST(the_command,NO_SCREEN);

    I don't think you can do this with host like you did.
    You can create a script which accepts filename1 and filename2 as parameters and call this
    move.sh:
    mv $1 $2
    then call the script
    host('/home/oracle/move.sh /dir/filename1 /dir/filename2', no_screen);
    or if this doesn't work (in windows it works in 6i to call .cmd files without prefixing cmd /c don't know if this is also in unix, but you can try), you can call bash to do this
    host('/bin/bash /home/oracle/and_so_on
    regards
    christian

Maybe you are looking for

  • How do I stop FireFox from doing an auto update

    I am running Linux Mint 15 and FireFox 23. When I click on preferences > advanced > update there are no checkboxs for how I want FireFox updated. I don't want anyone installing on my system without my knowledge. Where has this option been moved?

  • Problem W/viewing videos on Safari

    Lately all the videos I try to view stops every few seconds and reloads. Started this about a month or so ago. Am unable to correct this. Running Mac OSX version 10.6.8 with  a 2.66 GHz Intel Core 2 Duo processor.  Any solutions?  New to Apple!

  • Time stamp and total no of records in ALV

    Hi everybody, i need to display Time: Total No of Records: in my excel report downloaded from ALV. can any body help me out as how to keep the specified above  in my ALV to get in the Exel output.

  • Charge An iPod Touch On A Windows 98se

    I have a 98se desktop computer with USB 1, I know the requirements are USB 2, BUT, I read here that people were having problems with syncing with USB 1 and worked perfectly with USB 2. So the above tells me that it WILL work with USB 1 but it transfe

  • Problems with task in data acquisition

    Hallo, I'm trying to acquire current measures and then converting it in different values (temperature, pressure and flow). For this reason I've created a specific task in which every current measure is converted in the apposite measure and obviously