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 Jun 17, 2019

Provide proper SQL auditing user/timestamps

Currently there's a mix of SESSION and CLIENT_USERID fields that can be used with Generated Always but the first returns the native account, while the second returns the client account but is blank when executed from SQL on IBM i itself.

Please provide a single "user" field that is always filled (ex. CLIENT_USERID should have the native account when run on 5250/batch).

In addition, also change the For Each Row on Update as Row Change to have the option "on insert" as well.

The syntax is also a bit too much… "Generated Always For Each Row on Update as Row Change" … why not just "Generated Always on update" ?


Use Case:

While special registers are available, there's no solution that always works which makes proper auditing hard to do and requires the developer to insert the values himself which can be overuled.

There should be an easy way to set both user/timestamp on insert/update statements that is audit proof.


Idea priority High
  • Guest
    Reply
    |
    Jan 15, 2021

    IBM does not intend to provide a solution to this request at this time, so it is being closed.
    While we agree with the request, we do not currently plan to implement it because the cost of implementing a new version of user would not be worth the benefit.

    The CLIENT_USERID and SESSION_USER can be and frequently are different values especially when using connection pooling on the client side. Both values are important and we will not change either definition.

    The ON UPDATE part of the row change timestamp syntax semantically includes the initial "update" which happens on an INSERT. This attribute already does what you are requesting.

    The syntax for row change timestamp is verbose, but this is what the Db2 family agreed to implement. We do not intend to introduce an alternate syntax variation.

  • Guest
    Reply
    |
    Aug 20, 2019

    The "Generated Always For Each Row on Update as Row Change" issue does not seem to be an issue - when ran a CREATE TABLE now with such a timestamp, it used the current timestamp, so there was not a need to have it on insert - now if you change the DEFAULT on the column, that is another story.

    Here are the statements I ran -

    CREATE OR REPLACE TABLE dp2test/table1 (
    column1 INTEGER NOT NULL,
    column2 VARCHAR(100) ALLOCATE (20),
    change_ts GENERATED ALWAYS FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP NOT NULL
    );

    INSERT INTO dp2test/table1 (
    column1,
    column2
    )
    VALUES
    (
    25,
    'this is varchar'
    );

    SELECT *
    FROM dp2test/table1;

    And the result -

    25 this is varchar 2019-08-20 08:56:53.569561

    So I can't support the addition of automatic timestamp on insert - the other request could perhaps have its own RFE, for easier tracking by IBM and the community.

    Vern (CAAC member)