Midrange News for the IBM i Community

Posted by: dougcmh
Columbus, OH
Host variables in Run SQL Scripts
has no ratings.
Published: 23 Nov 2011
Revised: 23 Jan 2013 - 4097 days ago
Last viewed on: 12 Apr 2024 (5504 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Host variables in Run SQL Scripts Published by: dougcmh on 23 Nov 2011 view comments(2)

I have a dumb question, but this has been plaguing me all morning.


I wrote a stored procedure (6.1, btw).

It has no result sets, but it does have some INOUT and OUT parms.

It is external - it calls an RPGLE program.


I wish to test the stored procedure now.

I am trying to test it in Run SQL Scripts.


My question - How, on God's glorious green globe, do I declare and use host variables in Run SQL Scripts?

Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: DaleB
Premium member *
Reading, PA
Comment on: Host variables in Run SQL Scripts
Posted: 12 years 4 months 21 days 7 hours 33 minutes ago

Umm .. you don't? I'm thinking your problem is that you need to pass the parms for the stored procedure itself. Lacking anything already in place, you need to create another stored procedure (read: test program) that doesn't really do anything but declare suitable variables for the parms and then CALLs your stored procedure.

Posted by: dougcmh
Premium member *
Columbus, OH
Comment on: Host variables in Run SQL Scripts
Posted: 12 years 4 months 16 days 12 hours 47 minutes ago
Edited: Mon, 28 Nov, 2011 at 09:05:33 (4519 days ago)

Actually, I ended up testing it from an RPG program (embedded SQL CALL statement) basically, what Dale said.

Why I didn't think of that earlier, I don't know.

Mind in holiday mode, I guess.