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 Not under consideration
Workspace IBM i
Categories Db2 for i
Created by Guest
Created on Apr 14, 2020

Select into :dsArray

It would be great to be able to select columns from a table directly into a data structure array instead of going through the process of creating a cursor. Because a lot of times you just want the list of matches and then your done.

It makes even more sense now that we have dynamic arrays at our disposal.

A criteria for it to work could be that the data structure it self must be defined like the table using extname or likerec etc.


Use Case:

Instead of creating a cursor that i need to fetch from into my array and then close it, it would be great to just select into the array.

Today:
dcl-s fetched int(5);
dcl-s dsArray extname('MYTABLE') dim(500) end-ds;

exec sql declare c1 insensitive cursor for
select name, birth
where birth > 1960;

open c1;

// optionally get the fetched number of rows in advance
exec sql get diagnostic :fetched = DB2_NUMBER_ROWS;

exec sql fetch from c1 for :fetched rows into :dsArray;

exec sql close c1;


Could be:
dcl-ds dsArray extname('MYTABLE') dim(500) end-ds;

exec sql
select name, birth
into :dsArray
where birth > 1960;

If it breaks because non-sufficient number of rows, it will break just like it would from a cursor.

It would also be really great considering our dynamic arrays.


Idea priority Medium
  • Guest
    Reply
    |
    Dec 9, 2020

    IBM does not intend to provide a solution to this request at this time, so it is being closed.

    While we understand that not requiring the use of a cursor makes the programming job simpler, it will not be done for two reasons. First of all, investing significant resource to implement this change does not add any new database ability for an end user. We would prefer to invest in new features. Second, doing this is not considered a desirable direction by the Db2 family of products.

  • Guest
    Reply
    |
    Nov 24, 2020

    Certainly we can use a cursor for this - but ... As the OP notes, the advent of dynamic arrays in RPG would make this a powerful and easy to use construct. Under the covers of course the pre-compiler can still implement this via a cursor but it would be so nice to only have to write _one_ Exec SQL rather than the _four_ needed currently.

    The other point to note is that this approach would more closely mirror what programmers coming to IBM i from other platforms are used to seeing. when teaching such folks how to use SQL in RPG you often encounter "Why do I have to do that?" when explaining that a cursor is needed to retrieve a result set.

  • Guest
    Reply
    |
    Sep 22, 2020

    The CAAC has reviewed this requirement and recommends that IBM view this as a “nice to have” low priority feature. Cursors are very easy to use, so IBM should not spend a lot of time on this, but it would be useful if it were easy to implement.

    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
    |
    Jul 20, 2020

    The CEAC has reviewed this requirement and recommends that IBM view this as a MEDIUM priority requirement that should be addressed.
    It would be an ice to have to simply SQL code in RPG programs.

    Background: The COMMON Europe Advisory Council (CEAC) members have a broad range of experience in working with small and medium-sized IBM i customers. CEAC has a crucial 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.

    To find out how CEAC help to shape the future of IBM i, see CEAC @ ibm.biz/BdYSYj and the article "The Five Hottest IBM i RFEs Of The Quarter" at ibm.biz/BdYSZT

    Therese Eaton – CEAC Program Manager, IBM

  • Guest
    Reply
    |
    Apr 15, 2020

    Due to processing by IBM, this request was reassigned to have the following updated attributes:
    Brand - Servers and Systems Software
    Product family - Power Systems
    Product - IBM i
    Component - Db2 for i
    Operating system - IBM i
    Source - None

    For recording keeping, the previous attributes were:
    Brand - Servers and Systems Software
    Product family - Power Systems
    Product - IBM i
    Component - Languages - RPG
    Operating system - IBM i
    Source - None

  • Guest
    Reply
    |
    Apr 15, 2020

    Where is the vote No button I keep asking for? This request would get it.

    Jason