Home » SQL & PL/SQL » SQL & PL/SQL » Error in PL/SQL Language Reference .... could be that possible ? (Oracle Database 10g , windows XP SP2)
icon4.gif   Error in PL/SQL Language Reference .... could be that possible ? [message #314060] Tue, 15 April 2008 13:28 Go to next message
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 ) ???
Re: Error in PL/SQL Language Reference .... could be that possible ? [message #314061 is a reply to message #314060] Tue, 15 April 2008 13:32 Go to previous message
Michel Cadot
Messages: 68707
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is a 11g improvement, this is why new versions are for.

Regards
Michel

Previous Topic: how to execute the a long query step by step
Next Topic: sequence Number
Goto Forum:
  


Current Time: Thu Nov 07 16:07:40 CST 2024