Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Join Date
    Jan 2005
    Posts
    19

    Unanswered: Array List in DB

    Hi,
    Is it possible to have a column as array in SQL Server 2000- similar to Oracle's varray. If yes, how?
    rgds,

    Kishore

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yes, it is possible, but it is not recommended, because it will usually require table scans to access the contents
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I don't see a lot of point in Array fields when subtable give you the same functionality with less hassle and more control...
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    subtable? what's a subtable? BOL is totally ignorant of that terminology
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I just haven't gotten around to writing that chapter yet. So busy posting on the forum, you know...
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    What are either of you 2 talking about?

    The only array stuff I've seen was in Ken Hendersons Book The Guru's Guide to SQL Server Stored Procedures, XML and HTML

    Chapter 23...but that dealt with Dll's, ect...all very painful AND dangerous, if you weren't careful

    Why, what do you need an array for?

    PS A table is like an array anyway..you could use a table variable
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  7. #7
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i believe blindman was actually just joking around

    blindman, please let us know when you do this

    as for my reply in post #2, yes, you can store an array as a comma-separated list of values in a single varchar column

    i would've thought this would be obvious to any frequent poster here, and also why it's not a good idea
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  8. #8
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by r937
    as for my reply in post #2, yes, you can store an array as a comma-separated list of values in a single varchar column
    That is not an array
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  9. #9
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    pedant!!

    a lot depends on what programming language you have sitting on the front end

    i know of several languages where you can simply assign the string to an array, and voila!

    what would you call an array, please? and make sure you mention which language

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  10. #10
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You are both pedants!

    When I get around to writing my Books Online chapter on subtables I will clearly define whether a comma-separated list is an array. Until then, you will just have to wait to find out.

    And I am SERIOUS about this!
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  11. #11
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by blindman
    And I am SERIOUS about this!
    Seriously what?

    -PatP

  12. #12
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by Brett Kaiser
    That is not an array
    Technically, that's an unbounded vector. What's the difference though?

    -PatP

  13. #13
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by r937
    pedant!!
    Hardly

    a lot depends on what programming language you have sitting on the front end
    Not really

    i know of several languages where you can simply assign the string to an array, and voila!
    Assign the string to an array..your words...the string is not an array

    what would you call an array, please? and make sure you mention which language

    An array is an object...pick you language...doesn't matter...they all behave the same way...
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  14. #14
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    brett, i know you can spell pedant (at least, so far), but do you actually know what it means?

    "Assign the string to an array..your words...the string is not an array"

    now that's pedantic!!
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  15. #15
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    God made google didn't he?

    An array is more than data...Pat, I think you need to give up your "title" for Rudy...

    How do you get the information rs.0 from a string for example?

    Did you read Henderson's book?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •