Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> PL/SQL : Alternative way of doing if any
Dear Sir/Madam & others
i have one simple procedure to get some code if a string match exists. written procedure to achive this. but feel it is not an efficient one. can any one give altenative approch to this problem if any.
Thanks in advance for looking into this problem. You are all great people.
data for this procedure
SQL> exec gcode;
pathand file=D:\Google\oracle\@searchresult of
oracle\CDROM\__work\shiryou
tcode=T0000001
Procedure gcode
spthatandfile varchar2(512):='D:\Google\oracle\@searchresult of
oracle\CDROM\__work\shiryou';
/*
spthatandfile varchar2(512):='D:\Google\db2\@searchresult of
db2\CDROM\__work\shiryou';
the above data comes from the outer loop records
*/
tcode char(8);
CURSOR get_tcode_cur IS
SELECT TCODE FROM TMASTER tm WHERE INSTR( spthatandfile,'\'||tm.TFOLDER||'\',1)!=0 ;
begin
OPEN get_tcode_cur;
FETCH get_tcode_cur
INTO tcode;
IF (get_tcode_cur%NOTFOUND) THEN
tcode := '99999999';
END IF;
CLOSE get_tcode_cur;
DBMS_OUTPUT.PUT_LINE('pathand file='||spthatandfile); DBMS_OUTPUT.PUT_LINE('tcode='||tcode);
end;
![]() |
![]() |