On Fri, May 16, 2008 at 10:06 AM, Merlin Moncure <[EMAIL PROTECTED]> wrote:
> On Fri, May 16, 2008 at 2:17 AM, Albe Laurenz <[EMAIL PROTECTED]> wrote:
>> Chuck Bai wrote:
Hi, Chuck!
What's the Npgsql code you are using to call this function?
Thanks in advance.
--
Regards,
Francisco Figueire
On Fri, May 16, 2008 at 2:17 AM, Albe Laurenz <[EMAIL PROTECTED]> wrote:
> Chuck Bai wrote:
> CREATE OR REPLACE FUNCTION test_refcursor(INOUT tcount integer,
> OUT o_user refcursor, OUT o_name refcursor) RETURNS record AS
> $BODY$
> BEGIN
>o_user := 'o_user';
>o_name := 'o_name';
>tco
Please don't top post!
Chuck Bai wrote:
>>> CREATE OR REPLACE FUNCTION test_refcursor(INOUT tcount integer, OUT
>>> o_user refcursor, OUT o_name refcursor)
>>> RETURNS record AS
>>> $BODY$
>>> BEGIN
>>> tcount := tcount + 1;
>>> OPEN o_user FOR SELECT * FROM user_table;
>>> OPEN o_n
Thank you Albe. I test your script using psql and it works as you found
out. If the function is correct. Now the problem is how to use the
function from client side. It could not use "" kind of
thing from client. I tested the function using Npgsql connector and it
did not work. I got only thing
Chuck Bai wrote:
> I have the following function:
>
> CREATE OR REPLACE FUNCTION test_refcursor(INOUT tcount integer, OUT
> o_user refcursor, OUT o_name refcursor)
> RETURNS record AS
> $BODY$
> BEGIN
> tcount := tcount + 1;
> OPEN o_user FOR SELECT * FROM user_table;
> OPEN o_name
The following is a function from PosgreSQL documentation to return
multiple cursors from a single function:
CREATE FUNCTION myfunc(refcursor, refcursor) RETURNS SETOF refcursor AS $$
BEGIN
OPEN $1 FOR SELECT * FROM table_1;
RETURN NEXT $1;
OPEN $2 FOR SELECT * FROM table_2;
RETURN NE
On Sun, May 11, 2008 at 2:43 PM, Chuck Bai <[EMAIL PROTECTED]> wrote:
> CREATE OR REPLACE FUNCTION test_refcursor(INOUT tcount integer, OUT o_user
> refcursor, OUT o_name refcursor)
> RETURNS record AS
> $BODY$
> BEGIN
>tcount := tcount + 1;
>OPEN o_user FOR SELECT * FROM user_table;
>
I have the following function:
CREATE OR REPLACE FUNCTION test_refcursor(INOUT tcount integer, OUT
o_user refcursor, OUT o_name refcursor)
RETURNS record AS
$BODY$
BEGIN
tcount := tcount + 1;
OPEN o_user FOR SELECT * FROM user_table;
OPEN o_name FOR SELECT * FROM name_table;
END;
$BOD