I have a SAR protected oracle database from which I need to expose a table to PowerBI.
I am not familiar with PLSQL.
I have managed to expose a column of the table to PowerBI.
Help is needed in 2 areas
1) I require help from you guys to return selective columns from the table
2) I require help from you guys to return all the columns from the table
DROP TYPE testarr;
CREATE OR REPLACE TYPE testarr IS TABLE OF VARCHAR2(70);
/
GRANT EXECUTE ON testarr TO public;
DROP FUNCTION TestPowerBI
CREATE OR REPLACE FUNCTION TestPowerBI
RETURN testarr AUTHID CURRENT_USER AS
o_recorset SYS_REFCURSOR;
arr testarr := testarr();
pragma autonomous_transaction;
BEGIN
sar.pk_sar_enable_roles.............
commit;
OPEN o_recordset FOR
SELECT NAME FROM vw_people;
FETCH o_recordset BULK COLLECT INTO arr;
CLOSE o_recordset;
RETURN arr;
END TestPowerBI
Grant execute on TestPowerBi to public;