Re: E-mail from forms
Date: 2000/07/31
Message-ID: <965031197.405487_at_soint7>#1/1
Try looking under the HELP menu into the HOST built-in.
Bellow is a copy of the HOST help screen.
Syntax:
HOST(system_command_string);
HOST(system_command_string, screen_action);
Built-in Type: unrestricted procedure
Enter Query Mode: yes
Description:
Executes an indicated operating system command.
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.)
Note: The screen_action parameter is only relevant to applications running in character mode, where the output of the Host command is displayed in the same window as the form. In GUI applications, the output of the Host command is displayed in a separate window.
Example:
/*
- 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;
Moreno Y.
ORACLE Developer 2000 programmer,
Daemon Systems Ltd.
(Visit our website at http://www.daemon.co.il )
Received on Mon Jul 31 2000 - 00:00:00 CEST