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 Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm


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