Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL*Plus anyone?
See comments below ... let me know if it fixes your problem(s).
Bruce...
Gary G wrote:
...snip
> CREATE OR REPLACE PROCEDURE label_run (donor IN varchar2, mail IN varchar2)
> IS
> BEGIN
> DECLARE
above two lines not needed.
> v_user varchar2(10);
>
> CURSOR c1 IS SELECT apbcons_addr_name,
> spriden_first_name,
...snip
> AND spriden_change_ind IS null;
> BEGIN
> SELECT user
> INTO v_user
> FROM dual;
should be able to avoid "dual" usage and say
v_user := user;
> IF donor = 'ALUM'
> AND mail = 'CSI'
> THEN
> FOR c1rec IN c1 LOOP
You should define s1rec just after cursor definition
eg c1rec c1%ROWTYPE;
> INSERT INTO run_label (label_id,
> name,
> street1,
...snip
> c1rec.spraddr_zip,
> c1rec.spriden_last_name);
> END LOOP;
> ELSE
> null;
> END IF;
the ELSE do nothing lines can be removed.
> END;
always good practice to end a procedure with the procedure name eg
END label_run;
> END;
this second END; line above is not needed. (see comment at top of
procedure)
-- ----------------- T T T T T T T T Bruce Pihlamae I I I I I I I I bpihlama_at_nla.gov.au I I I I I I I I National Library of Australia T T T T T T T T Phone: +616 262-1575 ----------------- Fax: +616 273-2116 =================== "If you swallow a live frog first thing in the morning; nothing worse will happen to either of you that day."Received on Fri Dec 06 1996 - 00:00:00 CST
![]() |
![]() |