1 (edited by brianmiller 29-11-2007 09:14:27)

Re: Report Wizard Error Message

When we run the Report Wizard, Report about a place, Place names, Choose a site and include its subsites, Include all Taxon Info, Incl. all info, Select Sample Date, Sample Location, Taxon Common Name and Recommended Taxon Name we get the following error:

Exception occurred in application Recorder 6 at 28/11/2007 16:12:34.
Version : 6.10.4.120

Exception path:
EOleException : String or binary data would be truncated
TExceptionPath : An error occurred executing the following SQL:
UPDATE "#REPORT_OUTPUT" SET #REPORT_OUTPUT.[Recommended Taxon Name] = Index_Taxon_Name.Preferred_name FROM #REPORT_OUTPUT LEFT JOIN INDEX_TAXON_NAME ITN ON ITN.TAXON_LIST_ITEM_KEY=#REPORT_OUTPUT.LIST_ITEM_KEY AND ITN.SYSTEM_SUPPLIED_DATA=1 LEFT JOIN INDEX_TAXON_NAME ON INDEX_TAXON_NAME.TAXON_LIST_ITEM_KEY=ITN.RECOMMENDED_TAXON_LIST_ITEM_KEY AND INDEX_TAXON_NAME.SYSTEM_SUPPLIED_DATA=1

Last event\actions:
  actReportWizard invoked
  TfrmFilterResult created
  TfrmFilterResult activated
  TdlgWizard created

Operating System : Windows XP  5.01.2600  Service Pack 2
Physical Memory available : 1,038,404 KB

DLLs loaded:
  advapi32.dll (5.1.2600.2180)
  comctl32.dll (5.82.2900.2982)
  comdlg32.dll (6.0.2900.2180)
  gdi32.dll (5.1.2600.3159)
  HHCtrl.ocx (5.2.3790.2847)
  kernel32.dll (5.1.2600.3119)
  mpr.dll (5.1.2600.2180)
  MS5.Dll (5.0.0.12)
  MS5User.Dll (5.0.0.4)
  odbc32.dll (3.525.1117.0)
  ole32.dll (5.1.2600.2726)
  oleaut32.dll (5.1.2600.3139)
  shell32.dll (6.0.2900.3241)
  user32.dll (5.1.2600.3099)
  version.dll (5.1.2600.2180)
  winmm.dll (5.1.2600.2180)
  winspool.drv (5.1.2600.2180)

Information has been saved to the file R:\Recorder6\Program Files\Recorder 6 Server\LastError.txt

If we remove the Recommended Taxon Name the report works fine.

In actual fact when I choose a different site with subsites it does actually work fine... so this is a puzzle? Any ideas anyone please?

I assume this is a bug?... Perhaps not now...?

Thanks

Brian

Brian Miller
(Conservation Officer (Buckinghamshire), BBOWT)

2

Re: Report Wizard Error Message

Hi Brian

From the information you have posted it looks like the report is running into problems with particular entries in the Index_Taxon_Name table (hence when you remove the recommended name it is ok and if you do a report about a different site you also do not run into problems - because the site will have different taxon occurrences associated and therefore the query will be looking at different entries in the index_taxon_name table).

..I think ; )

If you have a spare min. could you try rebuilding the taxon name index and then re-running the report where you hit problems - are you still getting the unhandled error?

Many thanks,

Sarah Shaw
Biodiversity Information Assistant
JNCC

3

Re: Report Wizard Error Message

Hi Sarah,

Thanks for the info.

I have rebuilt the indexes, as I also ran the Dictionary update the other day. Having just tried it again I get exactly the same error message as before, even running it in different ways, also using xml reports.

Having done some further investigating by reporting using Taxon Name instead, I had a look to see if anything looked funny and one stood out: x Dactylodenia st-quintinii which is a cross: Fragrant x Common Spotted Orchid. Removing that in Additional Filters the report then runs okay, so this is the culprit.

So, is this species an error by not being in the ITN table, if it is not in there that is?

Cheers

Brian

Brian Miller
(Conservation Officer (Buckinghamshire), BBOWT)

4

Re: Report Wizard Error Message

Hi Brian

I've had a look at this and the problem appears to be taxon_list_item_key 'NHMSYS0001753843' - which is the recommended_taxon_list_item_key for x Dactylodenia st-quintinii.

The item_name for this taxon_list_item_key contains an '=' character - I think this is what is breaking the report wizard - I can reproduce your error here if I include a record of this taxon in a report.

I'm not sure that taxon names should really contain '=' (and this definitely causes problems for Recorder).

I'll raise this with the NHM.

Best wishes,

Sarah Shaw
Biodiversity Information Assistant
JNCC

5

Re: Report Wizard Error Message

Thanks Sarah,

Is this "=" something I could remove myself in the meantime or should I wait until an update if that is the result?

Cheers

Brian

Brian Miller
(Conservation Officer (Buckinghamshire), BBOWT)

6

Re: Report Wizard Error Message

Hi Brian

I would always advise against changing system-supplied dictionary entries (unless you are adding info via Recorder 6 in which case the information you add is flagged as non-system supplied).

The '=' character is in over 600 taxon names - we're currently discussing the problem with the NHM - the result will either be a dictionary update or a CCN so that Recorder 6 can deal with these (if possible).

I'll keep you updated.

Best wishes,

Sarah Shaw
Biodiversity Information Assistant
JNCC

7

Re: Report Wizard Error Message

Hi Sarah,  I have had a similar problem to Brians

When trying to report on a survey the following Error occured.

Exception occurred in application Recorder 6 at 17/12/2007 12:14:43.
Version : 6.10.4.120

Exception path:
EOleException : String or binary data would be truncated
TExceptionPath : An error occurred executing the following SQL:
UPDATE "#REPORT_OUTPUT" SET #REPORT_OUTPUT.[Taxon Latin Name] = Index_Taxon_Name.Preferred_Name FROM #REPORT_OUTPUT LEFT JOIN INDEX_TAXON_NAME ON INDEX_TAXON_NAME.TAXON_LIST_ITEM_KEY=#REPORT_OUTPUT.LIST_ITEM_KEY AND INDEX_TAXON_NAME.SYSTEM_SUPPLIED_DATA=1 WHERE #REPORT_OUTPUT.TYPE = 'T'

I have had this error many times when trying to report on large amount of data.

I managed to isolate it to one species name: Philadelphus coronarius x microphyllus x pubescens = P. x virginalis,
Taxon list Item Key NHMSYS0001753997

From your replies to Brian the = sign appears to be the problem can this not be substituted with a symbol that looks the same but is not an asci symbol. For example Times New Roman character unicode: 2550 which looks like this ═
It is unlikely that the NHM or BSBI will alter thier species data as the format for hybrids seems to be used universally.

Best Wishes

Keith


Keith Cunningham ( Volunteer )
Durham Biodiversity Data Service
Hosted by Durham Wildlife Trust

8

Re: Report Wizard Error Message

I've just run into this problem too. Ouch. I don't seem to be able to do any botanical reporting at all.

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

9

Re: Report Wizard Error Message

I've done some further research into this and I'm not so sure that the equals sign is to blame. I think the problem is to do with the length of the taxon name, which in the above example is 69 characters long. I've traced the SQL that generates the temporary #REPORT_OUTPUT and it looks like this:

SELECT Distinct Taxon_Occurrence.Taxon_Occurrence_Key AS Occurrence_Key, 'T' AS Type, Convert(char(16), null) collate SQL_Latin1_General_CP1_CI_AS as SURVEY_KEY, Convert(char(16), null) collate SQL_Latin1_General_CP1_CI_AS as SURVEY_EVENT_KEY, Convert(char(16), null) collate SQL_Latin1_General_CP1_CI_AS as SAMPLE_KEY, Convert(char(16), null) collate SQL_Latin1_General_CP1_CI_AS as LIST_ITEM_KEY , Convert(varchar(60), Null) Collate SQL_Latin1_general_CP1_CI_AS as [Taxon Common Name], Convert(varchar(60), Null) Collate SQL_Latin1_general_CP1_CI_AS as [Taxon Latin Name] into "#REPORT_OUTPUT" From ((((((Taxon_Occurrence LEFT JOIN Sample ON Taxon_Occurrence.sample_Key = Sample.Sample_Key ) LEFT JOIN Taxon_Determination ON Taxon_Determination.Taxon_Occurrence_Key = Taxon_Occurrence.Taxon_Occurrence_Key ) LEFT JOIN Survey_Event ON Survey_Event.Survey_Event_Key = Sample.Survey_Event_Key ) LEFT JOIN Index_Taxon_Name ITN ON (ITN.Taxon_List_Item_Key = Taxon_Determination.Taxon_List_Item_Key and ITN.System_Supplied_Data=1) ) LEFT JOIN Index_Taxon_Name ITN2 ON ITN.Recommended_Taxon_List_Item_Key=ITN2.Recommended_Taxon_List_Item_Key ) LEFT JOIN Taxon_List_Version TLV ON TLV.Taxon_List_Version_Key = ITN2.Taxon_List_Version_Key ) LEFT JOIN Taxon_List TL ON TL.Taxon_List_Key = TLV.Taxon_List_Key WHERE TL.Taxon_List_Key = 'NHMSYS0000436459' AND ((SURVEY_EVENT.VAGUE_DATE_START >= 38353 AND SURVEY_EVENT.VAGUE_DATE_END <= 39082))

Note where it says:

Convert(varchar(60), Null) Collate SQL_Latin1_general_CP1_CI_AS as [Taxon Latin Name]

It also does this for [Taxon Common Name]. This is just a clever way of creating an empty field called [Taxon Latin Name] in #REPORT_OUTPUT using SELECT INTO. The important bit is the varchar(60). When the report wizard code then tries to insert a 69 character string into a 60 character field, it blows up, hence the "String or binary data would be truncated" error.

There are 74 rows in TAXON containing ITEM_NAMEs >60 chars, including our friend Gymnadenia conopsea x Dactylorhiza fuchsii = X Dactylodenia st-quintinii

I did actually replace all of the equals signs in TAXON.ITEM_NAME with tildes (~) and the problem remained (after rebuilding the index), which led me onto this further research. I've changed them back now. For now the only work around I can think of is to locate any records that point at taxa with names >60 chars and temporarily uncheck them. I've not tried this yet. That's for tomorrow...

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

10

Re: Report Wizard Error Message

BTW, here's how to pull a list of all of the problem taxa:

USE [NBNData]
GO

SELECT *
FROM [TAXON]
WHERE LEN([ITEM_NAME]) > 60
Charles Roper
Digital Development Manager | Field Studies Council
http://www.field-studies-council.org | https://twitter.com/charlesroper | https://twitter.com/fsc_digital

11

Re: Report Wizard Error Message

I just tested this theory using the taxon Ctenophthalmus nobilis subsp. nobilis x nobilis subsp. vulgaris and it does indeed cause the Report Wizard to crash.

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

12

Re: Report Wizard Error Message

Here's a work around to this problem, but please only do this if you really know what you're doing otherwise you could corrupt your database. As always back up first. With that disclaimer out of the way, here's what I did.

First I created a query to find all occurrences that have a taxon name greater than 60 characters in length.

USE [NBNData]
GO

SELECT
    [itn].[ACTUAL_NAME],
    [itn].[COMMON_NAME],
    [itn].[PREFERRED_NAME],
    [txo].[TAXON_OCCURRENCE_KEY],
    [txo].[CHECKED]
FROM
    [INDEX_TAXON_NAME] AS itn
INNER JOIN
    [TAXON_DETERMINATION] AS txd ON
    [itn].[TAXON_LIST_ITEM_KEY] = [txd].[TAXON_LIST_ITEM_KEY]
INNER JOIN
    [TAXON_OCCURRENCE] AS txo ON
    [txd].[TAXON_OCCURRENCE_KEY] = [txo].[TAXON_OCCURRENCE_KEY]
WHERE
    LEN(itn.[PREFERRED_NAME]) > 60

In my case, the rogue taxon was the Leyland Cypress Cupressus macrocarpa x Xanthocyparis nootkatensis = X Cuprocyparis leylandi.

I then did an UPDATE query to uncheck just those records:

USE [NBNData]
GO

UPDATE
    [TAXON_OCCURRENCE]
SET
    [CHECKED] = 0
FROM
    [INDEX_TAXON_NAME] AS itn
INNER JOIN
    [TAXON_DETERMINATION] AS txd ON
    [itn].[TAXON_LIST_ITEM_KEY] = [txd].[TAXON_LIST_ITEM_KEY]
INNER JOIN
    [TAXON_OCCURRENCE] AS txo ON
    [txd].[TAXON_OCCURRENCE_KEY] = [txo].[TAXON_OCCURRENCE_KEY]
WHERE
    LEN(itn.[PREFERRED_NAME]) > 60

This simply unticks the records in Recorder. You can re-tick them again at a later date by changing the [CHECKED] = 0 to [CHECKED] = 1.

I'm now no longer getting the crash in the Report Wizard.

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

13

Re: Report Wizard Error Message

Hi Charles

Many thanks for looking into this and discovering the true cause of the problem!

Speaking to John from Dorset Software this is relatively trivial and we can provide a fix for this in the next version (via an update script).

In the mean time however if you have Enterprise Manager or Management Studio you can run the following script - note this fix has not been thoroughly tested yet and you should back up your database before proceeding;

UPDATE Report_Field SET Field_Size=75 WHERE Report_Field_Key IN
('NBNSYS0000000070', 'NBNSYS0000000071', 'NBNSYS0000000073')

UPDATE Report_Field SET Field_Size=80 WHERE Report_Field_Key IN
('NBNSYS0000000072')

You should now be able to run the report/s that were previously failing (I've just done a quick check and seems ok).

Please let me know how you get on.

Best wishes,

Sarah Shaw
Biodiversity Information Assistant
JNCC

14

Re: Report Wizard Error Message

Hi Sarah,

Thanks for this work around. However, when I did it I still had the same error come up. This was because the field size on the Recommended Taxon Name was still set to 60. Changing it to 75 as for the others then worked. Therefore the code should probably be:


UPDATE Report_Field SET Field_Size=75 WHERE Report_Field_Key IN
('NBNSYS0000000070', 'NBNSYS0000000071', 'NBNSYS0000000073', 'NBNSYS0000000094')

UPDATE Report_Field SET Field_Size=80 WHERE Report_Field_Key IN
('NBNSYS0000000072')

Many thanks

Brian

Brian Miller
(Conservation Officer (Buckinghamshire), BBOWT)

15

Re: Report Wizard Error Message

Thanks Brian, you are absolutely right. I'd missed that one.

John van Breda
Biodiverse IT