From: | Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp> |
---|---|
To: | Valerio Ferrucci <valfer(at)flashnet(dot)it> |
Cc: | pgsql-odbc(at)postgresql(dot)org |
Subject: | Re: Calling a function via ODBC |
Date: | 2002-11-08 02:40:03 |
Message-ID: | 3DCB2403.5D37C42B@tpf.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-odbc |
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/
From | Date | Subject | |
---|---|---|---|
Next Message | Valerio Ferrucci | 2002-11-08 07:29:18 | Re: Calling a function via ODBC |
Previous Message | Elielson Fontanezi | 2002-11-07 13:16:51 | Referencial Link with ODBC |