温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

oracle索引的使用

发布时间:2021-09-01 17:27:55 来源:亿速云 阅读:138 作者:chen 栏目:关系型数据库

这篇文章主要讲解了“oracle索引的使用”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“oracle索引的使用”吧!

----

索引

反键索引

t1   colour  varchar2(20)

index

blue           1

blue             2

red                3

7788   AAAAAAAA

7900   AAAA

7901   AAAAA

7788  100

7900  010

7901 001

OLAP

PL/SQL----------Procedure  Language  SQL  过程化的SQL语言

PL/SQL 基本组成  “块"

声明部分        declare

变量  类型  游标

执行部分

begin  ...end ;

SQL 语句

异常处理部分     exception

捕获执行体里面报错/并且可以进一步处理

---执行体

begin

grant select on emp to scott;

end;

/

dql---select sal from emp where empno=7788;

dml---update emp set sal=123;

tcl---commit;

ddl---drop table emp;

dcl---grant select on emp to scott;

DQL----into 

DDL DCL----动态SQL

----

begin

dbms_output.put_line('hello word !!!!!');

end;

/

----------声明部分

变量

declare

变量名字  变量类型   【初始值】  ;

查询scott工资

select  sal from emp where empno=7788;

  1  declare

  2  vsal number;

  3  begin

  4    select sal into  vsal from emp where empno=7788;

  5    dbms_output.put_line(vsal);

  6* end;

ABC[4]

extend 

数组      PL/SQL表

 记录 

id  number

----------数组---------

declare

type   a_varrary  is varray(11)  of number;

         va    a_varrary ;

begin

va := a_varrary();

va.extend(11);

select sal,deptno,mgr into va(1),va(2),va(3)  from emp where ename='SCOTT' ;

dbms_output.put_line(va(1)||'--'||va(2)||'----'||va(3));

end;

/

--------PL/SQL表-------

declare

type   a_table  IS  TABLE   of varchar2(10)  index by binary_integer;

va     a_table ;

begin

va(2) := 'abc';

va(3) :='ddd';

end;

/

感谢各位的阅读,以上就是“oracle索引的使用”的内容了,经过本文的学习后,相信大家对oracle索引的使用这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI