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

Поиск
Список
Период
Сортировка
От Vilches, Alejandro
Тема Re: [ODBC] Problem calling a function from ODBC application
Дата
Msg-id 9CE034E149417949A58AA9A4FA7E1C5586DC1952@ORSMSX115.amr.corp.intel.com
обсуждение исходный текст
Ответ на Re: [ODBC] Problem calling a function from ODBC application  ("Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>)
Ответы Re: [ODBC] Problem calling a function from ODBC application  ("Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>)
Список pgsql-odbc
Hi Hiroshi,

Thanks for your suggestion!  That actually worked!  It works two ways: "?::timestamp" or "cast(? as timestamp)".

After running further tests, I'm seeing the issue occurs when the function has a parameter of type timestamp.
Furthermore,it throws off other parameters after that (e.g. the varchar parameters show up as unknown in the error
message). Anyway, I thought I would just mention that in case it helps anything. 

I wish there was a way to specify the timestamp type better when binding the parameter in ODBC (or that PostgreSQL
wouldn'tget confused between timestamp with or without time zone) so that I didn't need to cast it on top of that (as
thisseems a bit redundant). 

Anyway, thanks so much for your help, I really appreciate it!

Alejandro

-----Original Message-----
From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: Monday, February 6, 2017 1:53 AM
To: Vilches, Alejandro <alejandro.vilches@intel.com>; Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: [ODBC] Problem calling a function from ODBC application

Hi,

On 2017/02/04 9:54, Vilches, Alejandro wrote:
> It's actually without time zone.  However, it doesn't seem like ODBC allows me to specify that.  When I bind the
parameter,I can only say: SQL_TYPE_TIMESTAMP. 

How about calling with cast i.e.

    my_function3(?, ?, ?, ?, ?::timestamp with time zone, ?, ?, ?, ?, ?, ?, ?, ?, ?) ?

regards,
Hiroshi Inoue


> -----Original Message-----
> From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
> Sent: Friday, February 3, 2017 4:45 PM
> To: Vilches, Alejandro <alejandro.vilches@intel.com>; Adrian Klaver
> <adrian.klaver@aklaver.com>
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Problem calling a function from ODBC application
>
> Hi,
>
> On 2017/02/04 9:31, Vilches, Alejandro wrote:
>> Oh goodness, that's embarrassing :).
>>
>> Okay, so I've tried the following:
>>
>> - I fixed the small sample program and now that one executes
>> successfully
>>
>> - I created another sample program that calls a stored function with the same number of parameters and types as the
onein my real application and now that fails with the following error message (the same error message I originally
reported):
>> ERROR: function my_function3(bigint, bigint, integer, integer,
>> timestamp with time zone, integer, integer, integer, integer,
>> integer, integer, unknown, unknown) does not exist;
> Is the type of parameter 'timestamp with time zone' right?
>
>> Error while preparing parameters
>>
>> I've attached the new sample program.  The stored function can be any dummy function.
>>
>> Thanks!
>> Alejandro



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: [ODBC] [HY000] no error information; Error while preparingparameters
Следующее
От: "Inoue, Hiroshi"
Дата:
Сообщение: Re: [ODBC] Problem calling a function from ODBC application