IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top