MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » September 2014

AW: testing an SQL procedure



fixed

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.







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact