Search Postgresql Archives

Re: Getting Out Parameter in the application using libpq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> wrote:

From: Merlin Moncure <mmoncure@xxxxxxxxx>
Subject: Re: Getting Out Parameter in the application using libpq
To: "Ehsan Haq" <ehsan_haq98@xxxxxxxxx>
Cc: pgsql-general@xxxxxxxxxxxxxx
Date: Saturday, September 12, 2009, 1:21 PM

On Fri, Sep 11, 2009 at 10:30 PM, Ehsan Haq <ehsan_haq98@xxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux