Skip to Main Content
IBM Z Software


This portal is to open public enhancement requests against IBM Z Software products. 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
Categories EGL Language
Created by Guest
Created on Feb 15, 2011

ORDER BY makes data service fail

We often generate services to retrieve SQL data from AS/400 using the Data Access Application wizard. The generated services contain several functions amongst which the function to retrieve a list of data which can be specified with the fromTablesWhere attribute. This function is called ?GetxxxxxxxxList'. In this function 2 SQL statements are prepared: 1 to retrieve the data, and 1 to retrieve the row count. This works OK. However when we set the fromTablesWhere to retrieve the data in a sequence specified by an ?ORDER BY' the row count prepared statement fails. This is due to the fact that the ?ORDER BY' is not accepted in a ?SELECT COUNT(*)' statement.
To work around this problem we now included a few lines of code in every data service we create. In the GetxxxxxxxList function before the prepare of the count statement we add these lines in order to remove the ?ORDER BY' part:
length int = characterlen(clip(listSpec.fromTablesWhere));
startpos int = strlib.indexof(listSpec.fromTablesWhere,"ORDER BY");
if (startpos != 0)
listSpec.fromTablesWhere = listSpec.fromTablesWhere[1:startpos-1];
end

We like a solution where no manual changes are needed after generating a service by the Data Access Application wizard. If you consider this RFE to be a defect we'll be glad to open a PMR.

Idea priority Low
  • Guest
    Reply
    |
    Sep 14, 2015

    Due to processing by IBM, this request was reassigned to have the following updated attributes:
    Brand - Servers and Systems Software
    Product family - Programming Languages
    Product - Business Developer

    For recording keeping, the previous attributes were:
    Brand - Rational
    Product family - Design & development
    Product - Business Developer

  • Guest
    Reply
    |
    Aug 20, 2012

    I like this RFE to be reconsidered.
    Please consider the comments I added on 01 Mar 2011.

  • Guest
    Reply
    |
    Mar 1, 2011

    An other suggestion is to extend the capabilities of the fromTablesWhere option by having an 'orderBy', 'groupBy' and 'having' option for composing the SQL. The prepare statement then can use all options and the count(*) can only use the fromTablesWhere option.

  • Guest
    Reply
    |
    Mar 1, 2011

    Hello IBM_Rational_Developer,
    I see your point that it would be difficult to create a generic function to omit SQL statement parts in order to reduce the original SQL statement to apply to a count(*) statement. However I think our suggestion would make a good start and will cover 90% of all problematic SQL requests.
    Maybe you can create a program exit point where the programmer can implement their own algorithm for stripping the SQL. This exit point can be a function in a part of the service that won't get regenerated when recreating the service.

  • Guest
    Reply
    |
    Feb 25, 2011

    While we can see the value of what you are asking for, it would be very difficult to implement a generalized solution. It is the customer's customization that adds the "order by" (which makes sense on a list) to the fromTablesWhere string. It is our design to use the same string in the prepare for the SELECT COUNT(*) statement. Since we don't know what they will add, how do we know what to strip out like the ORDER BY and are there other clauses that don't work for the SELECT COUNT(*). This could be anything allowed in SQL... joins, subselects, etc...are all allowed on SELECT COUNT(*) except the ORDER BY.

    We are unlikely to implement this request in the near-to-medium term.