Thread: rowtype and ecpg

rowtype and ecpg

From
alla@sergey.com (Alla)
Date:
I have a function that takes as a parameter ROWTYPE:

create or replace function test_func(test_table) 
returns varchar as '
declare  lv_return   varchar;
begin  ......  return lv_return;
end;
' LANGUAGE 'plpgsql';

How do I call this function from the C program (ecpg)? How my
declaration should look like?

I trued structure and got error: Too many arguments

Thanks for your help


Re: rowtype and ecpg

From
Christoph Haller
Date:
What exactly is your problem? 
Calling a plpgsql function from within a C program 
or retrieving varchar data within a C program? 
Regards, Christoph 

> 
> I have a function that takes as a parameter ROWTYPE:
> 
> create or replace function test_func(test_table) 
> returns varchar as '
> declare
>    lv_return   varchar;
> begin
>    ......
>    return lv_return;
> end;
> ' LANGUAGE 'plpgsql';
> 
> How do I call this function from the C program (ecpg)? How my
> declaration should look like?
> 
> I trued structure and got error: Too many arguments
> 
> Thanks for your help





Re: rowtype and ecpg

From
alla@sergey.com (Alla)
Date:
My problem is a "rowtype" variable. 

I don't know how to declare a structure or anything else to pass
information to the function, which input parameter has a type of
"rowtype" (I have no problem retrieving any output - varchar or
refcursor)

Thanks

Alla