oracle 基础 控制机构+赋值
--变量赋值
declare
identity :=0;
a varchar2(59,0);
b varchar2(50):='abc';
a :='cba';
-- 控制语句
----------------------------------
if a>b then
.........
end if;
------------------------------------
if a>b then
.....
else
.....
end if;
-----------------------------------
if a>b then
........
elsif c>b then
........
else
..........
end if;
-----------------------------------
case variable
when 'tt' then 'value1'
when 'mm' then 'value2'
when 'nn' then 'value3'
else value4
end;
--------------------------------------
while t<10000000 loop
........;
end loop;
--------------------------------------
for 1_counter in 1-10
loop
statements;
end loop;
---------------------------------------
for 1_counter in reverse 1..10
loop
statements;
end loop;
相关文档:
Redo Byte Address (RBA)
Recent entries in the redo thread of an Oracle instance are addressed using a 3-part redo byte address, or RBA. An RBA is comprised of
the log file sequence number (4 bytes)
the log file block number (4 bytes)
the byte offset into the block at which the redo record sta ......
DB2 转Oracle
某天是星期几的函数
DB2:
select a.yyxe,a.zblb,a.ysdm,a.daynum,b.zjxm from zy_yspb a ,zy_zjlb b where a.ysdm=b.id and a.ksdm=10000 order by abs( a.daynum -DAYOFWEEK(current date)+1) desc,a.daynum,a.zblb
sql.executeQuery:ORA-00936: 缺失表达式
Oracle :
......
分区表维护的常用命令:
ALTER TABLE
-- DROP -- PARTITION
-- ADD |
-- RENAME |
-- MODIFITY |
-- TRUNCATE |
-- SPILT |
-- MOVE |
-- EXCHANGE |
分区索引的常用维护命令:
ALTER INDEX
-- DROP -- PARTITION
-- REBUILD |
-- RENAME |
-- MODIFITY |
-- SPILT |
-- PARALLEL
-- UNUSABLE
1、ALTER ......
用户名与口令相同使得口令易于记忆和猜测,但口令也容易被破译,因此作为数据库管理员应该及时检查用户的设置,避免用户名与口令相同,消除不安因素。
创建查询子程序:
SQL> create or replace procedure sys.find_the_same as
hex_password varchar2(30);
trans_password varchar2(30);
v_username varchar2(30); ......