Re: [ODBC] Problem calling a function from ODBC application

Поиск
Список
Период
Сортировка
От Inoue, Hiroshi
Тема Re: [ODBC] Problem calling a function from ODBC application
Дата
Msg-id 582dec4a-eda4-625d-3ae2-e3207667284c@dream.email.ne.jp
обсуждение исходный текст
Ответ на Re: [ODBC] Problem calling a function from ODBC application  ("Vilches, Alejandro" <alejandro.vilches@intel.com>)
Ответы Re: [ODBC] Problem calling a function from ODBC application  ("Vilches, Alejandro" <alejandro.vilches@intel.com>)
Список pgsql-odbc
Hi,

On 2017/02/04 4:41, Vilches, Alejandro wrote:
> Hi Adrian,
>
> Thanks for your reply.  To be honest, my application is a bit more complex and I simplified things to make the
questioneasier to ask.  I did go back and write up a small program as described in the question and now the error
messageI'm getting is different, but I'm still having issues calling my function from ODBC. 
>
> In essence, the problem I'm having is calling a function from ODBC that has an output parameter.  I can call it just
finefrom psql by simply executing "select * from my_function(...)".  But calling it from my application I get the
followingerror: "ERROR: syntax error at end of input;" 

I see the following in your code.

     ret = SQLPrepare(stmt, "{call my_function(?, ?, ?, ?}", SQL_NTS);

Should the last part ... ?, ?}  be ... ?, ?)}  ?

regards,
Hiroshi Inoue

> Please find the source code attached.  The stored function is very simple and silly:
>
> CREATE OR REPLACE FUNCTION public.my_function(a integer, b bigint, c character varying, OUT d bigint)
>   RETURNS bigint
>   LANGUAGE plpgsql
> AS $function$
> BEGIN
>      d := a + b + char_length(c);
> END
> $function$
>
> Thanks!
> Alejandro


В списке pgsql-odbc по дате отправления:

Предыдущее
От: "Vilches, Alejandro"
Дата:
Сообщение: Re: [ODBC] Problem calling a function from ODBC application
Следующее
От: "Vilches, Alejandro"
Дата:
Сообщение: Re: [ODBC] Problem calling a function from ODBC application