PL/SQL Tables [message #261967] |
Fri, 24 August 2007 03:59  |
Jayu
Messages: 14 Registered: August 2007 Location: India
|
Junior Member |
|
|
Can anyone elaborate on PL/SQL tables??
|
|
|
|
|
Re: PL/SQL Tables [message #261972 is a reply to message #261969] |
Fri, 24 August 2007 04:16   |
Jayu
Messages: 14 Registered: August 2007 Location: India
|
Junior Member |
|
|
Hi Michel,
Thanks for your reply.
i was not able to find what actaully wanted thru the links which you have posted.
I want to know more about the characteristics of PL/SQL Tables(tables whic reside in memory).Can you suggest me some links where i can get good information about this.
Thanks
Jayu
|
|
|
Re: PL/SQL Tables [message #261974 is a reply to message #261972] |
Fri, 24 August 2007 04:18   |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
Impressive, you were able to read through ALL that documentation in under 15 minutes, digest it and then assess that it was useless. Wow!
|
|
|
|
Re: PL/SQL Tables [message #261977 is a reply to message #261974] |
Fri, 24 August 2007 04:32   |
Jayu
Messages: 14 Registered: August 2007 Location: India
|
Junior Member |
|
|
pablolee,
i had gone thru these links earlier,these links say more on varrays,nested tables which come under PL/SQL Collections.I wanted information on one more type of Collection type which is PL/SQL tables.
|
|
|
Re: PL/SQL Tables [message #261978 is a reply to message #261975] |
Fri, 24 August 2007 04:35   |
Jayu
Messages: 14 Registered: August 2007 Location: India
|
Junior Member |
|
|
vamsi,
PL/SQL Tables are not explained in Detail in that section.That section concentrates more on nested tables,Varrays.
Thanks
Jayu
|
|
|
|
|
Re: PL/SQL Tables [message #261981 is a reply to message #261979] |
Fri, 24 August 2007 04:45   |
Jayu
Messages: 14 Registered: August 2007 Location: India
|
Junior Member |
|
|
Correct Defn of Pl/SQl Tables:
A PL/SQL table is a one-dimensional, unbounded, sparse collection of homogeneous elements, indexed by integers
|
|
|
Re: PL/SQL Tables [message #261988 is a reply to message #261981] |
Fri, 24 August 2007 05:12   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Ahh - you'll be using 8i then.
As of 9i, Pl/Sql tables (or Associative Arrays as they've been renamed) can be indexed by Varchar2 as well.
|
|
|
|
|
|
Re: PL/SQL Tables [message #262063 is a reply to message #262051] |
Fri, 24 August 2007 07:30   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
If that's the correct definition, then that means this code should error:SQL> declare
2 type a_a_r is table of varchar2(2000) index by varchar2(2000);
3
4 test_table a_a_r;
5 begin
6 test_table('Indexed by varchar2') := 'Works just fine';
7
8 dbms_output.put_line(test_table('Indexed by varchar2'));
9 end;
10 /
Works just fine
PL/SQL procedure successfully completed.
Have you read that link I provided to find the information you need?
|
|
|
|
Re: PL/SQL Tables [message #262352 is a reply to message #262345] |
Sun, 26 August 2007 08:00   |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
muzahidul, please do not use IM speak on this forum. Use full English wordsi.e. u = You, ur = your | you're. It makes it much easier for others to understand.
|
|
|
Re: PL/SQL Tables [message #262561 is a reply to message #261967] |
Mon, 27 August 2007 09:32   |
William Robertson
Messages: 1643 Registered: August 2003 Location: London, UK
|
Senior Member |
|
|
The term "PL/SQL Table" is obsolete.
Originally (in Oracle 7) there was only one type of array in PL/SQL and they called it a PL/SQL Table because (I guess) it could be thought of as having a column and rows. However they were never much like tables and the name probably just caused confusion. Later, two more collection types were introduced and the original type was renamed first "Index-by Table" and then (in 9i) "Associative Array".
Unfortunately we are stuck with the TABLE OF syntax (rather than COLLECTION OF) and the "Index-by Table" label (which still appears in the documentation).
As of 10g we have three types of collection:
* Associative Array (type x is table of y index by z)
* Nested Table (type x is table of y)
* Varray (type x is varray(y) of z)
www.williamrobertson.net/documents/collection-types.html
|
|
|
Re: PL/SQL Tables [message #262562 is a reply to message #262345] |
Mon, 27 August 2007 09:44   |
William Robertson
Messages: 1643 Registered: August 2003 Location: London, UK
|
Senior Member |
|
|
Muzahidul, that site appears to contain an out of date copy of Steven Feuerstein & Bill Pribyl's "PL/SQL Programming" from 1997. There have been two editions since then, and at least three major releases of Oracle, including the one that let you use a character string in the INDEX BY clause.
|
|
|
Re: PL/SQL Tables [message #262657 is a reply to message #262562] |
Tue, 28 August 2007 00:49   |
sispk6
Messages: 164 Registered: November 2006 Location: pakistan
|
Senior Member |
|
|
or simply
type tab is table of varchar2(3) ;
no need to refer a binary_integer ,
extremely useful in sql plus environment where u can pass
tables arguments directly as arrays
like
begin
package.proc(
tab_array => package.tab('asdfd' , 'adsdfa);
);
end ;
did not know about the edit option earlier
[Updated on: Tue, 28 August 2007 01:03] Report message to a moderator
|
|
|
Re: PL/SQL Tables [message #262662 is a reply to message #262562] |
Tue, 28 August 2007 00:53   |
sispk6
Messages: 164 Registered: November 2006 Location: pakistan
|
Senior Member |
|
|
type tab is table of varchar2(30);
no need for binary_integer or char reference
its use ful in sqlpus environment.
begin
pack.proc(
tab_array => pack.tab('one','two','three')
);
end ;
|
|
|
Re: PL/SQL Tables [message #262822 is a reply to message #262662] |
Tue, 28 August 2007 05:51  |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Those would be Nested Tables, not Pl/Sql tables.
They are subtly different beasts. For instance, try using a negative identifier in a Nested Table.
|
|
|