Re: Output parameters

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: Bart Samwel <bart(at)samwel(dot)tk>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Output parameters
Date: 2006-05-17 23:32:47
Message-ID: 446BB29F.7070705@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Bart Samwel wrote:
> Hiroshi Inoue wrote:
>> Bart Samwel wrote:
>>> Hiroshi Inoue wrote:
>>>> Bart Samwel wrote:
>>>>> Hi there,
>>>>>
>>>>> I've got a situation with the experimental enhanced branch driver
>>>>> (version 7.03.02.66), PostgreSQL 8.1 backend. I'm executing a query
>>>>> such as:
>>>>>
>>>>> SELECT myproc(?,?,?,?,?,?,?)
>>>>>
>>>>> where a number of the parameters are output parameters. I've bound
>>>>> buffers to the output parameters, but when I read the values, they
>>>>> contain garbage (uninitialized data, to be precise -- 0xcdcdcdcd).
>>>>
>>>> What kind of tool are you using and how do you execute the above
>>>> example concretely ?
>>>
>>> I'm using our own ODBC front end library, freshly written from spec.
>>> The same code works like a charm on Oracle to retrieve output
>>> parameters. I could figure out the exact sequence of calls if you
>>> want, there's quite a lot of wrapper code around it but It'd probably
>>> be possible.
>>
>> Could you send me the Mylog output ?
>
> Yes, it's attached. Please read on for some extra context information. :-)
>
> Anyway, it turns out that I misinterpreted the way PostgreSQL implements
> output parameters -- apparently, they are nothing but a convenient way
> to make PostgreSQL create a complex return type for a function. In
> PL/pgSQL, however, I can't specify the output parameters in the
> parameter list, while with the ODBC driver I can.

Please use ODBC's standard syntax to execute functions or procedures.

{[?=]call procedure-name[([?][,[?]]...)]}

For example, please execute {CALL baz(?, ?)} in your case.

regards,
Hiroshi Inoue

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Bart Samwel 2006-05-18 09:33:37 Re: Output parameters
Previous Message Hiroshi Inoue 2006-05-17 12:46:00 Re: Output parameters