I would like the hear the suggestions of you guys for a problem.
The issue is that I have PL/pgSQL function that returns a SETOF record. I need to call it inside a C++ program that will send input parameters to and receive the result set (50 rows) from this function. The input parameters are in a struct; the result set must be placed in a struct as well.
1) Function call. My initial attempt was to write something like this:
result R( T.exec( "SELECT * from function(input1, input2) as (f1 timestamp, f2 varchar, f3 char(10))" ) );
- Is that the best way to call a pl/pgsql function that returns records with pqxx?
- Do I really need to describe the anonymous record? since the result set is not a table type,
is there another option besides CREATE TYPE? (I am using PgSQL 8.1)
2) struct => function. How to send the input parameters via a struct?
3) Result Set => struct. I am leaned to use a result::const_iterator loop to feed the output struct. Is that a good option?
best regards,
-Rilson
_______________________________________________ Libpqxx-general mailing list [email protected] http://gborg.postgresql.org/mailman/listinfo/libpqxx-general
