Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Union / CLOB SQL Error
Wed, Dec 17 2008 12:12 PMPermanent Link

Greg Bishop
Using EDB 2.02 B5 (Unicode) with Delphi 2009 Pro

When I execute the following SQL, it works fine:

SELECT ContactID, Name, Comments,
 True AS Flinstone FROM Contact
WHERE Code = 'F'

But, when I execute this code, I get an error:

SELECT ContactID, Name, Comments,
 True AS Flinstone FROM Contact
WHERE Code = 'F'
UNION
SELECT ContactID, Name, Comments,
 False AS Flinstone FROM Contact
WHERE Code <> 'F'

The error I'm getting (from EDB Manager) is:

ElevateDB Error #700 An error was found in the statement at line 5 and column 25 (Expected Char, GUID, VarChar, Byte, VarByte, Boolean,
SmallInt, Integer, BigInt, Float, Decimal, Date, Time, Timestamp, Interval Year, Interval Year To Month, Interval Day, Interval Day To Hour,
Interval Day To Minute, Interval Day To Second, Interval Day To MSecond, Interval Hour, Interval Hour To Minute, Interval Hour To Second,
Interval Hour To MSecond, Interval Minute, Interval Minute To Second, Interval Minute To MSecond, Interval Second, Interval Second To
MSecond, or Interval MSecond expression but instead found "Comments")

Note that "Comments" is a CLOB field.

If I execute this SQL (without "Comments"), it works fine:

SELECT ContactID, Name,
 True AS Flinstone FROM Contact
WHERE Code = 'F'
UNION
SELECT ContactID, Name,
 False AS Flinstone FROM Contact
WHERE Code <> 'F'

Is this a bug or am I missing something?

Thanks in advance.
Wed, Dec 17 2008 12:16 PMPermanent Link

Greg Bishop
See also "EDB CLOB Test" in the binaries newsgroup for a simple test database.
Wed, Dec 17 2008 12:35 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Greg,

<< Note that "Comments" is a CLOB field. >>

You can't use BLOB/CLOB columns in a UNIONed statement.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Dec 18 2008 12:51 AMPermanent Link

"Greg Bishop"
Thanks, Tim.  I didn't realize that.

Image