Using FUNCTION instead of CREATE FUNCTION oracle pl / sql
I see people writing a function with FUNCTION instead of "CREATE FUNCTION". When I saw this usage on the web, I thought it was a typo or something. But in Steven Feirenstein's Oreilly "Oracle 11g PL / SQL Programming" the author used the same thing. But I am getting errors when I execute this. Can anyone please explain if this is a legitimate use or not? Thanks.
a source to share
It depends on the context.
To create a standalone function, you must use CREATE FUNCTION ...
or CREATE OR REPLACE FUNCTION ...
.
To declare a function inside the body of a package or type, you must use FUNCTION ...
.
The keyword CREATE
is a command FUNCTION
- the type of object to create.
Quite often CREATE
omitted because a function can be specified in several different ways, and there is no need to list them all.
a source to share