ODBC sorting problem
Posted in 1996
Topics: Stored Procedures & SPL, Connectivity: ODBC / JDBC / .NET
Following problem occurs using ODBC & Informix:
Having an attached table TEST with fields e.g. CODE and NAME,
SELECT * FROM TEST ORDER BY CODE works finebut
SELECT * FROM TEST ORDER BY NAME reports error"Field NAME should be in select list"
SELECT * FROM TEST ORDER BY 2 gives the same, as well as something like
SELECT NAME FROM TEST ORDER BY NAME
This happens both from VB 4.0 and Access 2.
I have tried INFORMIX-CLI ODBC driver on Informix 5 and 6 servers,
and VISIGENIC Informix 5 ODBC driver on Informix 5 and 6 servers.
Unfortunately, I could not make run OPENLINK driver.
Playing with indexes and another tables it seems that it sorts only on
something that Access displays as primary key. It even works on field which is
second part of primary key. Adding index, even unique index on NAME does not
help.
Is there a clue how to solve the problem?
--------------------------------------------------------------------
Vedran Mornar (vedran.mornar@fer.hr)
Department of Applied Mathematics
Faculty of Electrical Engineering and Computing
Zagreb, Croatia