Problem : accessing record from a cursor returned from postgresql
posted 12 years ago
Hi, I have written a stored function in postgreSQL which returns a cursor and trying to access the records of the RecordSet using jdbc callable statements. The result is that it is not displaying anything and the resultset seems to be empty. kindly please guide me as how to approach to achieve the said task. My code looks like this
stored function --------------- CREATE or REPLACE FUNCTION doQuery(refcursor) RETURNS refcursor AS ' DECLARE ref refcursor; BEGIN open $1 for select * from test; RETURN $1; END; ' LANGUAGE plpgsql;
We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.