This example external procedure calls a program called nco_mail, which sends e-mail about unacknowledged critical alerts.
| Field | Entry |
|---|---|
| Name | send_email |
| Parameters | in node Char(255) in severity Integer in subject Char(255) in email Char(255) in summary Char(255) in hostname Char(255) These read-only entries in the Parameters
list are constructed from entries made in the In/Out, Name, Data
Type, and Length fields in the Parameters area.
For example, for in node Char(255), the
entries are:
|
| Executable | $NCHOME/omnibus/utils/nco_mail |
| Arguments | '\''+node+'\'', severity,'\''+subject+'\'','\''+email+'\'','\''+summary+'\'' |
| Host | localhost |
The full SQL text of the same send_email procedure is as follows:
create or replace procedure send_email
(in node character(255), in severity integer, in subject character(255),
in email character(255), in summary character(255), in hostname character(255))
executable '$NCHOME/omnibus/utils/nco_mail'
host 'localhost'
user 0
group 0
arguments '\'' + node + '\'', severity, '\'' + subject + '\'',
'\'' + email + '\'', '\'' + summary + '\'';
This example also shows how to pass text strings to an executable. Strings must be enclosed in quotation marks, and the quotation marks must be escaped with backslashes. All quotation marks in this example are single quotation marks.