Midrange News for the IBM i Community


Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Chicagoland
How to Insert the Current User into a Row Automatically
has no ratings.
Published: 03 Nov 2011
Revised: 23 Jan 2013 - 2185 days ago
Last viewed on: 16 Jan 2019 (8498 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

How to Insert the Current User into a Row Automatically Published by: Bob Cozzi on 03 Nov 2011 view comments(8)

I can't find this anywhere on the google...

I have a table and want to insert the change date/time. Okay, this is easy, just do this in the field named CHGDATE:

CHGDATE  TIMESTAMP NOT NULL IMPLICITLY HIDDEN  
                       FOR EACH ROW ON UPDATE  
                       AS ROW CHANGE TIMESTAMP,

 But I also want the Current User. However, SQL doesn't let me specify:

 

CHANGEDBY Char(10) NOT NULL DEFAULT SYSTEM_USER

 

Suggestions?

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS