|
Hi everyone,--
The program that I currently updating contains the following SQL statement.
exec sql
DECLARE housesBefore CURSOR for
SELECT ALAJNB,
ALBHNB,
ALBFCD,
ALBGCD,
ALBKCD,
ALBLTX,
ALBMTX,
ALBNTX
FROM homrtv01
WHERE ((upper(ALBFCD) < :@AddrLoc) or
(upper(ALBFCD) = :@AddrLoc and
upper(ALBGCD) < :@Fraction) or
(upper(ALBFCD) = :@AddrLoc and
upper(ALBGCD) = :@Fraction and
upper(ALBKCD) <= :@Apartment)) and
upper(ALBHCD) = :@PreDirect and
upper(ALBITX) like '%' || trim(:@StrWord1) || '%' and
upper(ALBITX) like '%' || trim(:@StrWord2) || '%' and
upper(ALBITX) like '%' || trim(:@StrWord3) || '%' and
upper(ALBITX) like '%' || trim(:@StrWord4) || '%' and
upper(ALBITX) like '%' || trim(:@StrWord5) || '%' and
upper(ALBJTX) = :@City and
upper(ALBICD) = :@State and
ALBTST = ' '
ORDER BY upper(ALBFCD) desc,
upper(ALBGCD) desc,
upper(ALBKCD) desc;
exec sql open housesBefore;
dou sqlstt <> '00000';
exec sql
fetch housesBefore into :houseData;
if sqlstt = '00000';
The SQL statement works correctly, but I need to add additional
selection criteria information into it but I've been encountering
issues with the formatting of the select statement and was wondering
if there is a way through debug to see the actual SQL statement that
is being created so that I can determine where the formatting problem is so that I can fix it.
I'm using STRDBG command to view the variables in the program.
I've worked on SQLRPGLE programs where I've build the select statement
from scratch and then declared it to a cursor. For example:
Prepare sel from :selectStmt
Declare c1 cursor for sel
With this method I was able to debug my SQL statement that was built
by using the EVAL on the selectStmt variable.
Any help on how to display the select statement that is being built
without having to update the current program to move the select builds
into a variable would be appreciated.
Thank you
_____
Kimberly Fry
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.co
m_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPv
SZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=nF4xh9L
aPAffkNhxK79YQ2SWnU_dkdD2Zwocill7HPE&s=Dh38sRzpyJM5w40Qgv6MUR7PhQesAaA
ma3Rjqgwpk2E&e= or email: RPG400-L-request@xxxxxxxxxxxx Before
posting, please take a moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=nF4xh9LaPAffkNhxK79YQ2SWnU_dkdD2Zwocill7HPE&s=xRnaGYqdepCfAA2Dlz0UnZ5QuAhne9Ax5GgqOrT4a7Q&e=.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.c
om&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8
HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=nF4xh9LaPAffkNhxK79YQ2SWnU_dkdD2Zw
ocill7HPE&s=QLXqhYWPoPPMBHUkoAk5kD796-o9XiwK2Udab1vtL10&e=
As an Amazon Associate we earn from qualifying purchases.
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.