is 与 as pl/sql

发布于 2024-09-02 02:56:58 字数 497 浏览 2 评论 0原文

我认为对于函数和过程,oracle 将“is”和“as”视为相同。我尝试使用“pl/sql is vs as”进行谷歌搜索,并得到以下链接,其中表明两者是相同的。

PL/SQL 的 IS 与 AS 关键字Oracle函数或过程创建

但我发现http: //www.adp-gmbh.ch/ora/plsql/coll/declaration.html#index_by 这似乎表明存在差异。有人可以(列出/指向我一个链接)使用“is/as”产生影响的其他上下文吗?

谢谢。

I thought that oracle treats both "is" and "as" same for functions and procedures.I tried googling with "pl/sql is vs as" and got the following link which says both are the same.

IS vs AS keywords for PL/SQL Oracle Function or Procedure Creation

But I found http://www.adp-gmbh.ch/ora/plsql/coll/declaration.html#index_by which seems to indicate there is a difference. Could somebody (list/point me to a link) the other contexts where using "is/as" makes a difference?.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梨涡少年 2024-09-09 02:56:58

举例来说(并非全部都是 PL/SQL):

[CREATE] PROCEDURE x IS|AS ...
[CREATE] FUNCTION x IS|AS ...
CREATE PACKAGE [BODY] x IS|AS ...
CREATE TYPE [BODY] x IS|AS ...

CURSOR x IS ...
TYPE x IS ...
SUBTYPE x IS ...

CREATE TABLE x AS subquery
SELECT x AS "y" FROM z AS "w"
WITH x AS (SELECT ...

因此,IS 所在的地方并不总是允许 AS,而 IS 所在的地方并不总是允许 IS AS 是:)

我认为这只是该语言的怪癖之一。一般来说,我认为 IS 更常见,除非 AS 是唯一的选项(如上面的 SQL 示例)。 Oracle 文档中的大多数示例似乎都使用 IS,我个人认为这是我的偏好,因为它在语义上更适合。

参考资料:

Oracle SQL 参考 11gR1

Oracle PL/SQL 参考 11gR1

By example (not all are PL/SQL):

[CREATE] PROCEDURE x IS|AS ...
[CREATE] FUNCTION x IS|AS ...
CREATE PACKAGE [BODY] x IS|AS ...
CREATE TYPE [BODY] x IS|AS ...

CURSOR x IS ...
TYPE x IS ...
SUBTYPE x IS ...

CREATE TABLE x AS subquery
SELECT x AS "y" FROM z AS "w"
WITH x AS (SELECT ...

Therefore, AS is not always allowed where IS is, and IS is not always allowed where AS is :)

Just one of those quirks of the language, I think. Generally, IS is more common, I think, except where AS is the only option (as in the SQL examples above). Most of the examples in the Oracle docs seem to use IS, and personally that's my preference as it fits better semantically, in my opinion.

References:

Oracle SQL Reference 11gR1

Oracle PL/SQL Reference 11gR1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文