Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Stored procedure problems
Max is a PL/SQL reserved word, you can't use it as a variable name.
Robert
On 14 Feb 2000 15:57:11 GMT, kirk_at_kaybee.org wrote:
>CREATE FUNCTION create_account (newname IN VARCHAR2)
>RETURN number
>AS
> max number;
>BEGIN
> SELECT max(u_index)
> INTO max
> FROM udb.users
> WHERE u_name = newname;
>
> max := (max + 1);
>
> INSERT INTO udb.users (u_id, u_name, u_index)
> VALUES (udb.uid_seq.nextval, newname, max);
>
> RETURN max;
>
>END;
>
>When I run the last command (CREATE FUNCTION) in 'sqlplus' it just
>tells me:
> Warning: Function created with compilation errors.
Received on Sat Feb 19 2000 - 05:01:51 CST
![]() |
![]() |