Re: Problem calling a function from ODBC application

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: "Vilches, Alejandro" <alejandro(dot)vilches(at)intel(dot)com>, "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Problem calling a function from ODBC application
Date: 2017-02-02 03:15:39
Message-ID: a4d4c14c-83ff-7850-f3e5-9dfcf9ab3983@aklaver.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On 02/01/2017 07:05 PM, 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)”.
>
>
>
> However, when I execute the application, I get the following error:
>
> ERROR: function my_function(integer, bigint, unknown) does not exist;
>
>
>
> Why does it recognize the first two parameters correctly and not the
> third one? I’ve double checked everything including the binding of that
> parameter to make sure it’s the correct type (SQL_VARCHAR).

I think this is going to require showing the actual entire code
sequence that sets up the parameters and binds them and then calls the
function.

>
>
>
> 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
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Daniil Megrabyan 2017-02-03 08:06:23 [HY000] no error information; Error while preparing parameters
Previous Message Vilches, Alejandro 2017-02-02 03:05:28 Problem calling a function from ODBC application