Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> CREATE PACKAGE BODY
I copied a package definition from Oracle server shown below. But
the package body always has compilation error. Can somebody tell
me what is wrong with my script? If no error, what can be the cause
of compilation error.
SQLWKS> CREATE OR REPLACE package body lock_1_to_200 AS 2> begin 3> function request(id in integer, 4> lockmode in integer default x_mode, 5> timeout in integer default maxwait, 6> release_on_commit in boolean default FALSE) 7> return integer 8> AS 9> begin 10> if id < 1 or id > 200 then 11> raise_application_error(-20000,'Lock id out of range'); 12> endif; 13> return dbms_lock.request(id, lockmode, timeout, release_on_commit); 14> end request; 15> function convert(id in integer, 16> lockmode in integer, 17> timeout in number default maxwait) 18> return integer 19> AS 20> begin 21> if id < 1 or id > 200 then 22> raise_application_error(-20000,'Lock id out of range'); 23> endif; 24> return dbms_lock.convert(id, lockmode, timeout); 25> end convert; 26> function release(id in integer) return integer 27> AS 28> begin 29> if id < 1 or id > 200 then 30> raise_application_error(-20000,'Lock id out of range'); 31> endif; 32> return dbms_lock.release(id); 33> end release; 34> end lock_1_to_200 ;
error from Oracle schema manager:
PLS-00103: Encounted the symbol"REQUEST" when expecting one of the following: := . [ @ %;
The symbol ":=" was substituted for "REQUEST" to continue.
PLS-00103: Encounted the symbol"DEFAULT" when expecting one of the following:
:= . [ @ % - + mod rem.
an exponent[**] and or ||;
The symbol "." was inserted before "DEFAULT" to continue. Received on Tue May 04 1999 - 16:15:53 CDT