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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL*Plus anyone?

Re: SQL*Plus anyone?

From: Paul Brewer <paulb_at_pbrewer.demon.co.uk>
Date: 1996/12/05
Message-ID: <zfhXlBAKAzpyEwO8@pbrewer.demon.co.uk>#1/1

In article <01bbe137$aa3a02c0$0e433a82_at_gorbonosov.swarthmore.edu>, Gary G <ggorbon1_at_swarthmore.edu> writes
>Hello everyone
>It appears that there is a problem in/with following script;
>it just wouldn't compile from SQL prompt, no matter how altered.
>Yet it complies fine from PROCEDURE BUILDER 1.5
>We have V7.2.3 with PL/SQL 2.2.3
>Any suggestions are appreciated and welcomed.
>
>CREATE OR REPLACE PROCEDURE label_run (donor IN varchar2, mail IN varchar2)
>IS
>BEGIN
>DECLARE
> v_user varchar2(10);
>
> CURSOR c1 IS SELECT apbcons_addr_name,
> spriden_first_name,
> spriden_mi,
> spriden_last_name,
> spraddr_street_line1,
> spraddr_street_line2,
> spraddr_street_line3,
> spraddr_city,
> spraddr_stat_code,
> spraddr_zip
> FROM apbcons, spriden, spraddr,
> aprcatg, aprexcl, aprmail,
> spbpers, sovgeor
> WHERE apbcons_pidm = spriden_pidm
> AND apbcons_pidm = spraddr_pidm
> AND apbcons_pidm = aprcatg_pidm
> AND apbcons_pidm = aprexcl_pidm
> AND apbcons_pidm = aprmail_pidm
> AND apbcons_pidm = spbpers_pidm
> AND apbcons_pidm = sovgeor_pidm
> AND lower(spbpers_dead_ind) != 'y'
> AND spriden_change_ind IS null;
>BEGIN
> SELECT user
> INTO v_user
> FROM dual;
>
> IF donor = 'ALUM'
> AND mail = 'CSI'
> THEN
> FOR c1rec IN c1 LOOP
> INSERT INTO run_label (label_id,
> name,
> street1,
> street2,
> street3,
> city,
> state,
> zip,
> last_name)
> VALUES (v_user,
> c1rec.apbcons_addr_name,
> c1rec.spraddr_street_line1,
> c1rec.spraddr_street_line2,
> c1rec.spraddr_street_line3,
> c1rec.spraddr_city,
> c1rec.spraddr_stat_code,
> c1rec.spraddr_zip,
> c1rec.spriden_last_name);
> END LOOP;
> ELSE
> null;
> END IF;
>END;
>END;
>
>/
>show errors
>
>--and the errors are:
>
>6/17 PL/SQL: SQL Statement ignored
>16/24 PLS-00201: identifier 'ALUMNI.APBCONS' must be declared
>36/7 PL/SQL: SQL Statement ignored
>46/15 PLS-00364: loop index variable 'C1REC' use is invalid
>

I'm no expert, but try taking out the begin before the declare Paul Brewer Received on Thu Dec 05 1996 - 00:00:00 CST

Original text of this message

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