I created a package and I want to create a temporary table inside stored procedure in this package body. But I can not do this because of giving an error message saying insufficient privileges. I can create tables but inside stored procedure, I can not do. Please anyone can help me to create a temporary table inside stored procedure?
create or replace PACKAGE BODY PKG_MY_TESTING AS
PROCEDURE PRC_MY_TESTING_DATA(DATE DATE, ID NUMBER)
IS
EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE all_muster_ids
ON COMMIT DELETE ROWS AS
SELECT *
FROM MY_TABLE';
COMMIT;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
END PRC_MY_TESTING_DATA;
END PKG_MY_TESTING;