2006年4月5日
摘要: --创建过程create or replace procedure 过程名 as 声明语句段;begin 执行语句段;exception 异常处理语句段;end;--修改过程--在企业管理器中.方案/过程/用户名/过程名--执行过程begin过程名;end; 阅读全文
posted @ 2006-04-05 14:55 kuning的程序博客 阅读(928) 评论(0) 推荐(0)
摘要: 游标是从数据表中提取出来的数据,以临时表的形式存放在内存中,再游标中有个数据指针,在初始状态下指向的是首记录,利用fetch语句可以移动该指针,从而对游标中的数据进行各种操作,然后将操作结果写回数据表中.游标在oracle当中作为一种数据类型存在. --定义游标cursor 游标名 is select 语句;--打开游标open 游标名--提取游标数据fetch 游标名 into 变量名... 阅读全文
posted @ 2006-04-05 14:43 kuning的程序博客 阅读(325) 评论(0) 推荐(0)
摘要: 1.条件控制: if 条件 then 语句段;end if; if 条件 then语句段1;else语句段2;end if; if 条件1 then if 条件2 then 语句段1 else 语句段2 end if;else 语句段3;end if; 2.循环控制 loop 循环语句段; if 条件语句 then exit; else 退出循... 阅读全文
posted @ 2006-04-05 14:14 kuning的程序博客 阅读(210) 评论(0) 推荐(0)
摘要: 基本数据类型: 1 Number------------数字型 Int----整数型2 Pls_integer-------整数型,产生溢出时出现错误3 Binary_integer----整数型,表示带符号整数 4 Char--------------定长字符型,最大255个字符5 Varchar2----------变长字符型,最大2000个字符6 Long--------------变长字... 阅读全文
posted @ 2006-04-05 13:41 kuning的程序博客 阅读(382) 评论(0) 推荐(0)
摘要: 首先给出一段小程序: 1 set serveroutput on 2 declare 3 maxrecords constant int:=100; 4 i int:=1; 5 begin 6 for i in 1..maxrecords loop 7 insert into testtable(recordnumber,currentdate) 8 values(i,sysdate) 9 ... 阅读全文
posted @ 2006-04-05 13:04 kuning的程序博客 阅读(185) 评论(0) 推荐(0)
摘要: oracle9i种引用表的方式一般是用户名.表名的格式.几种较复杂的SQL.1:非等值查询例句:select emp.empno,emp.ename,emp.deptno,dept.dname,dept.doc from scott.emp,scott.dept where scottemp.deptno!=scott.dept.deptno and scott.emp.deptno=10;2:嵌... 阅读全文
posted @ 2006-04-05 11:38 kuning的程序博客 阅读(368) 评论(0) 推荐(0)