[unixODBC-support] missing semicolon in query generated of postgresql SQLForeignKeys() ?
martin.evans at easysoft.com
martin.evans at easysoft.com
Thu Feb 24 20:38:06 GMT 2005
You can find a new postgres drivr:
I think (and am sure somone will correct me if I'm wrong) that you should
be able to build this newer driver and go. If you install it in a different
place you'll have to edit odbcinst.ini to change the postgres entry.
I could also be way out here but when you executed the statements
by hand did you literally cut and paste them - postgres MIGHT need
the table names in uppercase.
Quoting Paul Novorolsky <paul.novorolsky at base2capital.com>:
> Hi Nick,
> Thanks for the followup. Forgive my naivete, but I'm not sure what's
> involved with changing postgres drivers. Is it an upgrade to postgresql,
> or is the ODBC driver interchangeable?
> Nick Gorham wrote:
> > Paul Novorolsky wrote:
> >> Please be tolerant if I'm in the wrong place for this, but I've
> >> scoured the web looking for a FAQ or some other indication of what
> >> could be wrong here. I'm not exactly a DB or ODBC guru, and I just
> >> recently set up postgresql and unixODBC under Redhat.
> >> I'm running unixODBC 2.2.8-2 and postgreSQL 6.3.6-RH, which are the
> >> versions supplied with my version of Redhat.
> >> What I'm trying to do is make use of the ability to query the
> >> database structure in C++, specifically the relationships between the
> >> tables using SQLForeignKeys(). The command succeeds, but returns no
> >> data (SQLFetch returns SQL_NO_DATA)
> >> I am also unable to get any results back from SQLPrimaryKeys().
> >> For SQLPrimaryKeys, my call is: SQLPrimary(hstmt, 0, 0, NULL, 0,
> >> (SQLCHAR *)tableName, SQL_NTS);
> >> and SQLForeignKeys(hstmt, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL,
> >> 0, (SQLCHAR *)tableName, SQL_NTS);
> >> The command executes OK (returns SQL_SUCCESS), but results in no
> >> data. I tried using DataManager, and odbctest with similar results.
> >> I enabled the trace logging on postgreSQL, and found that the SQL
> >> statements that are generated to fulfill these requests. For each
> >> attempt at either SQLForeignKeys() or SQLPrimaryKeys(), I see the SQL
> >> statement logged, but without a semicolon terminator to the query.
> >> Executing these SQL statements by hand does select the attributes I
> >> am interested in. (So I know that the relationships exist, and can be
> >> queried.)
> >> Is this likely to be my problem? If so, is there some way to
> >> configure unixODBC to terminate these queries with a semicolon?
> >> Is there any other advice anyone has to offer on how I might be able
> >> to get this to work?
> >> Thanks in advance...
> > Maybe worth trying a different postgres driver ?
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
More information about the unixODBC-support