随笔分类 -  Oracle

摘要:-- 过程 函数---------- -- 过程 ---------- create or replace procedure pro_printemp is -- 定义部分 cursor cur_emp is select * from emp; begin -- 执行部分 for v_row in cur_emp loop dbms_output.put_line(... 阅读全文
posted @ 2017-06-01 16:38 DaryllD 阅读(197) 评论(0) 推荐(0)
摘要:--打开日志输出 set serverout on -- PL/SQL 语句块: -- 声明部分 declare v_i number; v_sum number:=0; -- 执行部分 begin v_i := 1; -- 简单loop循环 loop v_sum:=v_sum+v_i; v_i:=v_i+1; if v_i>100 then ... 阅读全文
posted @ 2017-06-01 15:39 DaryllD 阅读(810) 评论(0) 推荐(0)
摘要:select * from (select REGEXP_SUBSTR(sp.str, '[^,]+', 1, rownum) as tt from dual,(select '陈仓区支行,汉滨区支行,3' str from dual) sp CONNECT BY ROWNUM <= LENGTH( 阅读全文
posted @ 2017-05-02 16:51 DaryllD 阅读(195) 评论(0) 推荐(0)
摘要:Exp/Imp是Oracle备份数据的两个命令行工具 1.本地数据库导入导出 1.导出 (运行 cmd中操作) exp 用户名/密码@数据库实例名file=本地存放路径 eg: exp jnjp/jnjp@ORCL file=C:/jnjp.dmp 2.导入 imp 用户名/密码@数据库实例名fil 阅读全文
posted @ 2017-04-22 14:46 DaryllD 阅读(184) 评论(0) 推荐(0)
摘要:--1新建用户 create user champion identified by century; -- Create the user create user test identified by test default tablespace RISKCTRL; -- Grant/Revoke role privileges grant resource to test; grant... 阅读全文
posted @ 2017-04-11 22:03 DaryllD 阅读(175) 评论(0) 推荐(0)
摘要:查询父节点 SELECT * FROM r_org org START WITH org.org_code = '6199840Q' CONNECT BY PRIOR PARENT_ID = ID; select * from r_org org where org.org_code = '6100 阅读全文
posted @ 2017-04-11 21:46 DaryllD 阅读(2100) 评论(0) 推荐(0)