摘要:
select seq.nextval from dual; --假设值是30 alter sequence seq increment by -30; select seq.nextval from dual; --会得到0 alter sequence seq increment by 1; 阅读全文
摘要:
在oracle 中使用 select 字段 into 变量 from 表 where 条件 这种方法给变量赋值时和MSSQL的行为有比较大区别. 在MSSQL中如果在该表中未检索到任何行,则变量的值保持不变,如果检索到多条数据,则会将每一条数据的值依次赋给变量(顺序不保证永远相同) .但是在orac 阅读全文
摘要:
Oracle “CONNECT BY”是层次查询子句,一般用于树状或者层次结果集的查询。其语法是: 1 [ START WITH condition ]2 CONNECT BY [ NOCYCLE ] conditionThe start with .. connect by clause can 阅读全文
摘要:
--第一种方式:使用raise_application_error抛出自定义异常declare i number:=-1;begin if i=-1 then raise_application_error(-20000,'参数值不能为负'); --抛出自定义异常 end if; exception 阅读全文