I am creating a package with dynamic queries to which I want to make a selection from an input parameter Table.
Inside the procedure I have:
querysql varchar2(100);
BEGIN
querysql := 'SELECT RPAD(NVL(description,' '),20,'n') FROM '||Tabla||'';
execute immediate querysql;
commit;
end;
If I made a selection of the normal field. Example:
querysql := 'SELECT description FROM '||Tabla||'';
There would be no problem but to tell him to fill in the empty spaces with the letter 'n' does not take it because it makes a mess with the strings.
I have tried to declare the variable space and fill to call it from the querysql as we do with tables but it does not work either. Example:
querysql varchar2(100);
espacio varchar2(1);
relleno varchar2(1);
BEGIN
espacio := ' ';
relleno := 'n';
querysql := 'SELECT RPAD(NVL(description,' ||espacio|| '),20,'||relleno||') FROM '||Tabla||'';
execute immediate querysql;
commit;
end;
Any solution?
Thank you very much !!!