以下的 J2EE 应用程序已经配置, 并且可用下面列出的 URL 来访问。数据库配置文件已经安装到 F:\oracle10g,同时其他选定的安装组件也已经安装到 F:\oracle10g\oracle10g。Ultra Search URL:http://lixiaoming-PC:5620/ultrasearchUltra Search
管理工具 URL:http://lixiaoming-PC:5620/ultrasearch/adminiSQL*Plus URL:
http://lixiaoming-PC:5560/isqlplusEnteprise Manager 10g Database Control URL:
3.1
create or replace function get_sal(eno number)
return varchar2
as
v_sal scott.emp.sal%type;
begin
select sal into v_sal
from scott.emp
where empno=eno;
return v_sal;
exception
when no_data_found then
raise_application_error(-20000,'该员工不存在!');
end get_sal;
执行:
>var sal number
>exec :sal:=get_sal(7369);
>print sal
3.2
create or replace function get_mgr_inf(eno number)
return varchar2
as
v_mgr scott.emp.mgr%type;
begin
select mgr into v_mgr
from scott.emp
where empno=eno;
return v_mgr;
exception
when no_data_found then
arise_application_error(-20000,'该员工不存在!');
end get_mgr_inf;
执行:
> var mgr varchar2(20)
>exec :mgr:=get_mgr_inf(7369);
>print mgr
3.3
create or replace function get_inf(eno number,v_name out varchar2,v_sal out number,v_dno out number)
return varchar2
as
v_name scott.emp.ename%type;
begin
select ename,sal,deptno into v_name,v_sal,v_dno
from scott.emp
where empno=eno;
return v_name;
exception
when no_data_found then
arise_application_error(-20000,'该员工不存在!');
end get_inf;