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



Can't take full credit.

Found it in this presentation from John Valence
https://www.magic-ug.org/wp-content/uploads/2018/11/SQL_Stored_Procedures_and_SQL-PL_2018.pdf

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx
------------------------------

message: 5
date: Thu, 12 Aug 2021 20:52:05 +0000
from: Matt Olson via MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx>
subject: RE: Printing messages in a DB2 for IBMi stored procedure

That's smart! Thanks!

Matt

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Richard Schoen
Sent: Thursday, August 12, 2021 3:25 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: RE: Printing messages in a DB2 for IBMi stored procedure

This example allows you to output any return parameters in the ACS message list at the bottom of the Run SQL Statements screen.

--Sample Stored Procedure
CREATE OR REPLACE PROCEDURE
QGPL.SpOpPgmMsg
(
OUT msgvar varchar(255)
)
LANGUAGE SQL
MODIFIES SQL DATA
BEGIN

--DECLARE msgvar varchar(255);

set msgvar = 'I am a test message';

END
;

--Call sproc with ? for output parameter call QGPL/SpOpPgmMsg(?);

--This is what ACS shows
?Return Code = 0
Output Parameter #1 (MSGVAR) = I am a test message Statement ran successfully ? (152 ms)


Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.