2

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.

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.