Hi all,


Please tell me what's going wrong with following script.

DECLARE
t_command varchar2(200);
t_cid integer;
stat integer;
CURSOR c1 IS
select SID, SERIAL# from V$SESSION where username= ;
my_sid NUMBER;
my_serial# NUMBER;
BEGIN
OPEN c1;
LOOP
EXIT WHEN c1%NOTFOUND;
FETCH c1 INTO my_sid, my_serial#;
t_command := 'alter system kill session 'my_sid, my_serial#'';
t_cid := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(t_cid,t_command,dbms_sql.native);
stat := DBMS_SQL.EXECUTE(t_cid);
END LOOP;
DBMS_SQL.CLOSE_CURSOR(t_cid);

close c1;
END;
/

Thanks in advance