SQLDescribeCol – schema cache not being updated completely?

Поиск
Список
Период
Сортировка
От Jan-Peter Seifert
Тема SQLDescribeCol – schema cache not being updated completely?
Дата
Msg-id 20110505143806.24920@gmx.net
обсуждение исходный текст
Ответы Re: SQLDescribeCol – schema cache not being updated completely?  (BGoebel <b.goebel@prisma-computer.de>)
Re: SQLDescribeCol – schema cache not being updated completely?  (BGoebel <b.goebel@prisma-computer.de>)
Список pgsql-odbc
Hello,

we looked into a problem caused by some changes to a db’s schema via psqlODBC - e.g.:

Creating table:
SQLExecDirect(stmt, ‘CREATE TABLE tab1 (sp1 character varying(10));’, SQL_NTS)

Selecting from column:
SQLExecDirect(stmt, ‘SELECT sp1 from tab1’, SQL_NTS)

Getting column description:
SQLDescribeCol(stmt, 1, …) =>
ColumnName = "sp1", DataType = SQL_VARCHAR=12, ColumnSize = 10, DecimalDigits = 0, Nullable = SQL_NULLABLE=1

SQLCloseCursor(stmt);

Altering the column:
SQLExecDirect(stmt, ‘ALTER TABLE tab1 ALTER COLUMN sp1 TYPE char(25);’, SQL_NTS)
SQLExecDirect(stmt, ‘ALTER TABLE tab1 ALTER COLUMN sp1 SET NOT NULL;’, SQL_NTS)

Selecting from column again:
SQLExecDirect(stmt, ‘SELECT sp1 from tab1’, SQL_NTS)

Getting new column description:
SQLDescribeCol(stmt, 1, …)=>
ColumnName = "sp1", DataType = SQL_CHAR=1, ColumnSize = 10, DecimalDigits = 0, Nullable = SQL_NULLABLE=1

Obviously the Datatype information has been updated but ColumnSize und SQL_NULLABLE have been not.

It’s the same for  DecimalDigits/SQL_NUMERIC

This has been tested with version 8.04.02.00 and 9.00.02.00 of psqlODBC.

Could you check into this, please?

Thank you very much,

Peter

P.S. Is there a way to flush/refresh this ‘schema’ cache completely or for a single table 'manually' during runtime?

--
NEU: FreePhone - kostenlos mobil telefonieren und surfen!
Jetzt informieren: http://www.gmx.net/de/go/freephone

В списке pgsql-odbc по дате отправления:

Предыдущее
От: Carlo Curatolo
Дата:
Сообщение: Re: PostgreSQL OLE DB Provider not visible in Excel 2010
Следующее
От: Hiroshi Saito
Дата:
Сообщение: psqlODBC 09.00.0300 Released