thanks in advance.
Printable View
thanks in advance.
Coding convention. Procedure is as, function is is is a general rule of thumb. Either way is acceptable with respect to syntax.
thank you.
Agree, merely a coding convention. I do not agree in the above "general role of thumb", though. IS and AS were both introduced (and allowed) not to distinguish between functions and procedures, but rather for the commands that use them to sound as natural English.Quote:
Originally posted by stecal
Coding convention. Procedure is as, function is is is a general rule of thumb. Either way is acceptable with respect to syntax.
When you create a standalone function, you use CREATE FUNCTION clause and with this the natural word to be used in English is AS.
It sunds much more naturaly with AS:
than with IS:Code:CREATE PROCEDURE/FUNCTION foo AS ....
In other words, in English you "create something AS blahblah", not "create something IS blahblah".Code:CREATE PROCEDURE/FUNCTION foo IS ....
But on the other hand, inside a package you don't use the word CREATE when specifying functions and procedures, so it is much more naturaly to use IS:
instead of unnatural use of word AS:Code:CREATE PACKAGE BODY foo_pack AS
PROCEDURE foo1 IS ....
PROCEDURE foo2 IS ....
...
In plain English, "something IS blahblah", not "soemthing AS blahblah".Code:CREATE PACKAGE BODY foo_pack AS
PROCEDURE foo1 AS ....
PROCEDURE foo2 AS ....
...
So a general rule of thumb (IMHO) should be: When you use a reserved word CREATE then use the word AS with it. When you don't use word CREATE (inside packages) you should use the word IS.
If you're common you use the following syntax:
CREATE PROCEDURE x LIKE WHAT THIS BELOW IS
BEGIN
END;
/
:)
Also, "IS NOT" = "AINT"
eg. "... where username aint null"