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



Buck,

Create a dynamic cursor:
exec sql
declare CURSOR1 cursor for cursor1select

and in your program create the dynamic cursor statement into
cursor1statement and then:
exec sql
prepare cursor1select from cursor1statement

jon

date: Thu, 30 Oct 2014 15:10:56 -0400
from: Buck Calabro <kc2hiz@xxxxxxxxx>
subject: Re: [WDSCI-L] Running SQL scripts

On 10/30/2014 2:56 PM, Jon Everton wrote:

Create a stored procedure using input parameters with the table and
schema name. Use the SQL function REPLACE to put your variables into
the SQL statement. Send me an email and I'll send you an example if
this rather poor explanation confuses you.

That's clear Jon, thanks. This thread is morphing into a discussion on
integrating Data Studio with RDi. Imagine you have an existing SQLRPGLE
program with a DECLARE CURSOR as below. You'd like to make some changes to
that SQL statement, what does one do?

Rectangle select, copy, tab to Data Studio, paste. Replace the host
variables with literals, test. Edit, test, repeat. When happy with the new
SQL statement, copy in Data Studio, tab to RDi, select, paste.
Adjust formatting. Save, compile, test. Forgot to replace literals, wonder
why program doesn't work. Replace literals with host variables.
Save, compile, test.

It's better than a sharp stick in the eye, but that's a low bar :-)



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.