Oracle Illustrated

Feb 21 2010   7:46AM GMT

Migrating from 9i to 11g – Named and mixed notation for PL/SQL sub program in a sql stmt



Posted by: Lakshmi Venkatesh
Tags:

Positional, named or mixed-notations are allowed in calls to functions / procedures. Prior to Oracle 11g only positional notation was supported from the SQL statements. From 11g named and mixed notations are supported.

If there are too many default values then we have been given values to them as well earlier – but, from now on they can be skipped and can give only the required values.

CREATE OR REPLACE function
mixed_notation (in_param1 IN NUMBER DEFAULT 10, in_param2 IN NUMBER DEFAULT 12)
RETURN NUMBER
IS
v_value number;
BEGIN
v_value := in_param1 * in_param2;
RETURN (v_value);
END mixed_notation;

Oracle 9i

SQL> select mixed_notation(10, 12) from dual;

MIXED_NOTATION(10,12)
———————
120

Oracle 11g

SQL> select mixed_notation() from dual;

MIXED_NOTATION()
—————-
120

SQL> select mixed_notation(in_param1=>6) from dual;

MIXED_NOTATION(IN_PARAM1=>6)
—————————-
72

Mix it up !!

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: