1

Re: Where keytype=\

Are there some restricions on where "where keytype" can be placed in an XML report and what they can contain?

Do conditions have to be within a "where keytype"?

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

2

Re: Where keytype=\

The Where ( keytype)  tag  is within the SQL Tag and the Condition tag within the Where tag.   

When the report is run, contents within the <Where> tag are evaluated and added to any SQL which is within the <SQL> tag, but not within a <Where> tag. The important point is that SQL within a <Where> tag does not have to be simply a WHERE clause. They can contain a range of SQL including creating and populating temporary tables. If <Condition> tags are placed within this SQL they will be evaluated where they are placed. This means that <Condition> tags can be used to derive the WHERE clauses used to populate or update temporary tables. They can also be coerced into populating temporary tables with user entered parameters which can then be used in UDF'.s (see UDF' and Parameters)

A new feature in V6.13 allows the <Where> clause to be used more than once. This is done by placing {WHERE} at the points where the statement is required. It is mainly intended for Batch Updates and would only be of value in XML reports in a situation where a temporary table and the final Select statement needed the same WHERE clause.

In a simple XML report or batch update the main SQL can appear just once and different 'SQL Where clauses' specified with Condition tags within the Where keytype tag. These will then be added to the main SQL clause.  This doesn't work when the SQL gets complex and the SQL and the Condition will need to be specified in full within each Where keytype tag.

Mike Weideli

3

Re: Where keytype=\

Thanks Mike,

MikeWeideli wrote:

the Condition tag within the Where tag.

Ahh there must be where I'm falling down. I'd like to have a "common condition", which shows up regardless whether the keytype is samplesinpolygon, default etc. rather than have to duplicate it.

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership