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 18, 2025

Allow COALESCE to provide automatic CAST

I have this line in a CREATE VIEW statement:


coalesce(va.vaaddress1, '?Unknown') as vaaddress1,


When the view is accessed using SQL embedded in ILEPRPG, the SQLSTATE becomes 01004. VAADDRESS1 is defined in a SQL TABLE as CHAR(40). It would save a lot of typing if COALESCE would know to make '?Unknown' a CHAR(40) field instead of me having to make the coalesce statement like this:


coalesce(va.vaaddress1, cast('?Unknown' as char)) as vaaddress1,


Why can't SQL figure out that VAADDRESS1 is a CHAR type field and automatically cast to CHAR without me having to tell it that and have the SQLSTATE be 00000 instead?


Thank you,


Doug


Idea priority Medium
  • Guest
    Reply
    |
    Apr 22, 2025
    After direct discussion with the submitter of this Idea, we were not able to recreate the reported situation. For that reason this Idea is being closed.

    The expected result of a COALESCE of a character column and a string literal is varchar with a length attribute of the longest argument.

    Db2 for i development team
    IBM Power Systems Development