Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can't execute a scheduled job

70 views
Skip to first unread message

Matt Smith

unread,
Jun 5, 2001, 12:38:26 AM6/5/01
to
I have a procedure called sscc.expire_content, which I want to run every
day. I have scheduled it in the job queue using the following SQL:

--------------
VARIABLE jobno NUMBER;
BEGIN
DBMS_JOB.SUBMIT(:jobno,
'SSCC.EXPIRE_CONTENT;',
TO_DATE('00:01:00', 'HH24:MI:SS'),
'SYSDATE + 1');
END;
---------------

If I run the procedure directly from sqlplus with 'execute
sscc.expire_content', it runs fine. If I force the job with 'execute
dbms_job.run(38)', it fails. It also fails when it is scheduled to run.
The following is what appears in the alert log:

--------------
Tue Jun 05 12:19:52 2001
Errors in file D:\Oracle\admin\gedb\udump\ORA00357.TRC:
ORA-12012: error on auto execute of job 38
ORA-06550: line 1, column 96:
PLS-00201: identifier 'SSCC.EXPIRE_CONTENT' must be declared
ORA-06550: line 1, column 96:
PL/SQL: Statement ignored
--------------

Why does it say that the identifier must be declared? I copied all the
syntax directly from the documentation. Any help here would be muchly
appreciated.

Oh, yeah - almost forgot. I am running Oracle8i on NT4

Thanks,
Matt


MarkyG

unread,
Jun 7, 2001, 10:01:28 AM6/7/01
to
You need to wrap the call in begin....end syntax.
Try...

VARIABLE jobno NUMBER;
BEGIN
DBMS_JOB.SUBMIT(:jobno, 'begin SSCC.EXPIRE_CONTENT; end;',


TO_DATE('00:01:00', 'HH24:MI:SS'), 'SYSDATE + 1');
END;

HTH,

Mark

"Matt Smith" <m.s...@secureinteractive.com> wrote in message news:<9fhnh3$k3k$1...@thebe.syd.dav.net.au>...

Keith Boulton

unread,
Jun 7, 2001, 4:30:12 PM6/7/01
to
On Tue, 5 Jun 2001 14:38:26 +1000, "Matt Smith"
<m.s...@secureinteractive.com> wrote:

At a guess, you need to grant execute privilege on sscc.expire_content
to the schema running the job

Matt Smith

unread,
Jun 7, 2001, 6:49:34 PM6/7/01
to
Yep, that was it. The user has the DBA role, so I assumed that because I
could execute the procedure from sqlplus that the queue would also be able
to execute it. It seems that I have found out the hard way that the job
queue doesn't recognise roles.

Thanks for your response.

"Keith Boulton" <kbou...@ntlworld.com> wrote in message
news:o0pvhtg97oqgnrahq...@4ax.com...

0 new messages