Re: Is it possible to have an array in a table?
Date: Sun, 23 Aug 2009 00:34:35 -0700 (PDT)
On Aug 23, 10:39 am, Ramon F Herrera <ra..._at_conexus.net> wrote:
> On Aug 22, 4:46 pm, John Hurley <johnbhur..._at_sbcglobal.net> wrote:
> > On Aug 22, 4:09 pm, Ramon F Herrera <ra..._at_conexus.net> wrote:
> > snip
> > > Bonus question:
> > > I believe it is possible to save an arbitrary file (let's say an MS
> > > Word or PDF document) in Oracle. I'd appreciate the details on that.
> > > TIA,
> > > -Ramon
> > asktom.oracle.com ... which also applies to your first question.
> Thanks, John. That is indeed a helpful resource.
> In reference to arrays (or VARRAYs) I have a question for you folks
> out there. According to the examples that I read, a VARRAY can be used
> when there is a small number of items. The example mentions a person/
> organization with a variable number of phone numbers, of to 6.
> What about a larger number of items? In that case, is it:
> - inefficient
> - inelegant
> - undesirable
> - not recommended
> to use VARRAYs perhaps?
> The characteristic that I value the most about arrays is the ability
> to iterate with an integer(s). Also important is the fact that if an
> item is in position 52, I can rely on it being there next time.
Read up on nested tables and associative arrays in the docs for your Oracle release. Note that true arrays (associative arrays aka INDEX BY tables) are only available in PL/SQL. VARRAYs are somewhat limited because they have finite predeclared capacity (you must declare maximum VARRAY size,) and nested tables are unordered unless you include an index column, always ORDER BY that index and maintain it yourself. VARRAYs are stored in LOBs, so they become a bit less efficient as they grow, but not dramatically.
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm) http://www.dynamicpsp.com Received on Sun Aug 23 2009 - 02:34:35 CDT