Good afternoon, perhaps someone has encountered a problem.
I want to use a function from postgresql in cognos that returns the cursor.
CREATE TABLE test AS
SELECT
('{a,b,c,d,e,f}'::text[])[1 + FLOOR(random() * 6)] AS type_1,
('{m,n,o,p,q,r}'::text[])[1 + FLOOR(random() * 6)] AS type_2,
random() * 1000 AS some_float
FROM generate_series(1,20000);
CREATE OR REPLACE FUNCTION test_cur_cognos() RETURNS setof test AS $$
DECLARE
ref refcursor; -- Declare a cursor variable
BEGIN
SELECT type_1, type_2, some_float FROM test; -- Open a cursor
-- Return the cursor to the caller
END;
$$ LANGUAGE plpgsql;
Cognos refuses to accept a function as a data source. Perhaps someone has a solution how to implement this through the procedure?
------------------------------
Илья Буланов
------------------------------
#CognosAnalyticswithWatson