Thx... I will probably be most comfortable doing it this way...
Thanks,
Jay Vaughn
Senior I5 Programmer/Analyst
RateWatch
(P) 251.633.8929
(F) 251.633.8929
www.rate-watch.com
-----Original Message-----
From: "Mark Keller" <Mark.Keller@xxxxxxxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Date: Mon, 20 Aug 2007 07:20:23 -0700
Subject: RE: "IF" CONDITION IN SQL STATEMENT
Perhaps using a dynamic statement instead of a static one? Define your
sql statement into a variable. You can use rpg logic to determine what
gets built into the statement. Then you can prepare a cursor over that
statement. Or exec immediate if it's producing only one result. See
documentation for more help, or if you want, I could post a bit of an
example.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jay Vaughn
Sent: Monday, August 20, 2007 7:13 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: "IF" CONDITION IN SQL STATEMENT
I want to include a test in my where clause only if a global variable is
set to a certain value... can this be done with embedded sql?
Thanks,
Jay Vaughn
Senior I5 Programmer/Analyst
RateWatch
(P) 251.633.8929
(F) 251.633.8929
www.rate-watch.com
--
This is the RPG programming on the AS400 / iSeries (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.