Re: Getting Out Parameter in the application using libpq

Поиск
Список
Период
Сортировка
От Ehsan Haq
Тема Re: Getting Out Parameter in the application using libpq
Дата
Msg-id 947264.28089.qm@web31815.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: Getting Out Parameter in the application using libpq  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
Hi,
   First of all the below mentioned function can't be called with "SELECT * FROM getOutVarchar()". Since the Function signature does not match.
CREATE OR REPLACE
Function getOutVarchar(outvarchar OUT varchar2) RETURN NUMBER
IS
BEGIN
   outvarchar:='This is Out String';
   RETURN 1;
END getOutVarchar;
However calling the above function with "SELECT * FROM getOutVarchar('abc');" does returns a Single column in a single row with a field named 'outvarchar' but the value of the field is "1" which is obvious due to "RETURN 1" and not "This is Out String".

Thanks
Ehsan

--- On Sat, 9/12/09, Merlin Moncure <mmoncure@gmail.com> wrote:

From: Merlin Moncure <mmoncure@gmail.com>
Subject: Re: [GENERAL] Getting Out Parameter in the application using libpq
To: "Ehsan Haq" <ehsan_haq98@yahoo.com>
Cc: pgsql-general@postgresql.org
Date: Saturday, September 12, 2009, 1:21 PM

On Fri, Sep 11, 2009 at 10:30 PM, Ehsan Haq <ehsan_haq98@yahoo.com> wrote:
>
> Hi,
>    I still don't get. How can I get the varchar OUT parameter in the application? For Example
>
> CREATE OR REPLACE
> Function getOutVarchar(outvarchar OUT varchar2) RETURN NUMBER

if, from libpq:

res = PQexec(conn, "SELECT * FROM getOutVarchar()");

the result should have a one column, one row result with a field
called outvarchar.

merlin

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

Предыдущее
От: Clodoaldo Neto
Дата:
Сообщение: Re: Missing 8.2.14 source rpms
Следующее
От: raghu ram
Дата:
Сообщение: Invitation to connect on LinkedIn