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
 

 

Regarding timestamp

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

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Nov 19, 2013 5:37 pm    Post subject: Regarding timestamp
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: 1529
Location: Andromeda Galaxy

PostPosted: Tue Nov 19, 2013 6:05 pm    Post subject:
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    Post subject:
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: 1278
Location: Belgium

PostPosted: Wed Nov 20, 2013 2:43 pm    Post subject:
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

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Wed Nov 20, 2013 4:23 pm    Post subject:
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: 1278
Location: Belgium

PostPosted: Wed Nov 20, 2013 7:25 pm    Post subject:
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
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2z10.doc.apsg%2Fsrc%2Ftpc%2Fdb2z_selectvalueinsert.htm
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 Converting EBCDIC to Unicode (TimeStamp) muralikrishnan_new COBOL Programming 2 Mon Jul 25, 2016 10:42 pm
No new posts Convert Timestamp Value mrdinesh DFSORT/ICETOOL 7 Thu May 05, 2016 6:01 pm
No new posts Comparing timestamp in Synscort l.nethaji SYNCSORT 13 Wed Jan 20, 2016 4:47 pm
No new posts pass numeric value of length 14 to ti... Ralph Zbrog Java & MQSeries 4 Fri Jan 15, 2016 3:20 pm
No new posts Pick a record from a file based on ti... Mani453 COBOL Programming 4 Thu Jan 07, 2016 6:18 am


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