Oracle数组入门
Oracle数组一般可以分为固定数组和可变数组
固定数组
Sql代码
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_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;
可变数组
一维数组
Sql代码
declare
type v_table is table of varchar2(30) index by binary_integer;
--类型可以是前面的类型定义,index by binary_integer子句代表以符号整数为索引,
--这样访问表类型变量中的数据方法就是“表变量名(索引符号整数)”。
my_table v_table;
begin
for i in 1..20
loop
my_table(i):=i;
dbms_output.put_line(my_table(i));
end loop;
end;
declare
type v_table is table of varchar2(30) index by binary_integer;
--类型可以是前面的类型定义,index by binary_integer子句代表以符号整数为索引,
--
相关文档:
select table_name from user_tables; //当前用户的表
select table_name from all_tables; //所有用户的表
select table_name from dba_tables; &n ......
以前只知道java能调用oracle存储过程和函数,但今天我发现原来oracle也可以调用java
测试环境oracle 10g
call dbms_java.set_output(5000);
--首先在oracle中编译java文件 以下是个简单的
create or replace and compile java source named helloworld as
public class hellowor ......
-----------------------------------------------------------------------------------
DOS:
1. sqlplus
2.
用户名:sqlplus 、conn
密码:as sysdba 、as sysdba
解锁:
3. ALTER USER DBSNMP ACCOUNT UNLOCK;
解锁:system
4. alter user system identified by manage ......
查看session等待事件:
select sid,event from v$session_wait where event not like 'rdbms%' and event not like 'SQL*Net message%';
按pid查看正在执行的程序:
select sid,program from v$session b where paddr in (selec ......
(1)数据库锁的基本概念
基本锁类型有两种:排他锁(Exclusive locks)记为X锁 , 共享锁(Share locks)记为S锁。
排他锁:若事务T对数据D加X锁,则其他事务都不能再对D加任何类型的锁,直至T释放D上的X锁;一般要求在修改数据前要向该数据加排他锁,所以排他锁又称为写锁。
&nb ......