From: Hiroshi Inoue <Inoue@tpf.co.jp>
To: Valerio Ferrucci <valfer@flashnet.it>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Calling a function via ODBC
Date: Fri, 08 Nov 2002 11:40:03 +0900
Message-ID: <3DCB2403.5D37C42B@tpf.co.jp> (raw)
References: <F24270E7-F1A5-11D6-86F7-00039377EF16@flashnet.it>
Valerio Ferrucci wrote:
>
> Hi,
> I have postgres installed on my Machine (MacOSX) and connect to it via ODBC from my C app.
> All works ok (select, insert, update and so on).
>
> Now I made the following simple function:
> CREATE OR REPLACE FUNCTION concat_text (TEXT, TEXT) RETURNS TEXT AS '
> BEGIN
> RETURN $1 || $2;
> END;
> ' LANGUAGE 'plpgsql';
>
> and called it succesfully doing:
> SQLExecDirect(... ""select concat_text('val', 'erio')"" ...)
> and fetching the result with SQLFetchScroll etc..., all works ok.
>
> SO WHICH IS THE QUESTION?
> THE QUESTION IS:
> Is there a way to call my func using the ODBC syntax:
> {? = CALL concat_text(?, ?)}
> using SQLBindParameter to bind variable (input/output) to '?'
> and getting return value directly in a bound var (without any
> Fetch) (see http://www.ddart.net/mssql/sql70/odbcht10_1.htm )?
Yes. As for your example, bind the 1st parameter
as SQL_PARAM_OUTPUT and 2nd/3rd paramters as SQL_
PARAM_INPUT.
regards,
Hiroshi Inoue
http://w2422.nsk.ne.jp/~inoue/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: Inoue@tpf.co.jp, valfer@flashnet.it
Subject: Re: Calling a function via ODBC
In-Reply-To: <3DCB2403.5D37C42B@tpf.co.jp>
References: <F24270E7-F1A5-11D6-86F7-00039377EF16@flashnet.it> <3DCB2403.5D37C42B@tpf.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox