This program is used to allow interactive acces to/from the Statistics

It sits on a TCP Port - normally 9150 - waiting for XML-like requests which it
then parsed, hits the database and returns the data.

It can be used for either Sybase or MicroSoft SQLserver databases.

A parameter file for Sybasy sort of things is held in tables/stats and defaults

Keywords for STATSVR parameter file are :
    ; comment line
    user: sybase user name
    passwd: Sybase passwd
    server: Sybase server name

Input Switches (all optional) :
    -l : log requests and connections   default: no
    -n : optional name for logging      default: stat
    -P : Port no to receive messages on default: 9150
    -v : print version number and quit  default: no

---- Notes ----

Return Codes

Ok - in the range 200-299

211 - Read complete
212 - Filter returns nothing
221 - Store complete
231 - Directory List complete

errors - in the range 400-499   

general errors
401 - Nothing !
402 - No Action Specified
403 - No Logon Specified
404 - Password Incorrect
405 - Unknown Action Specified
406 - Timeout - incomplete Token

411 - No SQL Specified
412 - No DataBase Specified

TagWrapper is FIPSQL
Action is always SQL
Logon and Password - ok
DataBase - need even if 'master'
CMD - sql - must have
maxrows - defaults to all (0)
formatlength - only if you have a Output format template
leavespaces/ - normally leading and trailing spaces are stipped from all fields
except TEXT/BINARY, use this to preserve.
nochrtranslate/ - do not translate '<>&;' into &gt; etc

The Format template is applied to each row of data.
It is a FipSeq string like 

    Name is \FA, Title \FB, as at \$d-\$m-\$e\$y\n

Each database field is stuffed in a FipHdr field starting FA.
So  FA holds the first field
    FB the second 
    FZ the twenty sixth
**Text and Binary which should be one and only field are left WITHOUT

Exmaple : 

<?xml version="1.0">

Database is \FA, Size \FB, Owner \FC, Id \FD, Date \FE\n\t\tOptions \FF as at

<?xml version="1.0">

    <CMD>select * from MATCHPLAYERS where Name = "Owen"</CMD>
Name is \FA, Title \FB, No of Goals Scored: \FC (correct to \$d-\$m-\$e\$y)\n

Return is
Label.ASV-CDAJA5195-Hits of '30-72-0-0-1-Mid--0-0-
... data up to 7527 bytes

(copyright) 2017 and previous years FingerPost Ltd.