SQLDescribeCol – schema cache not being updated completely?

SQLDescribeCol – schema cache not being updated completely?

am 05.05.2011 16:38:06 von Jan-Peter.Seifert

Hello,

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

Creating table:
SQLExecDirect(stmt, â€=98CREATE TABLE tab1 (sp1 character varying(10)=
);â€=99, SQL_NTS)

Selecting from column:
SQLExecDirect(stmt, â€=98SELECT sp1 from tab1â€=99, SQL_NTS)

Getting column description:
SQLDescribeCol(stmt, 1, â€=A6) =3D>=20
ColumnName =3D "sp1", DataType =3D SQL_VARCHAR=3D12, ColumnSize =3D 10, D=
ecimalDigits =3D 0, Nullable =3D SQL_NULLABLE=3D1

SQLCloseCursor(stmt);

Altering the column:
SQLExecDirect(stmt, â€=98ALTER TABLE tab1 ALTER COLUMN sp1 TYPE char(=
25);â€=99, SQL_NTS)
SQLExecDirect(stmt, â€=98ALTER TABLE tab1 ALTER COLUMN sp1 SET NOT NU=
LL;â€=99, SQL_NTS)

Selecting from column again:
SQLExecDirect(stmt, â€=98SELECT sp1 from tab1â€=99, SQL_NTS)

Getting new column description:
SQLDescribeCol(stmt, 1, â€=A6)=3D>
ColumnName =3D "sp1", DataType =3D SQL_CHAR=3D1, ColumnSize =3D 10, Decim=
alDigits =3D 0, Nullable =3D SQL_NULLABLE=3D1

Obviously the Datatype information has been updated but ColumnSize und SQ=
L_NULLABLE have been not.

Itâ€=99s 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 â€=98schemaâ€=99 cache =
completely or for a single table 'manually' during runtime?

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

--=20
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Re: SQLDescribeCol – schema cache not being updated completely?

am 18.07.2011 12:49:56 von BGoebel

Hello,

i have posted a similar item:
http://postgresql.1045698.n5.nabble.com/Error-Retrieving-Cat alog-Info-tt4598955.html
Maybe it is helpful.

regards
BGoebel

--
View this message in context: http://postgresql.1045698.n5.nabble.com/SQLDescribeCol-schem a-cache-not-being-updated-completely-tp4372956p4598967.html
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.

--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc