Skip to Main Content
IBM Data and AI Ideas Portal for Customers


This portal is to open public enhancement requests against products and services offered by the IBM Data & AI organization. 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

Post ideas and requests to enhance a product or service. Take a look at ideas others have posted and upvote them if they matter to you,

  1. Post an idea

  2. Upvote ideas that matter most to you

  3. Get feedback from the IBM team to refine your idea


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.

IBM Employees should enter Ideas at https://ideas.ibm.com


Status Planned for future release
Workspace Db2 for z/OS
Created by Guest
Created on Mar 10, 2023

NEW SCALAR function for DB2 SQL – HEX2BIGINT

 

NEW SCALAR function for DB2 SQL – HEX2BIGINT            

 

I would like to see IBM provide a specific function for converting a HEX to BIGINT.

I think this would be useful for many/most/all users of Db2!

 

Why? 

The IBM LOAD utility will report that when input data contains data that violates an unique constraint of existing data in the table, the row in the table is reported telling us the RID.  The RID is shown in HEX.  

The CHECK DATA will report on bad/invalid data inside the table by giving us the RID in hex of the offending rows

The SQL INSERT can fail with -803 because of the violation of some unique constraint.  The row being inserted basically already exists in the table.  The existing row in the table is reported with the RID in HEX

 

IBM provides a useful RID function that allows to know the RID of a row in a table.

RID - IBM Documentation

 

RID function returns the RID value as a BIGINT.

 

When debugging problems with LOAD, CHECK DATA or SQL INSERT and SQLCODE -803, a curious DBA can use RID function to confirm the row at a RID location and cross-check the information with what is expected.  

This simple SELECT example lets us look at the row of a RID location.

SELECT * FROM TABA A WHERE RID(A) = ?;

 > I believe that this type of query is something many/most/all DBAs might occasional create to look at their data... when invesitigatin problems!

I think that IBM should provide a standard and simple HEX2BIGINT function to help us easily convert a RID HEX value (as reported by the utilities or SQLCODE -803) into a BIGINT value.

 

Then we can very easily SQL SELECT to inspect and verify our table data.

SELECT * FROM TABA WHERE RID(A) = HEX2BIGINT(X'0000006B01')

or

SELECT * FROM TABA WHERE RID(A) = HEX2BIGINT('0000006B01')

 

> Should the input to this new HEX2BIGINT function be hex or char?  It depends, IBM can decide.

 

 

The alternative is for me to manually convert my reported HEX value with some annoying tool like WINDOWS CALCULATOR.

Another alternative is to build my own user-defined-function to convert HEX2BIGINT.  There are many examples in IDUG-listserv.   And yes, I have done this.  

 

But why should we all create our own user-defined-function that are essentially the same?    IBM should make it part of standard DB2.

 

FYI – I had a similar idea in the past… but it was rejected.  This is a new and more focused attempt of an idea for IBM and Db2

https://ibm-data-and-ai.ideas.ibm.com/ideas/DB24ZOS-I-1030

 

 

 

Needed By Not sure -- Just thought it was cool
  • Guest
    Reply
    |
    Mar 13, 2023

    long overdue