Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot sort a row of size 8206

Status
Not open for further replies.

Madawc

Programmer
Sep 5, 2002
7,628
GB
This is the result I got when trying to write a report based on two tables in a database, each of which as a comment field of 7000 characters. It says the allowable maximum is 8094, and limiting the field to a more reasonable length for display does no good.

If I just show one of the super-size fields, this is OK. I actually got round it using a subreport that shows the other, which is OK because there are only a few thousand records in the database. But does anyone know a better solution, short of writing a Stored Procedure?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Most databases won't support such large sorts because doing so is VERY costly, and extremely rare.

Create a SQL Expression which makes for a reasonable field size, and then sort on that, such as:

substring(table.field,1,254)

A real need for something sorted beyond a length of 254 is VERY unusual.

If need be, you could create numerous SQL Expressions, but I think that would be overkill, 254 should do.

-k
 
Thanks. I'm not actually wanting to sort on the comment field: I should have made that clear. The rows would be sorted on the basis of a four-digit code, so I was expecting to be able to process the text data on that basis.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top