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: PL/SQL error

Re: PL/SQL error

From: Mark G <someone_at_hot>
Date: Fri, 2 Jul 1999 14:28:19 +0100
Message-ID: <377cbc17.0@145.227.194.253>


When using a cursor loop like yuou are doing, there is no need to declare v_doctable. Take it out from after the declare.

M

Morten wrote in message ...
>
>Hi, I just made my first PL/SQL code. When I try to run it I
>get the following error
>
>ERROR at line 13:
>ORA-06550: line 13, column 9:
>PLS-00201: identifier 'V_DOCTABLE' must be declared
>ORA-06550: line 11, column 4:
>PL/SQL: SQL Statement ignored
>
>As you can see in the code below, v_docTable is declared
>(as far as I can tell), who doesn't the compiler agree?
>
>Thanks
>
>Morten
>
>DECLARE
> v_docTable VARCHAR(32);
>
>CURSOR c_docTypeCursor IS
> SELECT table_name
> FROM doc_type;
>
>BEGIN
> FOR v_docTable IN c_docTypeCursor
> LOOP
> INSERT INTO document (id, type)
> SELECT v_docTable.id, doc_type.id
> FROM v_docTable, doc_type
> WHERE doc_type.table_name = v_docTable;
> END LOOP;
> CLOSE c_docTypeCursor;
> COMMIT;
>END;
>
>
>
>
Received on Fri Jul 02 1999 - 08:28:19 CDT

Original text of this message

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