From: | "Inoue, Hiroshi" <h-inoue(at)dream(dot)email(dot)ne(dot)jp> |
---|---|
To: | "Vilches, Alejandro" <alejandro(dot)vilches(at)intel(dot)com> |
Cc: | "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org> |
Subject: | Re: Problem calling a function from ODBC application |
Date: | 2017-02-03 10:17:23 |
Message-ID: | 4e4a9aa5-ada4-f504-e6da-163e6acc958e@dream.email.ne.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
>
From | Date | Subject | |
---|---|---|---|
Next Message | Hiroshi Saito | 2017-02-03 13:40:34 | psqlODBC 09.06.0100 Released |
Previous Message | Daniil Megrabyan | 2017-02-03 08:06:23 | [HY000] no error information; Error while preparing parameters |