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



Elvis,
What you suggest runs ok in iNav 'Run SQL Scripts', but *does not*
invoke the debugger.

What am I missing? Is there a way to STRDBG PGM(xxx) from iNav?
Page 45 of the below mentioned redbook states
"return to your iSeries session and issue the following SQL CALL
statement using either RUNSQLSTM command or interactive SQL"

I am assuming that "interactive SQL" is the iNav 'Run SQL Scripts' or
any SQL-agent/client such as dotNET.


Also note that I created multiple TEST_DBG stored procedures just with
different SPECIFIC NAMES for overloading purposes.

So, calling it from 'Run SQL Script' in iNav, I can call :
SET PATH = AMFLIB;
CALL TEST_DBG(1300);

The stored proc grammar is incomplete at this point, I need to get this
debugger running 1st.

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Elvis Budimlic
Sent: Tuesday, June 30, 2009 1:27 PM
To: 'Midrange Systems Technical Discussion'
Subject: RE: Debugging Stored Procedures

That is not how you invoke stored procedures but rather programs. Your
(SQL)
call should look something like:

CALL AMFLIB/TEST_DBG_2(13000);

There is nothing wrong with using a literal (13000) as an input value in
your testing.
You are using the right tool for testing.

For the output parameter testing, you may try specifying a question mark
as
a literal (?).

BTW, you're declaring a result set as being returned yet you don't open
a
cursor in your SP. Or is there some code missing (i.e. copy/paste
error)?

Finally, as is always the case when something is failing with iNav, make
sure you have the latest iSeries Client Access service pack loaded on
your
system and propagated to your PC, per this link:

http://www-912.ibm.com/s_dir/slkbase.nsf/recommendedfixes


Hth, Elvis

Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
OS/400
www.centerfieldtechnology.com


-----Original Message-----
Subject: Debugging Stored Procedures

I've been trying to get the debugger up and running per section 3.10.1
of http://www.redbooks.ibm.com/abstracts/sg246503.html.

I have been successful at stepping through stored procedures with no
parameters, however when calling a stored proc with an IN parm of
Integer type, the debugger throws an exception on the first line of the
stored procedure:

"Exception: Pointer not set for location referenced"

This is how I call the stored procedure:

CALL PGM(AMFLIB/TEST_DBG_2) PARM(13000)

Also, how would I call a stored procedure with IN and OUT parms from the
console?



Procedure:

CREATE PROCEDURE AMFLIB . TEST_DBG ( IN CUSTNUMBER INTEGER ) RESULT SETS
1 LANGUAGE SQL SPECIFIC TEST_DBG_2 READS SQL DA

SOURCE

BEGIN

DECLARE TOTALACTIVITY DECIMAL ( 8 , 3 );

SELECT SUM ( JQGLVA ) INTO TOTALACTIVITY FROM AMFLIB . MTHACTE WHERE
CUSNO = CUSTNUMBER;

END;



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.