I see people writing a function 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.
+3
A:
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.
Jeffrey Kemp
2010-05-18 05:37:20
Thanks for the explanation.
sqlgrasshopper5
2010-05-18 05:40:35