Problem with FETCH/INTO

From: Kramer314 <johnlkramer_at_gmail.com>
Date: Mon, 4 Aug 2008 17:35:15 -0700 (PDT)
Message-ID: <9eba2f10-f929-47f1-9820-4306807d0a60@v26g2000prm.googlegroups.com>


Hi guys. ANother quick question. I have the following sql file:

DECLARE CURSOR cursor1 is SELECT * FROM tblName1 WHERE tblName1.ald="id";

BEGIN FETCH cursor1
BULK COLLECT INTO tblName2 LIMIT 10;

END; When I try to run the script, I get the following error:

ORA-06550: line 7, column :
PLS-00403: expression 'TBLNAME2' cannot be used as an INTO-target of a SELECT/FETCH statement

What am I doing wrong and how should I be doing this?

The ddl for tblName1 is as follows (and yes the table exists):

CREATE TABLE tblName1 (

       Ac_Id   NUMBER(38) NOT NULL,
       Key_Id               VARCHAR2(32) NOT NULL,
       Data         VARCHAR2(4000) NOT NULL,
       Alg           VARCHAR2(64) NOT NULL
)
;

ALTER TABLE tblName1 ADD (

      CONSTRAINT PK_tblName1 PRIMARY KEY (Ac_Id, Key_Id)
      )

;

The ddl for tblName2 is the same. Received on Mon Aug 04 2008 - 19:35:15 CDT

Original text of this message