Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Querying the Collations table
Sat, Apr 5 2008 10:06 AMPermanent Link

Dan Rootham
EDB Manager ver 1.08 Build 1

This query works just fine:
 SELECT *
 FROM "Configuration"."Collations"
 ORDER BY "Name"

But this query produces an error:
 SELECT *
 FROM "Configuration"."Collations"
 ORDER BY "Description"

The error is:
[ ElevateDB Error #700 An error was found in the statement
at line 3 and column 10 (Expected Char, GUID, VarChar, . . . .
but instead found "Collations"."Description") ]

Is it caused by a typo that I can't see, or is it a bug?

Thanks,
Dan
Sat, Apr 5 2008 11:19 AMPermanent Link

Uli Becker
Dan,

But this query produces an error:
 SELECT *
 FROM "Configuration"."Collations"
 ORDER BY "Description"

This should work:

SELECT * FROM Configuration.Collations
order by cast(description as varchar(1))
Sat, Apr 5 2008 11:22 AMPermanent Link

"Ole Willy Tuv"
Dan,

<< The error is:
[ ElevateDB Error #700 An error was found in the statement
at line 3 and column 10 (Expected Char, GUID, VarChar, . . . .
but instead found "Collations"."Description") ]

Is it caused by a typo that I can't see, or is it a bug? >>

It's neither a typo nor a bug. The SQL standard doesn't allow LOB (large
object) types in the sort specification. The error message could be more
specific, but what it says is that a type different from CLOB or BLOB is
expected. I haven't checked it, but I'm pretty sure that the "Description"
column is of type CLOB.

You need to explicitly cast the CLOB column to CHAR or VARCHAR:

SELECT Name, CAST("Description" AS VARCHAR) "Description"
FROM "Configuration"."Collations"
ORDER BY "Description"

Ole Willy Tuv
Sat, Apr 5 2008 12:45 PMPermanent Link

Dan Rootham
Ole,

<< It's neither a typo nor a bug. The SQL standard doesn't allow LOB (large
object) types in the sort specification. >>

Oh boy, I obviously still have a lot to learn about this SQL standard.
Many thanks for the tip!

Regards,
Dan
Image