|
I'm fetching for a cursor declared using two files with a left outer join.
What this means is I want to see all the records in the first file and
lookup a value in the second file. The key field that is used to lookup a
record in the second file may not exist in the second file, which should
return a null value according to IBM's SQL manual. This works great in
interactive SQL but when fetching these records where there isn't a match
in the second file I get back an SQLCOD='-0305' which is something about a
null value without an indicator. And it doesn't retrieve the values for
the first file so I can't ignore the error. Any advice as to what I might
need to do here? Hopefully the code I've pasted in here is readable by
your viewer.
C/EXEC SQL
C+ DECLARE CURS1 CURSOR FOR
C+ SELECT EMDUSR, EMDTFC,
C+ EMDSEQ, EMDCLS, EMANAM, EMAADR
C+ FROM EMAILFDST LEFT OUTER JOIN EMAILFADR
C+ ON EMDUSR=EMAUSR AND
C+ EMDSEQ=EMASEQ
C+ WHERE EMDUSR<>'' AND
C+ EMDFIL=:EMGGRP AND
C+ EMDCMP=:EMGCMP AND
C+ EMDFAC=:EMGFAC
C+ ORDER BY EMDUSR
C/END-EXEC
....OPEN CURSOR and stuff
C/EXEC SQL
C+ FETCH CURS1 INTO
C+ :EMDUSR, :EMDTFC, :EMDSEQ, :EMDCLS, :EMANAM, :EMAADR
C/END-EXEC
As an Amazon Associate we earn from qualifying purchases.
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.