Error in PL/SQL Language Reference .... could be that possible ? [message #314060] |
Tue, 15 April 2008 13:28 |
|
Hany Freedom
Messages: 256 Registered: May 2007 Location: Egypt
|
Senior Member |
|
|
I use Oracle 10g ....... but when I used that function in :-
OracleŽ Database
PL/SQL Language Reference
11g Release 1 (11.1)
B28370-02
September 2007
page 252
Quote: | CREATE OR REPLACE FUNCTION compute_bonus (emp_id NUMBER, bonus NUMBER)
RETURN NUMBER
IS
emp_sal NUMBER;
BEGIN
SELECT salary INTO emp_sal
FROM employees
WHERE employee_id = emp_id;
RETURN emp_sal + bonus;
END compute_bonus;
/
The following equivalent SELECT statements invoke the PL/SQL subprogram in
Example 8–5 using positional, named, and mixed notation:
SELECT compute_bonus(120, 50) FROM DUAL; -- positional
SELECT compute_bonus(bonus => 50, emp_id => 120) FROM DUAL; -- named
SELECT compute_bonus(120, bonus => 50) FROM DUAL; -- mixed
|
====================================
and than executed first select statement ..... it pass successfully
but in second and third select ...... I found this errors :-
SQL> SELECT compute_bonus(120, 50) FROM DUAL;
COMPUTE_BONUS(120,50)
---------------------
8050
SQL> SELECT compute_bonus(bonus => 50, emp_id => 120) FROM DUAL;
SELECT compute_bonus(bonus => 50, emp_id => 120) FROM DUAL
*
ERROR at line 1:
ORA-00907: missing right parenthesis
SQL> SELECT compute_bonus(120, bonus => 50) FROM DUAL;
SELECT compute_bonus(120, bonus => 50) FROM DUAL
*
ERROR at line 1:
ORA-00907: missing right parenthesis
--------------------------------------------------------------------------------
is there any relation between that I use oracle 10g and those errors ???
or the code wrote wrong in oracle reference 11g ( I hope not ) ???
|
|
|
|