× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have an SQL view that is basically doing the following, in addition to a bunch of other stuff:

SELECT
CASE WHEN (SELECT 1 FROM SYSIBM.SYSDUMMY1) IS NOT NULL
THEN 'I am awesome'
ELSE 'The computer has won' END
FROM SYSIBM.SYSDUMMY1

This was working fine until the subselect ended up being 2 rows such as this:

SELECT
CASE WHEN (SELECT 1 FROM SYSIBM.SYSDUMMY1
UNION SELECT 2 FROM SYSIBM.SYSDUMMY1 ) IS NOT NULL
THEN 'I am awesome'
ELSE 'The computer has won' END
FROM SYSIBM.SYSDUMMY1

This gives the following Message: [SQL0811] Result of SELECT more than one row.

It looks like I should be able to use an EXISTS predicate, but I can't seem to get that to work either.

SELECT
CASE WHEN EXISTS (SELECT 1 FROM SYSIBM.SYSDUMMY1)
THEN 'I am awesome'
ELSE 'The computer has won' END
FROM SYSIBM.SYSDUMMY1

This gives the follwing Message: [SQL0104] Token EXISTS was not valid. Valid tokens: <IDENTIFIER> <INTEGER> <CHARSTRING> <GRAPHSTRING>

Using IN didn't work either, giving the following Message: [SQL0115] Comparison operator IN not valid.

I'm not quite sure what else to try, any help would be appreciated. Thanks.

-Tom Stieger
California Fine Wire

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.