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

Home -> Community -> Mailing Lists -> Oracle-L -> stored proc vs plsql: question

stored proc vs plsql: question

From: Kate Monro <KMonro_at_extend.com>
Date: Fri, 8 Dec 2000 18:26:55 -0500
Message-Id: <10704.124124@fatcity.com>


I'm not so hot with the programming concepts, so does someone mind explaining to me what I have to chnage in order to make thie following plsql block into a stroed proc? I believe it's the DECLARE statement that is wrong. I thought I could just add the following at the beginning: CREATE OR REPLACE PROCEDURE runjobs_proc AS

DECLARE
    jobnum dba_jobs.job%TYPE;
    CURSOR c1 is

        SELECT job from dba_jobs;
BEGIN
    OPEN c1;

    LOOP	  -- process each row one at a time
    	FETCH c1 INTO jobnum;
    	EXIT WHEN c1%NOTFOUND;

-- the c1%NOTFOUND condition evaluates
-- to TRUE when FETCH finds no more rows
/* run the job */ DBMS_JOB.RUN (jobnum);

    END LOOP;
    CLOSE c1;
    COMMIT; Received on Fri Dec 08 2000 - 17:26:55 CST

Original text of this message

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