Hello,

 

I've been looking around how to read results from a PL/pgSQL stored
function, but I've only found information about executing stored procedures
(not actually reading).

 

I have the following stored PL/pgSQL function that returns a single row from
a certain table:

 

CREATE OR REPLACE FUNCTION get_row(row_id my_table.id%TYPE)

RETURNS RECORD AS $$

DECLARE

      result my_table%ROWTYPE;

BEGIN

      SELECT * INTO result FROM my_table WHERE id = row_id;

      RETURN result;

END;

$$ LANGUAGE plpgsql;

 

What is the correct SOCI code for reading the row returned by the previous
function? What if I need to return a TABLE instead of a RECORD?

 

Sincerely.

 

Erasmo Aguilera.

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
soci-users mailing list
soci-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to