A script-enabled browser is required for this page to function properly.

HOST Built-in

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

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;