0

Description: i have a problem executing the prepared statement more than once with binding parameters. 1st time it executing correct then resetting the parameters,statement and when i try to execute same prepared statement next time it is failed giving the error like this.

Details: i am executing a prepared statement with binding some parameters ,after executing i am resting the prepared statement and unbinding the parameters. when try to execute the same prepared statement it is giving the error :"27:Error fetching numeric attribute: ColAttribute for this type not implemented yet". i am using libodbc++ library. when i debug it is going wrong at this line(libodbc++ code line)

Line :ResultSet* rs=ODBCXX_OPERATOR_NEW_DEBUG(FILE, LINE) ResultSet(this,hstmt_,hideMe);

Error: "27:Error fetching numeric attribute: ColAttribute for this type not implemented yet"

PostgreSQL version number you are running:

How you installed PostgreSQL:PostgreSQL 9.3.5, compiled by Visual C++ build 1600, 64-bit

Changes made to the settings in the postgresql.conf file: No

Operating system and version:windows 8.1 (64-bit)

What program you're using to connect to PostgreSQL:ODBC 3.5 (libodbc++) library

Is there anything relevant or unusual in the PostgreSQL server logs?:No

For questions about any kind of error:

What you were doing when the error happened / how to cause the error:"27:Error fetching numeric attribute: ColAttribute for this type not implemented yet"

Thanks & Regards Balakrishna

balakrishna
  • 279
  • 2
  • 6
  • 12
  • Can you provide us with the prepared statement? – Compass Sep 19 '14 at 06:33
  • some one says that it is due to SQLColAttribute function is called with a field identifier that the driver doesn't recognize. is it true ?? if it is then what are field identifier supported by postgresql driver ?? – balakrishna Oct 16 '14 at 05:05

1 Answers1

0

The issue is with how the libodbc++ handles the parameters and the queries. There are two ways to fix this :

 1. Upgrade the libodbc++ to use 7.4(V3) protocol.
 2. If you are using old libodbc++, then change disable the UseServerSidePrepare parameter in odbc configuration files.

Explaination for UseServerSidePrepare = 0 in odbc configuration :

The psqlodbc controls more than just whether to use unnamed or named plans in the server. With UseServerSidePrepare=0, parameters are handled completely in the driver, replacing the parameter markers with the values in the query itself.

Note : There may well be applications where UseServerSidePrepare=1 gives a performance hit, especially when running against < 9.2 servers. It's still a better default IMHO, you can still turn it off if you have to.

PS: I know the question was asked years back, but i recently faced the same issue and had to very less resource which actually worked.

Abinash Kumar
  • 331
  • 1
  • 2
  • 15