PL/SQL function problem

From: Mike West <mwest_at_hort.cri.nz>
Date: 1997/01/09
Message-ID: <32D561E3.3824_at_hort.cri.nz>#1/1


[Quoted] I have to following function which i want to return whether a user has a specified role assigned and then return the answer to a paradox app.

Can someone tell me why the function always returns 'NORMAL ACCESS' even though the desired role is assigned for the user.

FUNCTION DETERMINEACCESS
RETURN varchar2
IS
BEGIN
declare
cursor c1 is
  select ROLE from SESSION_ROLES;

Role_value varchar2(30);

BEGIN
open c1;
fetch c1 into Role_value;

while c1%FOUND
LOOP
   if Role_value = 'ADMIN_ROLE' then

        return('ADMIN ACCESS');
   end if;
   fetch c1 into Role_value;
END LOOP; return('NORMAL ACCESS');
close c1;
END;
END; Received on Thu Jan 09 1997 - 00:00:00 CET

Original text of this message