I have a function that receives a value in varchar2 with the name of Schema in order to write the data in the database but in the informed schema.
create or replace FUNCTION hospitalTeste123(MatriculaMedico in number, nomeSchema in varchar2 ) return varchar is
MATMEDICO nomeSchema.Tmedico.MATMEDICO%type;
begin
/*corpo da função*/
RETURN MatriculaMedico||''||nomeSchema;
end;
Error message:
Error (4,11): PLS-00487: Invalid reference to variable 'NOMESCHEMA'
How can I pass the schema on the function?