call procedure/function from web-page [message #37406] |
Wed, 06 February 2002 04:50  |
Armani D
Messages: 19 Registered: February 2002
|
Junior Member |
|
|
Hello All,
I need a procedure or function that can take a paramater of userid passed on by a web-page written in ASP to call a killuser procedure.
Pratap has helped me write the following:
set serveroutput on
create or replace procedure killuser (userid in varchar2) as
v_command varchar2(100);
serial_no varchar2(10);
sid_no varchar2(10);
os_user varchar2(10);
begin
select sid,serial#,osuser
into sid_no,serial_no,os_user
from v$session
where osuser = userid;
LOOP
v_command :='ALTER SYSTEM KILL SESSION '''||sid_no || ',' || serial_no ||'''';
dbms_output.put_line(v_command);
dbms_output.put_line('INSERT INTO WAREHOUSE.KILL_AUDIT(COMMAND,USERNAME,OSUSER,DATE_EXECUTED)');
dbms_output.put_line('VALUES(V_COMMAND,USER,OS_USER,SYSDATE)');
COMMIT;
END LOOP;
end;
However, I need for this to return a value back to the web-server when it executes completely so that it can return a message back to the user. Should this be re-written as a function? How can I do that? How will the web-server call it?
Thanks for your help!!
Armani
|
|
|
|