Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

CAN WE DYNAMICALLY ADD SOME VALUES IN VARRAY TYPE VARIABLE?

yash_08031983Aug 23 2011 — edited Aug 25 2011
HELLO ALL,

I WANT TO COUNT AND SHOW THE RECORD OF MULTIPLE TABLES. TABLE NAMES DO PRIVIDE AT RUN TIME AT ONCE . FOR THIS I TRY WITH VARRAY ..
AS

1 declare
2 type tablelist is varray(2) of varchar2(20);
3 tlist tablelist;
4 begin
5 tlist := tablelist();
6 tlist.extend(2);
7 for i in 1..2
8 loop
9 tlist(i) := &list;
10 end loop;
11* end;
SQL> /
Enter value for list: EMP
old 9: tlist(i) := &list;
new 9: tlist(i) := EMP;
tlist(i) := EMP;
*
ERROR at line 9:
ORA-06550: line 9, column 13:
PLS-00357: Table,View Or Sequence reference 'EMP' not allowed in this context
ORA-06550: line 9, column 1:
PL/SQL: Statement ignored


REQUIRMENT: AT RUN TIME I PROVIDE 2 OR 3 TABLE NAMES ONE BY ONE THEN IT SHOWS THE NO OF RECORDS IN TABLE ONE BY ONE..


PLEASE GIVE ME SOME SUGGESTION

THANKS
YASH
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 22 2011
Added on Aug 23 2011
6 comments
368 views