Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL Tables
PL/SQL Tables [message #261967] Fri, 24 August 2007 03:59 Go to next message
Jayu
Messages: 14
Registered: August 2007
Location: India
Junior Member
Can anyone elaborate on PL/SQL tables??
Re: PL/SQL Tables [message #261969 is a reply to message #261967] Fri, 24 August 2007 04:02 Go to previous messageGo to next message
Michel Cadot
Messages: 64119
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Application Developer's Guide - Fundamentals
PL/SQL User's Guide and Reference

Regards
Michel
Re: PL/SQL Tables [message #261971 is a reply to message #261967] Fri, 24 August 2007 04:15 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
In Addition to Michel's links
http://www.orafaq.com/forum/t/59966/105378/
Re: PL/SQL Tables [message #261972 is a reply to message #261969] Fri, 24 August 2007 04:16 Go to previous messageGo to next message
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 Go to previous messageGo to next message
pablolee
Messages: 2834
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!
icon10.gif  Re: PL/SQL Tables [message #261975 is a reply to message #261974] Fri, 24 August 2007 04:19 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Laughing Laughing Laughing

Anyway search on Collections in PL/SQL User's Guide.

By
Vamsi

[Updated on: Fri, 24 August 2007 04:21]

Report message to a moderator

Re: PL/SQL Tables [message #261977 is a reply to message #261974] Fri, 24 August 2007 04:32 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 #261979 is a reply to message #261978] Fri, 24 August 2007 04:40 Go to previous messageGo to next message
Michel Cadot
Messages: 64119
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is your definition of PL/SQL tables?

Regards
Michel
Re: PL/SQL Tables [message #261980 is a reply to message #261978] Fri, 24 August 2007 04:45 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Actually, if you read it, the section Using PL/SQL Collections and Records tells you all the basics of all 3 types of array.

What is it about Associative Arrays that you don't understand?
Re: PL/SQL Tables [message #261981 is a reply to message #261979] Fri, 24 August 2007 04:45 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 #262011 is a reply to message #261981] Fri, 24 August 2007 06:09 Go to previous messageGo to next message
Michel Cadot
Messages: 64119
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Correct Defn of Pl/SQl Tables...

This not the correct current definition.
Read the documentation and learn.
And don't IM speak.

Regards
Michel
icon10.gif  Re: PL/SQL Tables [message #262051 is a reply to message #262011] Fri, 24 August 2007 07:03 Go to previous messageGo to next message
Jayu
Messages: 14
Registered: August 2007
Location: India
Junior Member
i got this defn from one of sites and i have verified the defination is correct.
Re: PL/SQL Tables [message #262054 is a reply to message #262051] Fri, 24 August 2007 07:09 Go to previous messageGo to next message
Michel Cadot
Messages: 64119
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Keyword is current.
Btw, when you quote something tell us the origin and if possible a link. Otherwise it is blabla.

Regards
Michel
Re: PL/SQL Tables [message #262063 is a reply to message #262051] Fri, 24 August 2007 07:30 Go to previous messageGo to next message
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 #262345 is a reply to message #261967] Sun, 26 August 2007 06:34 Go to previous messageGo to next message
muzahid
Messages: 281
Registered: September 2004
Location: Dhaka, Bangladesh
Senior Member
Hi jayu
According ur,u may got the definition from the following site

http://www.unix.org.ua/orelly/oracle/prog2/ch10_01.htm
http://www.unix.org.ua/orelly/oracle/prog2/ch10_02.htm
.
.
.
http://www.unix.org.ua/orelly/oracle/prog2/ch10_08.htm

So this may help u.

[Updated on: Sun, 26 August 2007 06:52]

Report message to a moderator

Re: PL/SQL Tables [message #262352 is a reply to message #262345] Sun, 26 August 2007 08:00 Go to previous messageGo to next message
pablolee
Messages: 2834
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 Go to previous messageGo to next message
William Robertson
Messages: 1640
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 Go to previous messageGo to next message
William Robertson
Messages: 1640
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous message
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.
Previous Topic: vsize(sysdate)
Next Topic: cursor
Goto Forum:
  


Current Time: Tue Dec 06 08:11:04 CST 2016

Total time taken to generate the page: 0.09121 seconds