I Have this procedure that I want to convert to a pipeline function.
Its from this discussion:
sql - recursive permutation algorithm in plsql - Stack Overflow
The original solution from stackflow works but once I try to convert it to pipeline function it fails. I am on oracle12c
The compile error is
Compilation failed,line 16 (21:41:43)
PLS-00221: 'PRINT_ANAGRAMS2' is not a procedure or is undefinedCompilation failed,line 16 (21:41:43)
PL/SQL: Statement ignored
My code is
CREATE OR REPLACE EDITIONABLE TYPE "T_TF_ROW" AS OBJECT (
--id NUMBER,
description VARCHAR2(500)
)
/
CREATE OR REPLACE EDITIONABLE TYPE "T_TF_TAB" IS TABLE OF t_tf_row
/
create or replace function print_anagrams2
(pre in varchar2, str in varchar2) RETURN t_tf_tab PIPELINED AS
prefix varchar2(30);
stringg varchar2(30);
strlen number;
begin
strlen := length(str);
if NVL(strlen, 0) = 0 then
--dbms_output.put_line(pre);
--PIPE ROW(t_tf_row(i, 'Description for ' || i));
PIPE ROW(t_tf_row(pre));
else
for i in 1..strlen loop
prefix := pre || SUBSTR(str,i,1);
stringg := SUBSTR(str,1,i - 1) || SUBSTR(str,i+1,strlen);
print_anagrams2(prefix,stringg);
end loop;
end if;
end;
Message was edited by: kayaman808