您好,欢迎来到二三四教育网。
搜索
您的当前位置:首页oracle相关使用记载

oracle相关使用记载

来源:二三四教育网

好记性不如烂笔头。

三、oracle相关使用记载

3.1、oracle函数调用

declare  user_id number;
begin 
 for i in (SELECT distinct t1.user_id FROM t_user t1 left join t_user_category t2 on t1.user_category_id = t2.user_category_id where CATEGORY_TYP = '00001'
and t1.user_id not in (
select distinct(user_id) from t_user where  user_category_id in (123,234)) 
 loop
             select SEQ_USER.NEXTVAL into user_id from dual;
             insert into t_user(user_ID,
             MBR_ID,
             user_CD,
             USER_CATEGORY_ID,
             USER_CATEGORY_CD,
             REGISTER_IP,
             USER_CODE,
             START_DATE,
             STUS,
             CREATE_TIM,
             CREATE_BY)
             values(mbrship_id,
             i.mbr_id,
             ('123'+mbrship_id),
             123,
             '634634643',
             '123.123.123.123',
             'test',
             sysdate,
             '1',
             sysdate,
             'DBA');
   end loop;
   commit;   
end;
Paste_Image.png

3.2 、创建序列,以多少开始字增多少

create sequence mbr_s_mbr_config
increment by 1
start with 10000
nomaxvalue
nocycle cache 10;

3.3、oracle调用存储过程

 begin
PRC_ULM_POINT_FORFEIT ('2016-12-01', '2016-12-31');
end;

3.4、oracel分页问题

查询某条数据:
select m.* from (select rownum rn,t.* from t_user t ) m where rn=6;

查询分业务数据
select m.* from (select rownum rn,t.REGISTER_ID from t_user t) m where rn between 20000000 and 20000010

3.5、查看查询情况

Paste_Image.png Paste_Image.png Paste_Image.png

3.6 查看表的空间大小

select owner,segment_name, bytes/ 1024 / 1024 / 1024 GB from dba_segments
where tablespace_name='USER_TAB' and segment_name = 'T_user'

Copyright © 2019- how234.cn 版权所有 赣ICP备2023008801号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务