Re: Host function in SQL/Form 3.0?
Date: 22 Oct 1994 20:35:19 -0600
Message-ID: <38ci57$lv2_at_nyx10.cs.du.edu>
In article <38b7bo$f0u_at_debbie.cc.nctu.edu.tw>, <chiu_at_cc.nctu.edu.tw> wrote:
>Hi,
>
> I'm confused about how to make use the HOST function in SQL/FORM 3.0. Is it
>possible I can tell the result executed by HOST. For example, I want to check
>whether some file exists and write:
>
> :system.message_level := 25;
> HOST('ls file', NO_SCREEN);
> IF ERROR_CODE <> 0 THEN
> .......
> END IF;
>
> Why doesn't it work?
>
> Also if I write my own program which returns 0 or -1 to represent success and
>failure and executed by HOST function, is it possible I can tell the result
>according to the value returned by my program. If yes, how can I do?
>
>Thanks for your opinions!
>
>Keny Chiu
The following is a function I wrote to determine if a file name entered in a form exists. It is written for an Unix Operation System.
DEFINE PROCEDURE
NAME = file_exists
DEFINITION = <<<
/* Procedure: file_exists
Type: Oracle SQL*Forms V3.0
Author: Michael A. Rife
Purpose: Determine if the passed file exists
Parameters: A valid file name
Returns: Boolean TRUE or FALSE
Example
Invocation: If ! file_exists(bogus.file) Then
message('File does not exists');
bell;
raise Form_Trigger_Failure;
End If;
Modifications:
Date By Description
----------- ---------------- -------------------------------
06-APR-1994 Michael A. Rife Installed
*/
function file_exists (fn in char)
return boolean
is
return_code boolean;
begin
host('[ -r ' || fn || ' ]', NO_SCREEN);
if form_success then
return_code := TRUE;
else
return_code := FALSE;
end if;
return(return_code);
end;
>>>
Received on Sun Oct 23 1994 - 03:35:19 CET
