الانتقال إلى المحتوى

calling exe file from procedure


mo_sa_tanany

Recommended Posts

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 Form Builder will:
*- clear the screen
*- prompt the operator to return from the command

NO_PROMPT: Specifies that Form Builder will:
*- clear the screen (does not prompt the operator to return from the command)

NO_SCREEN Specifies that Form Builder 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

Thescreen_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.

On Microsoft Windows NT, when using HOST to execute a 16-bit application, the FORM_SUCCESS built-in will return TRUE whether the application succeeds or fails. This is a Microsoft a Win32 issue. 32-bit applications and OS commands will correctly return TRUE if executed sucessfully and FALSE if failed. Invalid commands will return FALSE.

On Windows 95 platforms the FORM_SUCCESS built-in will always return TRUE for HOST commands which fail. This includes calls to command.com or OS functions, any 16-bit DOS or GUI application, or an invalid command. 32-bit applications will correctly return TRUE if executed sucessfully and FALSE if failed.

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 سنة...

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية