Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Delivered
Workspace IBM i
Categories IBM i Access Family
Created by Guest
Created on Jul 24, 2019

Allow prompt variables in Run SQL Scripts

Add prompt variables to queries that run in the Run SQL Scripts application.
This would allow generic queries to be reused for specific results. The Run SQL Scripts application would need a mechanism for entering the substitution variable data when the user runs the query.
I would expect this to work similar to how it works in MS Excel / MS Query.
If possible, it would also be a benefit to assign values to global variables using such prompting. Those global variables could then be re-used in multiple query statements.


Use Case:

Type a query in Run SQL Scripts and use either a question mark (?) or square brackets enclosing a prompt string to denote substitution variables that would be prompted for at run time.
For example, a query to show user profile info for a select user...
SELECT authorization_name,
text_description,
date(creation_timestamp) as create_date,
date(last_used_timestamp) as last_used,
date(previous_signon) as last_signon,
sign_on_attempts_not_valid,
status,
date(password_change_date) password_changed,
set_password_to_expire,
user_default_password
FROM QSYS2.USER_INFO ui
where
authorization_name = [User ID]
;
A prompt would appear asking for a "User ID".
You could also use a question mark for the substitution variable place holder. This query could then be copied into an application where you could use the embedded capabilities to specify substitution variables.

SET mylib.myvar = [prompt text];

select *
from mylib.mytable
where field1 = mylib.myvar;

select *
from mylib.mytable2
where fieldx = mylib.myvar;


Idea priority Medium
  • Guest
    Reply
    |
    Jan 17, 2024

    Bracket Support has not been implemented.
    Support for parameter markers ? (question mark) and support for host variable names (:somevarname) where added with 1.1.9.2

  • Guest
    Reply
    |
    Apr 14, 2023
    This feature is in version 1.1.9.2 which is now available.
  • Guest
    Reply
    |
    Mar 29, 2023
    This is planned for our April 2023 update.
  • Guest
    Reply
    |
    Nov 29, 2021

    Thank you for submitting your Request For Enhancement. After evaluating and prioritizing this request, we cannot deliver your requested enhancement in the near future, so it is being declined. However, we understand the value of this request, so it will be added to an internal list for future consideration.

  • Guest
    Reply
    |
    Jun 25, 2020

    IBM understands this request and will consider it for a future code update, though no commitment is made or implied.

  • Guest
    Reply
    |
    Mar 24, 2020

    The CAAC has reviewed this requirement and recommends that IBM view this as a high priority requirement that is important to be addressed. When combined with RDi, SQL, and testing SQL statements from RDi in ACS easily, the ability to have a marker would greatly enhance the process. Anyone that has repeatable statements would see a huge benefit also.

    Background: The COMMON Americas Advisory Council (CAAC) members have a broad range of experience in working with small and medium-sized IBM i customers. CAAC has a key role in working with IBM i development to help assess the value and impact of individual RFEs on the broader IBM i community, and has therefore reviewed your RFE.

    For more information about CAAC, see www.common.org/caac

    For more details about CAAC's role with RFEs, see http://www.ibmsystemsmag.com/Blogs/i-Can/May-2017/COMMON-Americas-Advisory-Council-%28CAAC%29-and-RFEs/

    Nancy Uthke-Schmucki - CAAC Program Manager

  • Guest
    Reply
    |
    Mar 18, 2020

    I also agree with Jon - we are able to select an SQL statement in RDi to be executed in ACS. Host variables are included - I can create a set of global variables to match the host variables (maybe not host structures), then set values - nice but time-consuming. I'd like in some way that host variables are treated as global and/or can be prompted.

    There is a prompting when using Query Management queries with variable names - those are marked by starting with an ampersand. If the value is not set using the SETVAR parameter of STRQMQRY, then a prompt is raised.

  • Guest
    Reply
    |
    Jul 31, 2019

    IBM has received this requirement and is evaluating it. A response will be provided when evaluation is complete.

  • Guest
    Reply
    |
    Jul 31, 2019

    I agree with Jon. It would be nice to be able to copy and paste to and from embedded RPG without changing the substitution variables to question marks. Maybe when you run the script the prompt could use the substitution variable name such as ":BalanceDue".
    With very complex queries it would make query creation and debugging much easier and less error prone. Today I need to create a query with hard coded values and then change them to variables in my RPG. When copying a query from RPG to Run SQL Scripts I need to change all my variables to hard coded values, change the query, test, then re-insert my substitution variables before putting it back in my RPG program.

  • Guest
    Reply
    |
    Jul 24, 2019

    It would be nice to see this have options that would make it simpler to also use it for testing embedded SQL. So it should offer an option to accept "parameters" in the form of host variables (i.e. names such as ":BalanceDue") or parameter markers (i.e. the "?" marker).

    I think it would have even greater utility in this role than it would in allowing parameterization of scripts.