Home » SQL & PL/SQL » SQL & PL/SQL » call procedure/function from web-page
call procedure/function from web-page [message #37406] Wed, 06 February 2002 04:50 Go to next message
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
Re: call procedure/function from web-page [message #37407 is a reply to message #37406] Wed, 06 February 2002 05:52 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
Hi,

You are killing the user session and then telling to send a message to him(by the webserver).can u clarify ?

cheers
pratap
Previous Topic: Error while partitioning the Index: GLOBAL partitioned index must be prefixed??
Next Topic: ORA-00979 : not a GROUP BY expression
Goto Forum:
  


Current Time: Tue Apr 23 14:19:33 CDT 2024