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



@Vernon, thanks for the suggestion. I will look into this.
@Birgitta, I was trying to avoid preparing the statement multiple times.
Once the statement is prepared the only thing that changes is the time
period.
So I run it once for a current timestamp range and then run it a second
time for a timestamp range in the past. Nothing else changes in the
prepared statement.
With the understanding that the prepared statement does not change once
created do you still recommend creating it each time?
@Sue, I wasn't aware of this. I will investigate this...

Happy New Years everyone.

Rob

On Thu, Dec 31, 2020 at 8:36 AM Sue Romano <slromano@xxxxxxxxxx> wrote:



We released an enhancement last May for 7.3 and 7.4 that allows you to use
a single OPEN statement for a situation like you describe. Using something
called extended indicators, you can mark host variables in the OPEN to be
ignored. It requires adding the SUBSET keyword to your OPEN and adding
indicator variables for the host variables that you want to control. See
this wiki page for details: https://www.ibm.com/support/pages/node/6174207

Sue Romano
Db2 for IBM i Development


Happy New Year to all.

I need to open a cursor but the number of parameter markers is not known
until run time.
I'm doing this right now with a SELECT statement in RPG but wondering if
this can be softcoded in some way. What I have is...

// We now need to open the statsCursor with the correct number of
parameter
markers
Select;
When fileCount = 1;
Exec sql
OPEN statsCursor USING :fromTs, :toTs;
When fileCount = 2;
Exec sql
OPEN statsCursor USING :fromTs, :toTs, :fromTs, :toTs;
When fileCount = 3;
Exec sql
OPEN statsCursor USING :fromTs, :toTs, :fromTs, :toTs, :fromTs,
:toTs;
Endsl;

Currently this is coded for 3 files, but this can easily be 10 or more
files at run time.

Do I have any other options for OPENing the cursor?

Thanks,

Rob

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.