An SQL procedure is an ILE C program with embedded SQL. I posted an excerpt
from one of my courses that shows how to retrieve the ILE C source code. So
if you are debugging the SQL Proc, you might find it useful to have the C
source available also.

http://www.web400.com/downloads/Track1_Lab4_CS_NET_2010_71-75.pdf

Craig Pelkie

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary
Thompson
Sent: Tuesday, September 02, 2014 3:08 PM
To: Midrange Systems Technical Discussion
Subject: Re: testing an SQL procedure

Thanks again to Rob, Chuck and Buck.

Using embedded SQL I can now call the SQL proc and get the desired doc_num
returned.

out_loc = 'ABCD';
cto_num = 1234567;
bat_dat = 1140902;
doc_num = *Blank;
Exec SQL CALL mysqlproc (:out_loc, :cto_num, :bat_dat, :doc_num);

Setting Break Points in the SQL proc worked but I was surprised at the
number of F10-Step and F12-Resume key presses needed to run the proc ?

Next step is making the SQL proc query to get the library/schema name from
the out_loc input parm.

We have a local file which stores library by out_loc, but any hints on
coding this in an SQL proc will be very much appreciated.
(I'm reading 'Stored Procedures' and '7.1 Database SQL' pdf's)

One question I have is what exactly makes an SQL statement 'dynamic' ?

I recently saw a statement that changing a table name requires dynamic SQL,
and have thought for some time that using dynamic sql is more reliable when
switching libraries so that's been my habit for some time.


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