_ (: _"∠) _ _ (: _"∠) _ _ (: _"∠) _ Cheat Traffic Series _ (: _"∠) _ _ (: _"∠) _ _ (: _"∠) _
Title Description:
The names of all employees in the employee table are treated as follows: The first letter of the name is between ' A ' and ' G ', merged into the first string, between ' H ' and ' O ', merged into a second string, between ' P ' and ' Z ', merged into a third string, separated by a space between the names.
Code:
DECLAREstr1 String ( -); str2 string ( -); Str3 string ( -);CURSORName_ag isSELECTEname fromEmpWHERESUBSTR (ename,0,1)between 'A' and 'G'; name1 Emp. Ename%TYPE;CURSORName_ho isSELECTEname fromEmpWHERESUBSTR (ename,0,1)between 'H' and 'O'; name2 emp. Ename%TYPE;CURSORName_pz isSELECTEname fromEmpWHERESUBSTR (ename,0,1)between 'P' and 'Z'; Name3 emp. Ename%TYPE;BEGINOPENName_ag;OPENName_ho;OPENName_pz; LOOPFETCHName_ag intoname1; EXIT whenName_ag%NOTFOUND; STR1:=Str1||Name1||' ';ENDLOOP; LOOPFETCHName_ho intoname2; EXIT whenName_ho%NOTFOUND; STR2:=str2||Name2||' ';ENDLOOP; LOOPFETCHName_pz intoName3; EXIT whenName_pz%NOTFOUND; STR3:=Str3||Name3||' ';ENDloop;dbms_output.put_line (str1);d bms_output.put_line (str2);d bms_output.put_line (STR3);END;
PL/SQL on-machine Practice (i)