SQLHelpAndPrototpes XML File

 


You can add to or change the syntax skeletons and function prototypes provided with SQLThing by editing the SQLHelpAndPrototypes.XML file found in the SQLThing installation directory.  This XML file contains all of the function tool tips and syntax skeletons that appear in SQLThing.  When SQLThing first starts execution, it parses the XML file and creates the data structures for the dynamic tool tips and syntax pop-ups. If you edit the XML file, SQLThing will not recognize your new syntax until the next time it starts.  Always keep a backup copy of the XML file in case you want to return to a previous version of the grammar.

Prototypes XML File Structure

The top of the XML file has the standard XML document information and then begins with an SQLThing tag.  All information is enclosed in this tag.  The document then has two sections separated by tags.  The first section is tagged Scalars and contains information on all of the DB2 scalar functions.  You might want to add to this section to define any user defined functions that you have on your system. Here is an example function definition:

<Function name="ABS" args="1">
            <Class>Numeric</Class>
            <Tooltip>ABS(expression) as Number</Tooltip>
            <Help>Returns the absolute value of the expression.</Help>
      </Function>

The Class tag allows you to place a function into a category that is then used by the formula window to segregate the function list.  The Tooltip tag allows you to specify the contents of the tool tip that should be displayed when prompting for function values. The Help tag allows you to specify additional help text that is not used at this time.

The next section of the file is delimited by the <SynHelp> tag and contains all of the skeletons.  Each of the syntax skeletons that can be used during program runtime are delimited by the Skel tag.  Here is an example tag that defines a skeleton for the If Then Else clause:

<Skel tag="IF THEN ELSE">
IF {cond}
      THEN {s} ;
      ELSE {s} ;
END IF;</Skel>

The Skel tag lets the parser know that a skeleton is beginning and then tag value, (in the example the string “IF THEN ELSE”) is what will be displayed as a description of this skeleton.  If the user selects this skeleton, any information between the Skel tags will be rendered into the editor as is.  Since we preserve white space when parsing the XML document, you will always see SQLThing render the skeleton text exactly as it was entered.