Using Timestamp in Update query

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
Vishwanath G N
Member
Posts: 7
Joined: Sat Apr 06, 2013 9:11 am
Location: Chicago

Using Timestamp in Update query

Post by Vishwanath G N » Wed Apr 17, 2013 9:44 am

Hi All,

I want to update a column in the table to mmdd .

Example:

If i want the value to be 0416(MMDD) for today,I can get this by below select query

select substr(digits(month(current timestamp)),9,2)||substr(digits(day(current timestamp )),9,2)
from sysibm.sysdummy1 with ur;

But how would i accomadate the same in the Update query??
Visi

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed Apr 17, 2013 9:08 pm

Store the date in a variable and then use the variable for the update.

Possibly i misunderstand.
Have a good one

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others