|
I changed it to use RPG IO simply due to project dead line. SQL
is wonderful when it works. But when it goes wrong like the one
I see, it becomes a blackbox and is hard to figure out.
Here are some more detail regarding the MCH0601 (Let me know if
you need other info):
1) These blow of SQL codes are running in a Service program.
2) The compiler listing looks like below:
//---------------------------------------------------------
// copy the EMAILMSG member to a temporary note file in IFS
//---------------------------------------------------------
begsr cpyEmailMsgMbrToNoteFileInIFS;
//create a temp work file QTEMP/SVRMLTMP, to house message
//-------------------------------------------------------
//**** sql
//****rop table QTEMP/SVEMLTMP;
/END-FREE
C Z-ADD 4 SQLER6
C CALL SQLROUTE
C PARM SQLCA
/FREE
//**** sql
//****reate table QTEMP/SVEMLTMP
//**** (TEXT VARCHAR (1000 ) NOT NULL WITH DEFAULT);
/END-FREE
C Z-ADD 5 SQLER6
C CALL SQLROUTE
C PARM SQLCA
/FREE
//copy the EMAILMSG member to a temp work file
//------------------------------------------------------
myCmd = 'OVRDBF FILE(EMAILMSG) TOFILE(EMAILMSG) MBR(' +
%trim(piMbr) + ') OVRSCOPE(*CALLLVL)';
qcmdexc(myCmd :%len(%trimr(myCmd)));
//**** sql insert into QTEMP/SVEMLTMP
//**** select rtrim(SRCDTA) FROM EMAILMSG;
/END-FREE
C Z-ADD 6 SQLER6
C CALL SQLROUTE
C PARM SQLCA
/FREE
3) The relevent joblog looks like below:
ODP created.
Blocking used for query.
Cursor SQLCURSOR000000003 opened.
1 rows fetched from cursor SQLCURSOR000000003.
1 rows fetched from cursor SQLCURSOR000000003.
1 rows fetched from cursor SQLCURSOR000000003.
1 rows fetched from cursor SQLCURSOR000000003.
1 rows fetched from cursor SQLCURSOR000000003.
Space offset X'0003F1D3' or X'0000000000000000' is outside
current limit for object MSRL3G343APALHC 345777.
<<SNIP two more mch0601>>
1 rows fetched from cursor SQLCURSOR000000003.
<<SNIP 3 more rows fetched with similar mch0601 symptoms>>
ODP deleted.
Cursor SQLCURSOR000000003 was closed.
DESCRIBE of prepared statement SQLSTATEMENT000003 completed.
PREPARE of statement SQLSTATEMENT000003 completed.
Drop of Q0T467 in QTEMP complete.
4) When I press F1 then F9 on the MCH0601, I got below:
Message ID . . . : MCH0601 Severity . . : 40
Message type . . . . . : Diagnostic
Date sent . . . : 05/14/10 Time sent . . : 08:25:31
Message . . : Space offset X'FFFFB13E' or
X'0000000000000000' is outside current limit for
object MSRL3G343APALHC 345777.
Cause . . : A program tried to set a space pointer,
tried to use storage outside a space, or tried to use
an unallocated page in teraspace.
The space class is X'04'. The space class designates the
type of space: <<SNIP 00 to 03>>
04-implicit process space for heap identifier X'00000000'
in activation group mark X'0000000000000000'.
Message ID . . . : MCH0601 Severity . . : 40
Date sent . . . : 05/14/10 Time sent . . : 08:25:31
Message type . . . . . : Diagnostic
From . . . . : PALHC CCSID . . . : 65535 From program . . . . . . . . . : bzeroeao_Gennaker
Instruction . . . . . . . . : 00000C
To program . . . . . . . . . . : QCPEXPRT
To library . . . . . . . . . : QSYS
To module . . . . . . . . . : QCPEXPRT
To procedure . . . . . . . . : Copy_The_Records
To statement . . . . . . . . : 482
"CRPence" wrote:
So are the message details for the SQL cursor, SQL FETCH, and MCH0601 a secret, or does the /circumvention/ by avoiding the
SQL just render that issue moot, such that there is no longer
any interest in knowing what might have been the problem?
Lim Hock-Chai wrote:
These code are running in a service program. Not sure if this
would place a role in the problem. But anyway, I replaced that
whole sections of code with RPG IO and it works fine now.
Here is the RPG replacement version:
//create a temp work file, QTEMP/SVRMLTMP,
// to house the message
//------------------------------------------------
myCmd = 'DLTF FILE(QTEMP/SVEMLTMP)';
callp(e) qcmdexc(myCmd :%len(%trimr(myCmd)));
myCmd = 'CRTPF FILE(QTEMP/SVEMLTMP) RCDLEN(300)';
qcmdexc(myCmd :%len(%trimr(myCmd)));
open SVEMLTMP;
//copy the EMAILMSG member to a temp work file
//-------------------------------------------------
myCmd = 'OVRDBF FILE(EMAILMSG) TOFILE(EMAILMSG) MBR(' +
%trim(piMbr) + ') OVRSCOPE(*CALLLVL)';
qcmdexc(myCmd :%len(%trimr(myCmd)));
open EMAILMSG;
setll *start EMAILMSG;
read EMAILMSG myMsgRec;
dow not %eof();
mySVEMLTMP.data = myMsgRec.srcdta;
write SVEMLTMP mySVEMLTMP;
read EMAILMSG myMsgRec;
enddo;
close SVEMLTMP;
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.