我正在尝试运行一个排列给定字符串的递归过程。它在 sqldeveloper 上编译,但是当我尝试使用输入运行时,它给了我 ora-06502: numeric or value errors on line 13(前缀分配)
create or replace
procedure print_anagrams
(pre in varchar2, str in varchar2)
is
prefix varchar2(30);
stringg varchar2(30);
strlen number;
begin
strlen := length(str);
if strlen = 0 then
dbms_output.put_line(pre);
else
for i in 1..strlen loop
prefix := pre || SUBSTR(str,i,1);
stringg := SUBSTR(str,1,i) || SUBSTR(str,i+1,strlen);
print_anagrams(prefix,stringg);
end loop;
end if;
end;