Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLGetData is not consistent with SQL_DESC_DISPLAY_SIZE for timestamp column [ODBC83] #82

Closed
firebird-automations opened this issue Apr 27, 2010 · 6 comments

Comments

@firebird-automations
Copy link

Submitted by: faridz (faridz)

Duplicates ODBC112

Attachments:
test_display.jpg

SQLGetData returns extra precision that is inconsistent with SQLColAttribute SQL_DESC_DISPLAY_SIZE returned by the driver for the resultset timestamp column.

Example,
create table test_display (col1 timestamp);
insert into test_display (col1) values ('2007-09-09 14:17:43.217');
select col1 from
test_display;

	rc = ::SQLColAttribute\(hstmt,
                           nCol,
                           SQL\_DESC\_DISPLAY\_SIZE,
                           NULL,
                           0,
                           NULL,
                           &nDisplaySize\);

returns 24 for display size, whereas SQLGetData/SQL_C_CHAR returns '2007-09-09 14:17:43.217000000' (29 characters). This causes formatting misalignment when retrieving resultset as text using SQLGetData using the ODBC driver where the column layout is computed using SQL_DESC_DISPLAY_SIZE.
See attached screenshot.

Commits: 10b4a5a 0978b15

@firebird-automations
Copy link
Author

Modified by: faridz (faridz)

description: SQLGetData returns extra precision that is inconsistent with SQLColAttribute SQL_DESC_DISPLAY_SIZE returned by the driver for the resultset timestamp column.

Example,
create table test_display (col1 timestamp);
insert into test_display (col1) values ('2007-09-09 14:17:43.217');
select col1 from
test_display;

	rc = ::SQLColAttribute\(hstmt,
                           nCol,
                           SQL\_DESC\_DISPLAY\_SIZE,
                           NULL,
                           0,
                           NULL,
                           &nDisplaySize\);

returns 24 for display size, whereas SQLGetData/SQL_C_CHAR returns '2007-09-09 14:17:43.217000000' (29 characters). This causes formatting misalignment when retrieving resultset as text using SQLGetData using the ODBC driver where the column layout is computed using SQL_DESC_DISPLAY_SIZE

COL1
------------------------
2007-09-09 14:17:43.217000000

1 row(s) affected

=>

SQLGetData returns extra precision that is inconsistent with SQLColAttribute SQL_DESC_DISPLAY_SIZE returned by the driver for the resultset timestamp column.

Example,
create table test_display (col1 timestamp);
insert into test_display (col1) values ('2007-09-09 14:17:43.217');
select col1 from
test_display;

	rc = ::SQLColAttribute\(hstmt,
                           nCol,
                           SQL\_DESC\_DISPLAY\_SIZE,
                           NULL,
                           0,
                           NULL,
                           &nDisplaySize\);

returns 24 for display size, whereas SQLGetData/SQL_C_CHAR returns '2007-09-09 14:17:43.217000000' (29 characters). This causes formatting misalignment when retrieving resultset as text using SQLGetData using the ODBC driver where the column layout is computed using SQL_DESC_DISPLAY_SIZE

<pre>
COL1
------------------------
2007-09-09 14:17:43.217000000

1 row(s) affected
</pre>

@firebird-automations
Copy link
Author

Modified by: faridz (faridz)

Attachment: test_display.jpg [ 11614 ]

description: SQLGetData returns extra precision that is inconsistent with SQLColAttribute SQL_DESC_DISPLAY_SIZE returned by the driver for the resultset timestamp column.

Example,
create table test_display (col1 timestamp);
insert into test_display (col1) values ('2007-09-09 14:17:43.217');
select col1 from
test_display;

	rc = ::SQLColAttribute\(hstmt,
                           nCol,
                           SQL\_DESC\_DISPLAY\_SIZE,
                           NULL,
                           0,
                           NULL,
                           &nDisplaySize\);

returns 24 for display size, whereas SQLGetData/SQL_C_CHAR returns '2007-09-09 14:17:43.217000000' (29 characters). This causes formatting misalignment when retrieving resultset as text using SQLGetData using the ODBC driver where the column layout is computed using SQL_DESC_DISPLAY_SIZE

<pre>
COL1
------------------------
2007-09-09 14:17:43.217000000

1 row(s) affected
</pre>

=>

SQLGetData returns extra precision that is inconsistent with SQLColAttribute SQL_DESC_DISPLAY_SIZE returned by the driver for the resultset timestamp column.

Example,
create table test_display (col1 timestamp);
insert into test_display (col1) values ('2007-09-09 14:17:43.217');
select col1 from
test_display;

	rc = ::SQLColAttribute\(hstmt,
                           nCol,
                           SQL\_DESC\_DISPLAY\_SIZE,
                           NULL,
                           0,
                           NULL,
                           &nDisplaySize\);

returns 24 for display size, whereas SQLGetData/SQL_C_CHAR returns '2007-09-09 14:17:43.217000000' (29 characters). This causes formatting misalignment when retrieving resultset as text using SQLGetData using the ODBC driver where the column layout is computed using SQL_DESC_DISPLAY_SIZE.
See attached screenshot.

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

assignee: Alexander Potapchenko [ lightfore ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.0 [ 10044 ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

Link: This issue duplicates ODBC112 [ ODBC112 ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants