1 (edited by TonyP 08-10-2007 17:46:47)

Re: XML Report Suceeded

Well I've been having some fun :( running SQL from SQLExpress as I can't install R6 [it won't install on my machine with SQL already installed]. I did get the query to run but it would only do it a bit at a time. I mean that I had to introduce a where clause to reduce the amount of time/data otherwise it would time-out. I did change all the variables for time, available to me, as specified on the MS Forums [thanks to Charles for spotting some for me] but it made no difference.

When I found so many problems with the output some of which I know are faults in R6 I felt I had to run the whole report in R6 to be sure that I do not introduce more errors myself. Being hugely concerned now that garbage in garbage out meant R6 could not be used for a primary function, namely the status of a species. I had to be sure to minimise the chance that all my 109 queries had not been the cause of further problems.

To do this I have to convert the SQL to XML. Now I do see the advantage in the long-term of XML but does that have to mean no SQL. I could not see any obvious help in creating these. I did find a link referring to the waste of space called the wiki, where I only see empty pages for subjects that have not been written and we cannot edit. More empty title pages would be even more useful :)
I tried to follow the examples supplied but it always complained about my where clause, I removed it. It complained. I put a comment in to remind me, it complained. Finally I put the whole query into the where clause of the XML and it works. My guess it that the <Where> clause is not used as one might think.

Phew I got the query to run in R6. 42,000 odd records returned. Export to XLS. Catastrophic Failure. Thanks. Right-click Export Data. Sorry there is no data to export [something like that]. I had to copy and paste. I must admit I was thinking I would have to do a screen dump of each page worth of results and OCR it just to get some useful output.

It's taken days of my time for something that takes a few minutes in R3. Sure a big chunk is learning curve but it still seems more doesn't work than does. I'm of course referring to the use of the data perspective here not data entry. My plan has always been to use SQL server to do the talking. I've not tried connecting to it using our Enterprise Manager but the experience I've had thus far does not bode well. More hair loss seems guaranteed. :)

I like the idea of XML. I've read a book or two on the subject with varying levels of success. They never seem to tell you what you need or fail to give enough examples. Time and experience will out. The complexity of R6 does not seem to lend itself to ease of use for data abstraction. No doubt I will be happier when I'm further down the learning curve road. Remember it may take 5 minutes to write a query but 30 or more to make sure you got what you wanted. If you're unsure you may have to write the inverse query or similar to confirm the first was correct.

Data Manger
Somerset Environmental Records Centre

2

Re: XML Report Suceeded

So, from your post I think what you'd like to see is much better documentation (particularly for XML Reports), more stability and more abstraction. I think there's great potential for including a set of views in the database by default for use by developers (of XML Reports). These views would abstract out some of the trickier things to do like obtaining all designations for  a taxon, getting a taxon group, taxon expansion (getting all taxa related to a given taxon) and so on.

I'm with you on the need for better documentation. XML Reports definitely need really comprehensive documenting in order for people to get the most out of it, although it should be made clear that one needs a good understanding of both the Recorder data model first AND a good knowledge of Transact-SQL in order to be able to make proper use. The XML part of XML Reports is actually the easy bit. In addition to documentation, it would be useful if lots more XML Reports were included with Recorder by default so that people can look at their source, deconstruct them and work out what makes them tick. I've pretty much nailed what XML Reports can do now, but more examples when I first started would have been invaluable.

Charles Roper
Digital Development Manager | Field Studies Council
http://www.field-studies-council.org | https://twitter.com/charlesroper | https://twitter.com/fsc_digital

3

Re: XML Report Suceeded

Yes indeed. Better documentation could be quite brief to start with. Some links to appropriate or helpful web sites even. I can usually find what I need eventually but most of us like a little pointing in the right direction. I notice that the help file has not changed for R6 in that area. Still referring to the R2002 menu. 'Run' executes previously stored query or similar.

I have to admit I'd not heard of Transact-SQL before. I can't even remember my SQL Server books referring to it. Being one of those that is still disappointed by 'Standard Query Language' not being standard from day one. I've been using MySQL for a number of years and the syntax differences between that and MS SQL have me going crazy. ISQL, Incompatible Standardish Query  Language is closer to the truth. Having said that the standard bit is loads better than what we had in the 70's & 80's - no standard :)

Yes examples are gold dust to developers. You can try alterations and see the bounds and test the creative limits. I thought of posting my effort of the day here until I realised it would easily disappear into the depths of the forum. My own site was my next thought as I already post code there from time to time. If only there was a wiki that we could use :)

I think the reporting using XML is limited only by your imagination and the limits of the model. If the model limits you XML / XLT it to another database and do it there. Well I hope that will work anyway. Back to that curve and some more XML though not in R6.

Data Manger
Somerset Environmental Records Centre

4

Re: XML Report Suceeded

SQL Server does support the entry-level ANSI SQL 92 standard, so you could stick to that (entry level is what most RDBMS's support). Transact-SQL (T-SQL) is just a value added dialect of SQL that allows you to take full advantage of SQL Server. In SQL Server 2005, T-SQL is now a Common Runtime Language (CLR) compliant language, which means it is a .NET language, hence you can use any of the .NET CLR languages such as C#, VB.NET or even Ruby, Python or Javascript to interact directly with the db, code functions and stored procedures. It's pretty powerful stuff.

Charles Roper
Digital Development Manager | Field Studies Council
http://www.field-studies-council.org | https://twitter.com/charlesroper | https://twitter.com/fsc_digital

5

Re: XML Report Suceeded

charlesr wrote:

it is a .NET language, hence you can use any of the .NET CLR languages such as C#, VB.NET or even Ruby, Python or Javascript to interact directly with the db, code functions and stored procedures. It's pretty powerful stuff.

Ooow makes me salivate just thinking about it. I notice that most just use the format Select... From... Where... in their reports when in fact While, Case, If then etc can be used. Meaning much more sophistication can be achieved. A full reference can be found Here

Data Manger
Somerset Environmental Records Centre

6

Re: XML Report Suceeded

I've a lot of sympathy for Tony. I've been doing the same trial and error thing with only the benefit of a knowledge of SQL acquired from Access & VBA and a familiarity with the data model. By trial and error I've managed a few things useful to me (see postings) but am a long way from feeling easy about attempting the next one.
We had a promising start in respect of learning about XML with the work that Mike Weideli did and I'd really like to see more of his expertise injected into this site. But like all of us he has his bread and butter to earn.
A couple of suggestions:
1. Club together for a bit of cash to pay Mike to produce something useful to us like a training guide and more worked examples
2. The NFBR is holding a Recorder Conference next March (instigated by Charles Copp) - perhaps those of us who play at XML could get together and have a workshop