Bug #13072 Can't retrieve SQL_C_TYPE_TIME values via SQLGetData or SQLBindCol
Submitted: 8 Sep 2005 18:42 Modified: 31 May 2013 6:43
Reporter: Fintan Killoran Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51 11-2 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[8 Sep 2005 18:42] Fintan Killoran
Description:

This works for data and timestamps but not for times. What's strange is that it also works for SQLBindParameter on SQL_C_TYPE_TIME, but not for SQLBindCol?

How to repeat:

SQL_TIME_STRUCT d;

Execute a statement to retrieve value d which is of type time;

rc = SQLPrepare (hstmt, (SQLCHAR *) "SELECT d FROM testtable", SQL_NTS);

Now get the data;

rc = SQLGetData (hstmt, 4, SQL_C_TYPE_TIME, & d, 0, & cbD);

Now;

d is completely blank (not NULL) and cbD is 6

Suggested fix:

Workaround is just use string output instead;

rc = SQLGetData (hstmt, 4, SQL_CHAR, s, STR_LEN, & cbD);

Time is now in s string
[16 Sep 2005 7:14] Vasily Kishkin
Sorry...I was not able to reproduce the bug:

Connect....
Test....
Value = 12:58:2
Disconnect....

Could you please build and run my test case ? I attached the test case in "Files".
[16 Sep 2005 7:14] Vasily Kishkin
Sorry...I was not able to reproduce the bug:

Connect....
Test....
Value = 12:58:2
Disconnect....

Could you please build and run my test case ? I attached the test case in "Files".
[16 Sep 2005 7:15] Vasily Kishkin
Test case

Attachment: test.c (text/plain), 3.86 KiB.

[16 Oct 2005 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[30 May 2013 7:28] Bogdan Degtyariov
I'm closing this bug because I can not continue without feedback from the reporter. If you have new info, please reopen the report.