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



Thanks Birgitta,
I never thought of using (?) for the return value, but it sounds like a great
time-saver for test/debug.

My next goal is to use parameter out_loc in the SQL proc as part of a query
to get the library needed for the query that returns doc_num. This need
is due to the 'database' we have where corporate data is stored in nine
'division' libraries. The ability to 'switch divisions' is implemented in several
SQLRPGLE apps, but is new to me in SQL procs.

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Birgitta Hauser
Sent: Tuesday, September 02, 2014 10:56 PM
To: 'Midrange Systems Technical Discussion'
Subject: AW: testing an SQL procedure

If you only want to test your stored procedure, i.e. check whether the output parameter returns the any (expected) value, you do not need a dynamic compound statement.
Just use parameter markers (?) as place holders in your call statement.

call swiretest/fsp975dn ('82 ',1140627,'4200', ?);

The return value is shown as message

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok) "What is worse than training your staff and losing them? Not training them and keeping them!"

-----Ursprüngliche Nachricht-----
Von: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Gary Thompson
Gesendet: Tuesday, 02.9 2014 18:57
An: Midrange Systems Technical Discussion
Betreff: testing an SQL procedure

Still trying to test my SQL procedure I created last week.
From Four Hundred Guru article
Dynamic Compound Statements in DB2 for i by Michael Sansoterra:
I'm trying to run the following from Run Sql Scripts:
BEGIN
DECLARE doc_num CHARACTER(11);
call swiretest/fsp975dn ('82 ',1140627,'4200',doc_num); END ; ; This results in:
SQL State: 42601
Vendor Code: -104
Message: [SQL0104] Token DOC_NUM was not valid.
This was run against our test partition which is V7R1M0, with "recent" PTF's I'm doing everything I can to avoid embedded SQL, wanting to learn the easier/faster way to create and test SQL procedures.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-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.