I am stuck not able to iterate through values output from select statement.
My code :
CREATE OR replace PROCEDURE getdetails ( v_tb in VARCHAR2 )
AS
BEGIN
FOR i IN
(
SELECT table_name
FROM all_tables
WHERE table_name LIKE ''''
|| v_tb
|| '%'
|| '''' )
LOOP
DBMS_OUTPUT.PUT_LINE(i);
/*
My logic will be coming that I cannot share ...
*/
END LOOP;
END;
Calling
BEGIN
Getdetails('DEMO');
END;
Issue : The select statement is not getting initialized with v_tb
SELECT table_name
FROM all_tables
WHERE table_name LIKE ''''
|| v_tb
|| '%'
|| ''''
Any solution is much appreciated !!!