Oracle数据库中基本动态Web开发和应用
http://tech.ddvip.com 2007年05月06日 社区交流
本文详细介绍Oracle数据库中基本动态Web开发和应用
3、利用WebServer和PL/SQL开发动态Web实例
现有一考生成绩库需在网上向用户提供查询成绩的功能。首先可考虑利用HTP程序包根据用户输入的考生号到数据库中查询相应的信息,返回一个网页。代码如下:
Create or replace procedure score_into_webpage (code_in in number)
As
cursor score_cursor is
select code,name,score
from student
where code = code_in;
Begin
Htp.htmlopen;
Htp.headopen;
Htp.title ('Student's score information');
Htp.headclose;
Htp.bodyopen (cattributes=>'bgcolor = "#80800"');
Htp.tableopen(border');
Htp.tablecaption ('Score Information','center');
Htp.tablerowopen;
Htp.tableheader (' Student Code');
Htp.tableheader (' Student Name');
Htp.tableheader (' Student Score');
--固定地显示页标题、标题、表头等信息,每次调用此页时显示的信息
--是相同的
Htp.tablerowclose;
For score_rec in score_cur
Loop
--利用游标的For循环为游标在网页中产生一个数据行
htp.tablerowopen;
htp.tabledata (score_rec.code);
htp.tabledata (score_rec.name);
htp.tabledata (score_rec.score);
htp.tablerowclose;
Endloop;
Htp.tableclose;
Htp.bodyclose;
Htp.htmlclose;
End;通过以上代码,我们有了一个基本的用数据库中的数据动态的生成一个网页的方法,下面将建立一个简单的表单。在表单中调用上述程序和接受用户输入的考生号码,从而在客户端向用户动态地显示从数据库中查询的信息。
责编:豆豆技术应用
正在加载评论...
- Oracle 10g 教程
- Oracle 故障处理
- Oracle 存储过程
- Oracle 备份恢复
- Oracle 性能调优
- Oracle 9i 教程
- Oracle 11g 教程
- Oracle 启动
- Oracle 命令
- Oracle 数据库管理
- Oracle 时间
- Oracle 密码
- Oracle 用户
- Oracle 常见错误
- Oracle 建数据表
- Oracle 索引
- Oracle 数据库连接
- Oracle 锁
- Oracle RAC 专题
- Oracle exp/imp 命令
- Oracle 表空间
- Oracle 查询
- Oracle 函数
- Oracle PL/SQL 专题
- 更多Oracle 专题>>>