Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL Problem

Re: PL/SQL Problem

From: zhefeng <zhefeng_at_163.net>
Date: Sun, 26 Aug 2001 02:01:26 +0800
Message-ID: <9m9c72$21ji$1@news.cz.js.cn>


make sure your current user including this table "system.dba_jobs_running" Thomas Kyte <tkyte_at_us.oracle.com> wrote in message news:9m6eq001bui_at_drn.newsguy.com...
> In article <3B86A313.A648A27C_at_bridgewatersystems.com>, Tony says...
> >
> >Hey Guys,
> >i got a bit of a problem. here is the code and the associated message.
> >This is more than likely something small but I just can't figure it out.
> >
>
> see
> http://osi.oracle.com/~tkyte/Misc/RolesAndProcedures.html
>
>
> >Code:
> >
> >create or replace procedure check_jobs_running
> >as
> >v_date_dd number(2);
> >v_date_hh number(2);
> >v_thisdate_dd number(2);
> >v_thisdate_hh number(2);
> >v_what varchar2(100);
> >v_magic_number number := 06;
> >cursor long_jobs is select * from system.dba_jobs_running;
> >job_rec long_jobs%rowtype;
> >
> >begin
> >for job_rec in long_jobs
> > loop
> > select to_number(to_char(sysdate, 'DD' )) into v_date_dd from dual;
> > select to_number(to_char(sysdate, 'HH24' )) into v_date_hh from dual;
> > select to_number(to_char(job_rec.this_date, 'DD' )) into v_thisdate_dd
> >from system.dba_jobs_running;
> > select to_number(substr(job_rec.last_sec, 1,2)) into v_thisdate_hh
> >from system.dba_jobs_running;
> > if (( v_date_dd > v_thisdate_dd) and (v_thisdate_hh > v_magic_number))
> >
> > then
> > select what into v_what from system.dba_jobs where job = job_rec.job;
> >
> > elsif ((v_date_hh - v_thisdate_hh) > v_magic_number)
> > then
> > select what into v_what from system.dba_jobs where job = job_rec.job;
> >
> > end if;
> >end loop;
> >end;
> >/
> >
> >Error:
> >Errors for PROCEDURE CHECK_JOBS_RUNNING:
> >
> >LINE/COL ERROR
> >--------
> >-----------------------------------------------------------------
> >9/8 PLS-00341: declaration of cursor 'LONG_JOBS' is incomplete or
> > malformed
> >
> >10/2 PL/SQL: SQL Statement ignored
> >10/16 PLS-00201: identifier 'SYSTEM.DBA_JOBS_RUNNING' must be
> >declared
> >11/9 PL/SQL: Item ignored
> >18/3 PL/SQL: SQL Statement ignored
> >18/79 PLS-00201: identifier 'SYSTEM.DBA_JOBS_RUNNING' must be
> >declared
> >19/3 PL/SQL: SQL Statement ignored
> >19/75 PLS-00201: identifier 'SYSTEM.DBA_JOBS_RUNNING' must be
> >declared
> >22/4 PL/SQL: SQL Statement ignored
> >22/33 PLS-00201: identifier 'SYSTEM.DBA_JOBS' must be declared
> >25/4 PL/SQL: SQL Statement ignored
> >25/33 PLS-00201: identifier 'SYSTEM.DBA_JOBS' must be declared
> >
> >Any help will be greate.
> >
> >Tony Walby
> >oracle DBA
> >Bridgewater Systems
> >Kanata ON
> >Canada
> >
>
> --
> Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/
> Expert one on one Oracle, programming techniques and solutions for Oracle.
> http://www.amazon.com/exec/obidos/ASIN/1861004826/
> Opinions are mine and do not necessarily reflect those of Oracle Corp
>
Received on Sat Aug 25 2001 - 13:01:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US