Link to home
Start Free TrialLog in
Avatar of dramacqueen
dramacqueenFlag for Australia

asked on

Oracle Package body problem - major headache

I'm trying to create a package that will run dbms_job to kick off a nightly procedure.  NB This is Oracle 7.

The package compiles fine, but the package body just will not compile.  The procedure is compiled fine.

Package:
CREATE OR REPLACE
 PACKAGE <mypkg>
as procedure  
<mypkg>;
end;  

Package body:
CREATE OR REPLACE
 PACKAGE BODY <mypkg>
as PROCEDURE <myproc> IS
  jobno NUMBER;
begin
 dbms_job.submit (jobno,
                  'begin <myproc>; end;',
                   'sysdate+3/1440',
                  'TRUNC(sysdate+1)+3/24');
END;
/

The error I get with this version is:
Line 10 col 0
PLS-00103: Encountered the symbol ";" when expecting one of the following:
begin end function package pragma procedure form

If I replace END; with END PROCEDURE;
the error message changes to
Line 8 col 5
PLS-00103: Encountered the symbol "PROCEDURE" when expecting one of the following:
; <an identifier> <a double-quoted delimited-identifier>
<a single-quoted SQL string> delete existst prior

If I replace END; with END <myproc>;
the error message changes to
Line 9 col 0
PLS-00103: Encountered the symbol ";" when expecting one of the following:
begin end function package pragma procedure form

and if I replace END; with END PROCEDURE <myproc>;
the error goes back to the same as with just PROCEDURE.

WHAT am I doing wrong here???

NB have also re-run catproc.sql in case the problem was corruption of dbms_job and everything compiled fine.
ASKER CERTIFIED SOLUTION
Avatar of Stephen Lappin
Stephen Lappin
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dramacqueen

ASKER

Perfect.

Thanks lappins.  Have an EXCELLENT day!