摘要: 安装步骤 阅读全文
posted @ 2016-04-08 17:14 留下 阅读(529) 评论(0) 推荐(0) 编辑
摘要: /* 循环开始 */declare i number;beginfor i in 12..21 loopINSERT INTO liutest (id,name,password,age,address,phone,flag) VALUES (i,'liu','liuaaa',20,'testaddress','12121212122','1');end loop;end;/* 循环结束 *//* 游标开始 */set serveroutput on declare Lid liutest.id%type;Lnam 阅读全文
posted @ 2011-03-09 15:16 留下 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 1 .使用 %type 定义变量 为了让PL/SQL中变量的类型和数据表中的字段的数据类型一致,Oracle 9i提供了%type定义方法。 这样当数据表的字段类型修改后,PL/SQL程序中相应变量的类型也自动修改. /**//* Declare mydate student.sdate%type; begin commit; end; */ 2. 定义记录类型变量 将多个基本数据类型捆绑在一起的记录数据类型。 /**//* set serveroutput on declare type myrecord is record( sid int, sname varchar2(50)); sr 阅读全文
posted @ 2011-03-09 15:14 留下 阅读(466) 评论(0) 推荐(0) 编辑
摘要: Oracle数组一般可以分为固定数组和可变数组 固定数组declare type v_ar is varray(10) of varchar2(30); my_ar v_ar:=v_ar('g','m','d','龚','帅'); begin for i in 1..my_ar.count loop dbms_output.put_line(my_ar(i)); end loop; end; 可变数组 一维数组 declare type v_table is table of varchar2(30) index 阅读全文
posted @ 2011-03-09 15:13 留下 阅读(5752) 评论(0) 推荐(0) 编辑
摘要: 1.字符函数 Upper() 大写 select upper(name) from liutesttable; ------'LIU' Lower() 小写 select lower(name) from liutesttable; -------'liu' Initcap() 首字母大写 select initcap(name) from liutesttable; -------'Liu' Concat() 将字符或列值连接 select concat(name,age) from liutesttable; -----'liu33& 阅读全文
posted @ 2011-03-09 15:09 留下 阅读(300) 评论(0) 推荐(0) 编辑