If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Adabas > Very Urgent help required !!!!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-10-03, 04:28
himanshum himanshum is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
Very Urgent help required !!!!!

Hi,

I was trying to select a bulk data from a table using BULK COLLECTION feature of Oracle 9i. And i was trying with this code

DECLARE
TYPE test1_tab IS TABLE OF test1%ROWTYPE;

t_tab test1_tab := test1_tab();
BEGIN
SELECT id, description
BULK COLLECT INTO t_tab
FROM test1;
END;
/
but its giving error like

ERROR at line 7:
ORA-06550: line 7, column 21:
PLS-00597: expression 'T_TAB' in the INTO list is of wrong type
ORA-06550: line 8, column 3:
PL/SQL: ORA-00904: invalid column name
ORA-06550: line 6, column 3:
PL/SQL: SQL Statement ignored

But if i try it like this..
i.e creating table of each column

DECLARE
TYPE test1_id IS TABLE OF test1.id%TYPE;
TYPE test1_desc IS TABLE OF test1.description%TYPE;

t_tab test1_tab := test1_tab();
BEGIN
SELECT id, description
BULK COLLECT INTO test1_id,test1_desc
FROM test1;
END;
/

its working fine.....

Problem is that i have to select a chunk of data from a table of 35 coloumns. Can any one help me what exactly is the problem.
I am trying this one on Oracle 9.0.1.1.1 and i copied that above code from a well known PL/SQL book.

Thanks
Reply With Quote
  #2 (permalink)  
Old 12-13-03, 17:48
mohit_parab mohit_parab is offline
Registered User
 
Join Date: Dec 2003
Location: India
Posts: 7
In your first example you have defined test1_tab as test1%ROWTYPE
Collections of records cannot be a target of a BULK COLLECT INTO clause.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On