'Pass PL/SQL parameter as SCHEMA NAME

I'm trying to send variable schema name to cursor via procedure input Here is my lame try, but you can see what I want to do:

CREATE OR REPLACE PROCEDURE HOUSEKEEPING 
(SCHEMANAME in varchar2)

IS

CURSOR data_instances  IS  select table_name 
from SCHEMANAME.table_name where TYPE='PERMANENT' and rownum<200 ;

BEGIN
    DBMS_OUTPUT.PUT_LINE(SCHEMANAME);
END;
/

it throws expected

PL/SQL: ORA-00942: table or view does not exist

is there lawful way to make schema name work as variable? thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source