--建立一个记录当前用户,及访问时间的过程
create table log_user (user_name varchar2(20),log_date date);
create or replace procedure u_log is
begin
insert into log_user (user_name ,log_date) values(user,sysdate);
commit;
end ;
create table log_user (user_name varchar2(20),log_date date,
frompc varchar2(20));
create or replace procedure u_log is
begin
insert into log_user (user_name ,log_date,frompc)
values(user,sysdate,userenv('terminal'));
commit;
end ;
--使用变量也可以
create or replace procedure u_log is
x varchar2(10);
y varchar2(20);
z date;
begin x:=user;
y:=userenv('terminal');
z:=sysdate;
insert into log_user (user_name ,log_date,frompc)
values(x,z,y);
commit;
end ;