您的位置:首页 > 数据库 > Oracle

Oracle中的AS和IS的不同及使用【整理】

2017-05-27 10:59 197 查看


Oracle中的AS和IS的不同,以及使用,两者基本上没有不同 。

AS和IS是ORACLE为了方便而设置的同义词。

何时使用

1、在创建存储过程(PROCEDURE)/函数(FUNCTION),以及自定义类型(TPYE)和包(PACKAGE)时,使用AS和IS无区别。

2、在创建视图(VIEW)时,只能使用AS而不能使用IS。

3、在声明游标(CURSOR)时,只能使用IS而不能使用AS。

create [or replace] procedure procedure_name
[(parameter_name [in | out | in out] type [,........])]
{is | as}
begin
procedure_body
end procedure_name;
create or replace view v_department as
select * from department where ......;


--显式游标
cursor student_cursor is select sname from student; --显式游标声明

--REF游标 动态游标
type ref_cursor is ref cursor; --声明一个ref游标类型
tab_cursor ref_cursor ;--声明一个ref游标
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: