×
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 am trying to build a generic way to do fetches on sql joins without
defining all the variables over again. Want to do a -fetch into- a
qualified data structure which has all the fields in the join. (the real
program uses most of them). Can't build a join logical file because the
fields in the files don't match.
Program below
D
D* DATA STRUCTURE FOR SQL field definitions
D pomtpfds E DS EXTNAME(pomtpf)
D pomhpfds E DS EXTNAME(pomhpf)
D pdlcpfds E DS EXTNAME(pdlcpf)
D
D T ds QUALIFIED
D pomtpfds2 LIKEDS(pomtpfds)
D pomhpfds2 LIKEDS(pomhpfds)
D pdlcpfds2 LIKEDS(pdlcpfds)
D
D STRING S 512
C
/FREE
STRING = 'SELECT * FROM POMTPF LEFT OUTER JOIN POMHPF ON PONUM = PMNUM +
LEFT OUTER JOIN PDLC ON POPDL = IAPDL AND +
DEC(SUBSTR(DIGITS(PONUM),1,2)) = IALOC +
WHERE PONUM = 1 ORDER BY POVEND, PONUM, POLINE';
/END-FREE
C
C*
C/EXEC SQL
C+ prepare p1 from :string
C/end-exec
C*
C/EXEC SQL
C+ declare c1 cursor for p1
C/end-exec
C*
C/EXEC SQL
C+ open c1
C/end-exec
C*-------------------------------------------------------------------
C*
c*---------------------------------------------------------------
C* example of sql fetch
C/EXEC SQL
C+ fetch c1 into :T
C/end-exec
This mailing list archive is Copyright 1997-2025 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.