Adsense Ad

Wednesday, 29 March 2017

HOST Built-in Command in Oracle Forms

Description

  • Executes an indicated operating system command.

Syntax

PROCEDURE HOST
(system_command_string VARCHAR2);
PROCEDURE HOST
(system_command_string VARCHAR2,
screen_action NUMBER);

Built-in Type unrestricted procedure
Enter Query Mode yes

Parameters
system_command_string  
       Specifies the system command you want to pass to your particular operating system.  
screen_action  
       Specifies one of the following constants:

No parameter
  • Specifies that Oracle Forms will: clear the screen prompt the operator to return from the command


NO_PROMPT
  • Specifies that Oracle Forms will:
  • Clear the screen (does not prompt the operator to return from the command)


NO_SCREEN
Specifies that Oracle Forms will:
  • Not clear the screen
  • Not prompt the operator to return from the system command

(The HOST command should not send output to the screen when using the NO_SCREEN parameter.)


Usage notes
  • Note that the command interpreter for Microsoft Windows 2000 and XP is cmd. Before using the HOST Built-in to run an external command, be sure to check for the operating system and pass the appropriate command string.

  • The host command operates on the application server machine. Any screen output that it performs is not visible to the user of the application.


HOST Examples


/*** built-in: HOST**
Example: Execute an operating system command in a ** subprocess or subshell.
Uses the ** 'Get_Connect_Info' procedure from the **
GET_APPLICATION_PROPERTY example. */
PROCEDURE Mail_Warning( send_to VARCHAR2) IS
the_username VARCHAR2(40);
the_password VARCHAR2(40);
the_connect VARCHAR2(40);
the_command VARCHAR2(2000);
BEGIN
      /* ** Get Username, Password, Connect information */
      Get_Connect_Info(the_username,the_password,the_connect);
      /* ** Concatenate together the static text and values of **
      local variables to prepare the operating system command ** string. */
      the_command := 'orasend '|| ' to='||send_to|| ' std_warn.txt '|| ' subject="## LATE PAYMENT ##"'||
       ' user='||the_username|| ' password='||the_password|| ' connect='||the_connect; Message('Sending Message...', NO_ACKNOWLEDGE);
       Synchronize;
       /* ** Execute the command string as an O/S command The ** NO_SCREEN option tells forms not to clear the screen *
       * while we do our work at the O/S level "silently". */
       Host( the_command, NO_SCREEN );
       /* ** Check whether the command succeeded or not */
       IF NOT Form_Success THEN
            Message('Error -- Message not sent.');
       ELSE Message('Message Sent.');
       END IF;

END;

1 comment:

Unknown said...

This blog is nice and very informative. I like this blog.
blog Please keep it up.