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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sql datetime to netcobol datetime

Status
Not open for further replies.

SPMINT

Programmer
Jan 16, 2003
1
NL
How can i get the datatype datetime from sql into my netcobol.
I don't want to convert it to often this because of performance.
Could someone show me an example.

Thanks.

 
Hi SPMINT,

When you say "I don't want to convert it to often this because of performance". Unless your computer was made over 20 years ago, I don't see how moving around a few bytes (if that) would stress your machine.

You can insert or retrieve datetime values in any number of formats by specifying the attributes of DATETIME. To retrieve datetime values, declare a host variable the same length as the number of bytes you expect to store in the variable. See your SQL manuals for the required number of digits for DATE, TIME, or TIMESTAMP values. The lengths of the target variables for TIME and TIMESTAMP values depend on the precision (the number of digits in the fractional seconds).

Dimandja
 
Hi SPMINT,

I did not provide any examples previously because many people have trouble understanding the nuances of DATETIME data types. If you don't know anything about DATETIME or SQL in general, your most helpful tip is to read the book first. Giving you 1 DATETIME example here is not going to begin to explain the half of it. Show us what you know so far about SQL or DATETIME: this will help focus our answers in the most helpful way. For example, does the following make any sense to you? DATETIME ’2000-03’ YEAR TO MONTH.

Dimandja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top