ORACLE 通过游标使用来了解cursor 的好处!
有了游标,就可以不用每条数据去检查是否符合条件,先看一下下面的:
--游标使用(游标其实是一个放入内存临时表)
declare
money cms3_simcard.card_fee%type :=0; --定义与表字段相同类型
cursor mycursor is --定义游标
select * from cms3_simcard
where return_flag = 1 and msisdn like '138%';
my_record mycursor%rowtype; --定义游标记录类型
Counter int :=0;
begin
open mycursor; --打开游标
if mycursor%isopen then --判断打开成功
loop --循环获取记录集
fetch mycursor into my_record; --获取游标中的记录
if mycursor%found then --游标的found属性判断是否有记录
dbms_output.put_line(my_record.card_fee);
else
exit;
end if;
end loop;
else
dbms_output.put_line('游标没有打开');
end if;
close mycursor;
end;
相关文档:
oracle表空间操作详解
1
2
3作者: 来源: 更新日期:2006-01-04
5
6
7建立表空间
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
C#连接Oracle数据库字符串
http://developer.51cto.com
2009-08-20 17:55 佚名 百度空间 我要评论(
0
)
C#连接Oracle数据库以及C#连接Oracle数据库字符串等内容将在本文中展现,希望本文能对大家了解C#连接数据库有所帮助。
C#连接Oracle数据库字符串(查询数据)
using
Syst ......
1.查看表空间:
SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
(B.BYTES*100)/A.BYTES "% USED",(C.BYTES*100)/A.BYTES "% FREE"
from SYS.SM$TS_AVAIL A,SYS.SM$TS_USED B,SYS.SM$TS_FREE C
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.T ......
OS :RHEL AS 4 oracle 10g
0备份脚本
#!/bin/bash
# incremental level 0 backup script
source /home/oracle/.bash_profile
current_day=`date +%Y%m%d`
mkdir /home/ora ......
1.数据库归档模式:
* 非归档模式:当数据库数据只读不会改变时,数据不会改变,数据库适合用非归档模式, 这样提高性能
&nb ......