开发者

using FUNCTION instead of CREATE FUNCTION oracle pl/sql

开发者 https://www.devze.com 2022-12-30 21:18 出处:网络
I see people writing a fu开发者_Python百科nction with FUNCTION instead \"CREATE FUNCTION\". When I saw this usage in the web I thought it was a typo or something. But in Oreilly\'s \"Oracle 11g PL/SQL

I see people writing a fu开发者_Python百科nction with FUNCTION instead "CREATE FUNCTION". When I saw this usage in the web I thought it was a typo or something. But in Oreilly's "Oracle 11g PL/SQL Programming" by Steven Feurenstein, the author had used the same thing. But I get errors when I execute that. Could somebody explain is it legal usage or not?. Thanks.


It depends on the context.

To create a standalone function, you would use CREATE FUNCTION ... or CREATE OR REPLACE FUNCTION ....

To declare a function within a package or type body, you would use FUNCTION ....

The CREATE keyword is a command, FUNCTION is the type of the object to be created.

Quite often the CREATE is omitted because a function may be specified in several different ways, and there is no need to enumerate them all.

0

精彩评论

暂无评论...
验证码 换一张
取 消