Re: [ODBC] Problem calling a function from ODBC application - Mailing list pgsql-odbc

From Inoue, Hiroshi
Subject Re: [ODBC] Problem calling a function from ODBC application
Date
Msg-id 4e4a9aa5-ada4-f504-e6da-163e6acc958e@dream.email.ne.jp
Whole thread Raw
In response to [ODBC] Problem calling a function from ODBC application  ("Vilches, Alejandro" <alejandro.vilches@intel.com>)
List pgsql-odbc
Hi,

On 2017/02/02 12:05, Vilches, Alejandro wrote:

Hi,

 

I’m having an issue calling a stored function in my database from my application using ODBC.  The application creates a prepared statement with the following string/text using SQLPrepare(): “{call my_function(?, ?, ?, ?)}” (where the fourth parameter is an out parameter).  Then, it binds the parameters using SQLBindParameter() and specifying the correct data types.  This is the function’s signature:

“my_function(in a integer, in b bigint, in c character varying, out d bigint)”.


I tried the code after copy and pasting your mail and  the result was successful.

 

However, when I execute the application, I get the following error:

ERROR: function my_function(integer, bigint, unknown) does not exist;


I can see this exact error when I run without registering my_function.

 

Why does it recognize the first two parameters correctly and not the third one?


Because the third parameter is ambiguous for psqlodbc driver, varchar or text?
'unknown' means it is not specified and let the postgres server determine the type.

regards,
Hiroshi Inoue

  I’ve double checked everything including the binding of that parameter to make sure it’s the correct type (SQL_VARCHAR).

 

The details:

 

Language: C/C++

GCC: 4.8.5

ODBC driver manager: unixODBC 2.3.1

PostgreSQL: 9.4.5

PostgreSQL ODBC driver: psqlodbc-09.05.0400

OS: SLES 12-SP1

 

Sorry if this is a repeated question.  I tried searching and couldn’t find a solution.

 

Any help is greatly appreciated.

 

Thanks!

Alejandro


pgsql-odbc by date:

Previous
From: Daniil Megrabyan
Date:
Subject: [ODBC] [HY000] no error information; Error while preparing parameters
Next
From: hiroshi@winpg.jp (Hiroshi Saito)
Date:
Subject: [ODBC] psqlODBC 09.06.0100 Released