Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
function to check if reverse of a string s1 is a superstring of string s2.
declare str1 varchar2(100):='abacaab'; str2 varchar2(100):='aaca'; str varchar2(100); flag boolean := false; function checrk(a varchar2,b varchar2 ) return boolean as x boolean; begin str1:=a; str2:=b; for i in reverse 1..length(str1) loop str:=str|| substr(str1,i,1); end loop; --dbms_output.put_line(str); str1:=str; for i in 1..length(str1) loop for j in i .. length(str) loop if substr(str,i,j-i+1) = str2 then --dbms_output.put_line('yes'); return true; flag:=true; end if; end loop; end loop; if flag = false then --dbms_output.put_line('no'); return false; end if; end; begin flag:=checrk(str1,str2); if flag = true then dbms_output.put_line('yes'); else dbms_output.put_line('no'); end if; end;
run
|
edit
|
history
|
help
0
Train_Database
3
exception handling
create table
DBMS
display student details in pl/sql
procedure to calulate LCM of three numbers
My PLSQL
4
Srinivas