"Sergey E. Volkov" <[EMAIL PROTECTED]> wrote in message 
news:<9ej088$ulc$[EMAIL PROTECTED]>...
> If you are planing  to use ecpg :
> 
> exec sql declare cuserbase cursor for
>      select column1, column2, column3 from my_table order by 1;
> exec sql open cuserbase;

Thanks, but this is exactly what I am trying to avoid - having select statements 
in client applications.

I want to write stored procedures with all the logic and give the names 
and parameters to my developers, so they could just do the fetch.

In this case, I'll be free to change any underlying logic - tables' names, 
column names, select statements itself, add some extra logic to the 
where clause etc

Alla

P.S. If you are curious, I found something like this:

create function edf_load_user_base()
returns setof edv_user_base as '
select * from edv_user_base
where ... (complex where clause)'
language 'sql';

And then call it as following:

select column1(edf_load_user_base()), column2(edf_load_user_base()) etc

Does anybody know how I can return setof of something other than table%rowtype, 
i.e. can I define a record type my_record and do something like this:

create function edf_load_user_base()
returns setof my_record
....

Sorry to be a pain, but I have a deadline to do the migration and
not enough time to do my research :-((

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to