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.