IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Regarding timestamp


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Nov 19, 2013 5:37 pm
Reply with quote

Hi All,

I'm updating few values from cics screen to db2 table one of which being updated is current_timestamp.

Code:

exec sql
        insert into db2table
        (cust_id,time) values (001,current timestamp):
end-exec


after insertying the values in the db2 table apparaently i have to populate into the cics screen the inserted time stamp that have been saved in db2 table. for that i have to take the current_timestamp that i have updated in table Only.How can i take the timestamp above into working storage variable and populate into the screen???? should i write another query with priomary key or is there any other way to do the same.

Please suggest frens....
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1566
Location: Andromeda Galaxy

PostPosted: Tue Nov 19, 2013 6:05 pm
Reply with quote

After insert select the data and pass it
Back to top
View user's profile Send private message
Dhrubojoty mukherjee

New User


Joined: 23 Mar 2010
Posts: 14
Location: kolkata

PostPosted: Tue Nov 19, 2013 9:42 pm
Reply with quote

In your program select the data and take it into the host variable.Then move the data to the out-variable of the cics map...
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Nov 20, 2013 2:43 pm
Reply with quote

first of all : a TS column called "time" is a very bad idea
second : select the current timestamp while inserting :
Code:
SELECT TScol
  FROM FINAL TABLE (insert into db2table
        (cust_id,tscol) values (001,current timestamp));
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Wed Nov 20, 2013 4:23 pm
Reply with quote

GuyC wrote:
first of all : a TS column called "time" is a very bad idea
second : select the current timestamp while inserting :
Code:
SELECT TScol
  FROM FINAL TABLE (insert into db2table
        (cust_id,tscol) values (001,current timestamp));


Hi GuyC,

I have taken as Current Timestamp only....Could you please have a look suggest for the solution. Thanks in Advance.The below query i have written

Code:

exec sql
        insert into db2table
        (cust_id,time) values (001,current timestamp):
end-exec
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Nov 20, 2013 7:25 pm
Reply with quote

my previous post was a suggestion of a solution :
You can select a generated column at the time of insert.
Google DB2 SELECT FROM INSERT , read and learn
Use [URL] BBCode for Links
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

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Timestamp in TCP/IP for Z/VSE JCL JCL & VSAM 0
No new posts how to add date & timestamp to th... DFSORT/ICETOOL 5
No new posts DB2 Timestamp field weird behaviour. DB2 8
No new posts How to get MQPUT Timestamp? Java & MQSeries 3
No new posts row change timestamp DB2 3

Back to Top