×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.





Hi Mike
what's interesting is that BOTH fields are either changed or unchanged and
ONLY when its a N N combination
As you have posted only a portion of the sql statement, is it possible that
the case statements are NOT reached upon certain conditions?



Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill




Mike
<koldark@xxxxxxxx
m> To
Sent by: rpg400-l@xxxxxxxxxxxx
rpg400-l-bounces@ cc
midrange.com
Subject
Can anyone explain this?
01/12/2010 03:21
PM


Please respond to
RPG programming
on the IBM i /
System i
<rpg400-l@midrang
e.com>






I am working on an SQL statement with few CASE statements. I am getting
unexpected results.

Portion of SQL statement:
CASE C.ASTOCK WHEN 'N' THEN 'No' WHEN 'Y' THEN 'Yes' END,
CASE C.AFUEL WHEN 'N' THEN 'No' WHEN 'Y' THEN 'Yes' END,

Data before CASE added:
STOCK FUEL/OIL
PART IF Y PART IF Y
N N
Y N
N N
N N
Y N
Y N
Y N
Y N
Y N
Y N
N N
N N
Y N
Y N
Y N
Y N
N N
Y N

Data after CASE added:
CASE expression CASE express

No No
Y N
No No
No No
Y N
Y N
Y N
Y N
Y N
Y N
No No
No No
Y N
Y N
Y N
Y N
No No
Y N


Ever seen this before? Any ideas where to even start? We are migrating this
application data from the iSeries to a new system. I am trying to avoid
writing a program if possible.

--
Mike Wills
http://mikewills.info
P: (507) 933-0880 | Skype: koldark
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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.