× 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.



Debugging SQL is always a challenge.  The debugger often positions you 
rather arbitrarily.

Do you know where it died?  On the PREPARE, the Declare, OPEN, or what? 
For instance if it is dying on the open then maybe you have
...
prepare S1 from :MyHostVar
...
Declare C1 cursor for S1
...
Open C1

Is this your layout?  If so, what is the content of MyHostVar from the 
debugger?

Rob Berendt
-- 
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





"Larry Ducie" <larry_ducie@xxxxxxxxxxx> 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
09/17/2004 10:47 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
rpg400-l@xxxxxxxxxxxx
cc

Fax to

Subject
Further trouble - now SQL (was Casting java objects in RPG -    problem 
solved)






Hi everybody,

I seem to be having one of those days!

Today I have been writing a RPGLE program to call java routines to convert 

xml into SQL insert statements. This program would then call a SQLRPGLE 
program to perform the database transactions.

Pgm1 contains the java calls and creates a SQL transaction in a stream 
file.

Pgm2 is a SQLRPG program that opens the stream file and reads it into a 
32k 
field. I then attempt to prepare the statement, ready to execute.

Now, I'm creating the file OK, but the prepare fails. That's fine - I 
didn't 
expect it to work first time. (I'm not exactly a SQL guru)

However, for some reason, the job just up and ends on me. This occurs 
while 
I'm debugging through the programs. Both programs are running in the same 
named activation group. We are on V5R2M0.

The joblog says (apologies for the verbose listing):

>From module . . . . . . . . :   QSQPREP
>From procedure  . . . . . . :   CLEANUP
Statement . . . . . . . . . :   10290
To module . . . . . . . . . :   QSQPREP
To procedure  . . . . . . . :   CLEANUP
Statement . . . . . . . . . :   10290
Message . . . . :   Token ; was not valid. Valid tokens: DECLARE.
Cause . . . . . :   A syntax error was detected at token ;.  Token ; is 
not 
a
  valid token.  A partial list of valid tokens is DECLARE.  This list 
assumes
  that the statement is correct up to the token.  The error may be earlier 

in
  the statement, but the syntax of the statement appears to be valid up to
  this point. Recovery  . . . :   Do one or more of the following and try 
the
  request again: -- Verify the SQL statement in the area of the token ;.
  Correct the statement.  The error could be a missing comma or quotation
  mark, it could be a misspelled word, or it could be related to the order 

of
  clauses. -- If the error token is <END-OF-STATEMENT>, correct the SQL
  statement because it does not end with a valid clause.
   17/09/04  11:13:32.502496  QUOCMD       QSYS        0193     QUOCMD  
QS
Message . . . . :  -dspjoblog
   17/09/04  11:15:03.422840  QUOCMD       QSYS        0193     QUOCMD  
QS
Message . . . . :  -dspmodsrc
   17/09/04  11:15:10.425136  QUOCMD       QSYS        0193     QUOCMD  
QS
Message . . . . :  -call xml2sql
   17/09/04  11:15:31.477192  QLEAWI       QSYS        *STMT    QLEAWI  
QS
>From module . . . . . . . . :   QLEPM
>From procedure  . . . . . . :   indicateCtorsCalled__Fv
Statement . . . . . . . . . :   1281
To module . . . . . . . . . :   QLEPM
To procedure  . . . . . . . :   indicateCtorsCalled__Fv
Statement . . . . . . . . . :   1281
Message . . . . :   Pointer not set for location referenced.
Cause . . . . . :   A pointer was used, either directly or as a basing
  pointer, that has not been set to an address.
   17/09/04  11:15:31.495352  QMHUNMSG     QSYS        0510     QMHUNMSG  
QS
Message . . . . :   Breakpoint processing not possible when unmonitored 
escape
  message occurred.
Cause . . . . . :   An escape message was not monitored while the job was
  executing some critical system function that could not be interrupted by
  breakpoint processing. A function check message (CPF9999) was sent and
  processing continued. Technical description . . . . . . . . :   The 
process
  was masked for events when the unmonitored message condition occurred.
  Breakpoint processing is not possible while the process is masked for
  events.
   17/09/04  11:15:31.529840  aicapgm                  000130   QLEAWI  
QS
To module . . . . . . . . . :   QLEDEH
To procedure  . . . . . . . :   Q LE leDefaultEh
Statement . . . . . . . . . :   231
Message . . . . :   Pointer not set for location referenced.
Cause . . . . . :   A pointer was used, either directly or as a basing
            Job Log                             ODIDEV   17/09/04 11:15:37
ADEV004X      User  . . . . . . :   XPED         Number . . . . . . . . . 
. 
.
DEVJD         Library . . . . . :   QGPL
V  DATE      TIME             FROM PGM     LIBRARY     INST     TO PGM  
LI
  pointer, that has not been set to an address.
   17/09/04  11:15:31.547360  aicapgm                  000130   QLEAWI  
QS
To module . . . . . . . . . :   QLETOOL
To procedure  . . . . . . . :   Q LE fatal_eh
Statement . . . . . . . . . :   610
Message . . . . :   Pointer not set for location referenced.
Cause . . . . . :   A pointer was used, either directly or as a basing
  pointer, that has not been set to an address.
   17/09/04  11:15:32.239568  QWTPITPP     QSYS        075C     *EXT
Message . . . . :   This job ended abnormally.
Cause . . . . . :   An error occurred that caused this job to end 
abnormally.
  Recovery  . . . :   See the previously listed messages in the job log 
for
  this job.  Correct the errors and try the request again.
   17/09/04  11:15:37.261632  QLIDLOBJ     QSYS        047E     QLICLLIB  
QS
Message . . . . :   Object XAD001 in QTEMP type *DTAARA deleted.
   17/09/04  11:15:37.267656  QLIDLOBJ     QSYS        047E     QLICLLIB  
QS
Message . . . . :   Object VOPODPA in QTEMP type *DTAARA deleted.
   17/09/04  11:15:37.272704  QLIDLOBJ     QSYS        047E     QLICLLIB  
QS
Message . . . . :   Object USRATR in QTEMP type *DTAARA deleted.
   17/09/04  11:15:37.277768  QLIDLOBJ     QSYS        047E     QLICLLIB  
QS
Message . . . . :   Object TP98GRP2 in QTEMP type *DTAARA deleted.
   17/09/04  11:15:37.282808  QLIDLOBJ     QSYS        047E     QLICLLIB  
QS
Message . . . . :   Object TP98GRP1 in QTEMP type *DTAARA deleted.
   17/09/04  11:15:37.287968  QLIDLOBJ     QSYS        047E     QLICLLIB  
QS
Message . . . . :   Object TOPGMLIB in QTEMP type *DTAARA deleted.
   17/09/04  11:15:37.293432  QLIDLOBJ     QSYS        047E     QLICLLIB  
QS
Message . . . . :   Object MUD001 in QTEMP type *DTAARA deleted.
  command). Recovery  . . . :   For more information, see the Work 
Management
  topic in the Information Center, http://www.iseries.ibm.com/infocenter.
   17/09/04  11:15:37.362040  QSPIERRS     QSYS        0028     QMHJLOG  
QS
Message . . . . :   Output queue changed to QPRINT in QGPL.
Cause . . . . . :   The output queue LOGKEEP in *LIBL that you specified 
does
  not exist. There may be an error in either the override statement or the
  device file definition or the job statement. The output queue to be used 

was
  changed to QPRINT in library QGPL. Recovery  . . . :   Use the OUTQ
  parameter to either correct the output queue name or change the library
            Job Log                             ODIDEV   17/09/04 11:15:37
ADEV004X      User  . . . . . . :   XPED         Number . . . . . . . . . 
. 
.
DEVJD         Library . . . . . :   QGPL
V  DATE      TIME             FROM PGM     LIBRARY     INST     TO PGM  
LI
  name.  If OUTQ(*JOB) is specified, use the WRKJOB command to determine 
the
  output queue name.

-----------------------------------------------------------------------------------------------------------------

Neither of my programs use pointers explicitly. I pass the address of a 
variable for my stream file read, that's all. Surely not enough to cause a 

job to crash.

The only other point to note is that I haven't freed my java object 
references prior to the call of the SQLRPGLE program. That code will be 
going in once I've got the programs working. Sigh...

Any help would be much appreciated. Even an example of a multiple insert 
transaction would be VERY helpful - get my prepare working. :-)

This is a very easy way to convert received xml into database data - once 
I've got it working I'll happily send the working code to anybody who'd be 

interested.

Cheers and TIA

Larry Ducie


--
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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.