Friday, September 03, 2010

Give me a FUNCTION that...

DECLARE
i PLS_INTEGER:=0;
maxlen PLS_INTEGER:=0;
BEGIN
FOR j IN 1..str.COUNT LOOP
IF LENGTH(str(j))>maxlen THEN
maxlen:=LENGTH(str(j));
i:=j;
END IF;
END LOOP;
RETURN i;
END;
Doesn't compile (it's sort of PL/SQL if you wonder). Lacks some details (what's that str anyway). But you get the picture (it's job interview pseudocode ;o)

0 Comments:

Post a Comment

<< Home