Three things which have come to light regarding CGI scripts.   See the example
below.  Not that the example uses WWW_QUERY_STRING because it generates the
result from a URL rather than a form (GET mechanism rather than POST).

(1) Putting a  SET DEFAULT WWW$SCRATCH:  near the top of the script will
    ensure all temporary files are put in the scratch directory with no
    risk of filling up the system disk.  This is particularly critical
    once people get onto running arc/info or other packages which generate
    temporary files in an almost random manner. Please all use this
    technique.

(2) The script below shows a technique
    we developed yesterday which seems to obviate the need for a spool file
    from Oracle.  As far as I can remember the only reason for spooling
    output was to use RTRSPACE to remove trailing spaces from the output.
    Prior to the most recent release of Oracle 7 padding spaces were added
    to both screen and spooled output.  This appear to no longer be the
    case and thus it is advantageous to simply direct the oracle output
    (which would normally go to SYS$OUTPUT) to NET_LINK via the ASSIGN
    statement.  I'll let you know if the spool file is required for
    some other reason of performance.  Without a spool file sending results
    back are very much faster (well OK it shaves another second or so off,
    but that's significant when 100 people are accessing your script at
    one time!).

(3) Following tests yesterday,  it appear that my assumption that once the
    </HTML> tag is sent up the line control is returned to the browser is
    wrong.  Thus any tidying up or clever processing done "at the end of
    the script" will still count in terms of the delay before the user
    sees what you have sent back to the browser.  That's a but of a pain.
    If people need to get to round this it might be possible to write some
    DCL which creates a temporary persistent sub-process which deal with
    these tasks,  or hive them off as a batch job, but its prob. not worth
    the hassle,  unless these will take more than a second or two to
    process.


$ wrtnet = "write net_link"
$ wrtnet "<DNETRECMODE>"
$ CGI_SYMBOLS "WWW_" "FORM_"
$ wrtnet "content-type: text/html"
$!wrtnet "content-type: text/plain"     ! Debugging
$ wrtnet ""
$ SET DEFAULT WWW$SCRATCH:
$
$ Oracle_lite
$ wrtnet "<HTML><HEAD><TITLE>Scotland: Council Details</TITLE></HEAD><BODY><HR>"
$ ASSIGN NET_LINK SYS$OUTPUT
$!SET VERIFY         ! Debugging
$ sqlplus -s user/pass @sys$input: 'WWW_QUERY_STRING'
SET VERIFY OFF
SET HEADING OFF
SET PAGESIZE 9999
PROMPT <H1>COUNCIL DETAILS</H1><HR>
COLUMN POPULATION FORMAT 999,999
COLUMN AREA FORMAT 9,999,999
select
'Name: <B>'||NAME,
'</B><BR>Principal Town: '||DECODE(MAJOR_TOWN, NULL, NAME, MAJOR_TOWN) TOWN,
'<BR>Population:' LABEL, POPULATION,
'<BR>Area (Hectares):' LABEL, AREA,
'<BR>Comments: '||DECODE(COMMENTS,NULL,'Currently Unavailable', COMMENTS) COMMENTS
FROM COUNCIL_AREAS
WHERE SEQNO = '&&1'
/
PROMPT <HR></BODY></HTML>
exit
$ exit




