Re: Multiple instances of Oracle?

From: Dennis Moore <dbmoore_at_us.oracle.com>
Date: Sun, 16 Jan 1994 21:14:29 GMT
Message-ID: <1994Jan16.211429.16222_at_oracle.us.oracle.com>


In article <1994Jan14.164621.3666_at_pool.info.sunyit.edu> gsaw1_at_pool.info.sunyit.edu (Susan Wheat) writes:
>Hi,
>
> Does anyone know how to call a C program or a Unix shell script
>from SQL Forms? We are using Oracle version 7.0.13 on a Sun machine.
>An example would be very helpful. Thanks in advance!
>
>Sue

The following section is COPYRIGHTED MATERIAL reprinted with the permission of Oracle Corporation. All Rights Reserved. Please contact Oracle Corp. for information on this copyright if necessary.

While you didn't mention which version of Forms you are using, here is a section of the manual from Forms 4, which is very similar to SQL*Forms 3.

HOST 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 is to clear the screen and prompt the operator to return from the command.

        NO_PROMPT Specifies that Oracle Forms is to clear the screen but does not prompt the operator to return from the command.

        NO_SCREEN Specifies that Oracle Forms is not to clear the screen or 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.

Example:

	/*
	** Builtin:  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;

I hope this helps ...

  • Dennis Moore, disclaimer available on request ...
Received on Sun Jan 16 1994 - 22:14:29 CET

Original text of this message