cancel
Showing results for 
Search instead for 
Did you mean: 

How much space to allocate for TIMESTAMP field in MaxDB/SQLDBC

Former Member
0 Kudos

Hi Everybody,

In a C application using SQLDBC to access MaxDB if i have to allocate space for holding the value returned by TIMESTAMP field from a table. How much space should i allocate to this variable.

For example:

In Oracle:

the space allocated is

m_size = sizeof(OCIDate);

In DB2:

sizeof(SQL_TIMESTAMP_STRUCT)

In MySQL:

sizeof(MYSQL_TIME)

Regards

Raja

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

From the net i see that TIMESTAMP in MaxDB confirms to ISO timestamp format. So, its stored in the format 'YYYY-MM-DD hh:mm:ss'

But then from Database Studio i see that 26 as the dimension for a a TIMESTAMP field. Can someone explain if this 26 means 26 bytes and if yes, why do we need 26 bytes to store 20 characters (including the null terminator)

Regards

Raja

Melanie
Advisor
Advisor
0 Kudos

Hello Raja,

would you mind reading the documentation?

Please have a look at the reference manual, chapter 'Memory Requirements of a Column Value According to Data Type'.

Regards,

Melanie

Former Member
0 Kudos

Hi Melanie,

Am not very sure which document you are referring to exactly by reference manual. Can you provide a link to the same.

Regards

Raja

Former Member
0 Kudos

I got this information about the timestamp format, it includes microsecond also.

ISO 'YYYY-MM-DD HH:MM:SS.MMMMMM' '2005-01-23 14:30:08.456234' hence it will be 26.

Regards

Raja

Melanie
Advisor
Advisor
0 Kudos

Hello Raja,

the Reference Manual is part of the documentation provided online.

In thread 'MaxDB documentation' a link is provided: http://maxdb.sap.com/doc/7_6/default.htm

In this documentation you can find a link to the 'SQL Reference Manual'.

Best regards,

Melanie

Former Member
0 Kudos

Thanks,

Got it.

Regards

Raja

Answers (0)