Feedback
Did this article resolve your question/issue?

   

Article

Connect for ODBC PostgreSQL driver reports the wrong value for SEQ_IN_INDEX / ORDINAL_POSITION from SQLStatistics()

Information

 
TitleConnect for ODBC PostgreSQL driver reports the wrong value for SEQ_IN_INDEX / ORDINAL_POSITION from SQLStatistics()
URL Nameconnect-for-odbc-postgresql-driver-reports-the-wrong-value-for-seq-in-index-ordinal-position-from-sqlstatistics
Article Number000119171
EnvironmentProduct: Connect for ODBC PostgreSQL driver
Version: 7.1
O/S: Windows
Database: PostgreSQL
Application: N/A
Question/Problem Description

When SQLStatistics is being called, the results of the query are giving an incorrect value for the ORDINAL_POSITION. The ORDINAL_POSITION is the position of a given column within the scope of the index it is part of.

Steps to Reproduce
Clarifying Information

For example, consider the following table:

create table test
(
                col1 int, 
                col2 int,
                col3 int,
                col4 int,
                col5 int,
                col6 int,
                col7 int,
                col8 int

 

For this table, if we create the following index:

create index test_idx on test(col6, col4, col8) 

With such an index, a call to SQLStatistics() should yield:

col6 ORIDINAL_POSITION of 1
col4 ORIDINAL_POSITION of 2
col8 ORIDINAL_POSITION of 3

With the current code, the driver is yielding:

col6 ORIDINAL_POSITION of 2
col4 ORIDINAL_POSITION of 3
col8 ORIDINAL_POSITION of 4

A table, where there is just one column in the index is still giving an ORDINAL_POSITION value of 2. This is the reported problem. All the ORDINAL_POSTITION values are being biased by positive one.

Error Message
Defect Number75064
Enhancement Number
Cause
The driver was deriving the ordinal position of the columns incorrectly.
Resolution
Fixed in hotfix 07.16.0276

Refer to "Connect and Connect64 for ODBC hot fix download and install instructions" for instructions on how to download and install the hot fix.
Workaround
Notes
Last Modified Date8/31/2017 7:39 PM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.