Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO RETRIEVE TIMESTAMP

Status
Not open for further replies.

solanki123

Programmer
Jul 1, 2003
29
IN
I need a db2 query that can retrieve timestamp from server.
I want to embed that query in cobol program so that whenever
I run that program,it can give the exact timestamp.
Can anybody help me??
 
I believe you want:

Select CURRENT TIMESTAMP from sysibm.sysdummy1

Andy
 
Hi Andy '
You replied exactly what I needed.
Thanks for the help.

 
That was everything ..

Please, if you find time, read through the SQL Reference ..

Cheers
Sathyaram

$ db2 connect to sample

Database Connection Information

Database server = DB2/LINUX 8.1.0
SQL authorization ID = DB2INST1
Local database alias = SAMPLE

$ db2 "values(current timestamp)"

1
--------------------------
2003-07-17-21.36.03.462616

1 record(s) selected.

$


More DB2 questions answered at
 
Hi Solanki and Sathyarams,
I think that ARWinner's answer was probably the best for you, bearing in mind that you wish to embed the SQL in a Cobol program. I think that Sathyarams' reply is more for if you are outside of Cobol.
Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top