Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to put a timestamp in a DB2 table using DB2UTIL (update)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
huks

New User


Joined: 19 Dec 2006
Posts: 2
Location: brussels

PostPosted: Tue Dec 19, 2006 7:56 pm    Post subject: how to put a timestamp in a DB2 table using DB2UTIL (update)
Reply with quote

Hi,

i try to update a DB2 table with a SAS file in input using PROC DB2UTIL. (OS/390)
But I would like to put a timestamp for each update, how can i do ?

PROC DB2UTIL data=sas-file table=db2 table function=u;
MAPTO sas-name=DB2-name;
SQL SQL-statement;
UPDATE;
WHERE SQL-WHERE-clause;
ERRLIMIT=1
RUN;

I think that i have to put a sql statement but don't know what to write !

Thanks

H. Leclipteur
Back to top
View user's profile Send private message

MFRASHEED

Active User


Joined: 14 Jun 2005
Posts: 186
Location: USA

PostPosted: Tue Dec 19, 2006 10:16 pm    Post subject: Re: how to put a timestamp in a DB2 table using DB2UTIL (upd
Reply with quote

Quote:

But I would like to put a timestamp for each update, how can i do ?


If you have a timestamp field in table you can set that to 'CURRENT TIMESTAMP', if you want current timestamp.

Code:

UPDATE <TABLE>                                   
   SET FILD_1 = :HOST-1,   
       MNTN_TS       = CURRENT TIMESTAMP         
 WHERE  ......

Back to top
View user's profile Send private message
huks

New User


Joined: 19 Dec 2006
Posts: 2
Location: brussels

PostPosted: Wed Dec 20, 2006 2:14 pm    Post subject: Re: how to put a timestamp in a DB2 table using DB2UTIL (upd
Reply with quote

sorry but no !
the UPDATE Statement in the DB2UTIL PROC is not similar to an UPDATE command,
it causes the table to be updates by using the mapping specification only.

This statement is not mandatory.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us