sathya_svv
Jan 6, 2006, 01:05 AM
What is the main difference between associative arrays and nested tables
How to choose in pl/sql program
Satya:)
Ademan
Jan 11, 2006, 10:57 PM
An associative array is just an array that uses anything other than a sequential integer index. IE you could access an associative array using a string, this could be your associative array
key value
"apple" "foo"
"oranges" "bar"
"dan" "baadc0de"
"cow" "deadbeef"
so, say in php you could access your associative array like so:
MyArray["dan"] and you would get "baadc0de" associative arrays can even have integer indexes (they're called "key"s), but of course, there's no real reason to do that unless you want to skip over certain numbers.
key value
5 "rawr"
2 "kitty"
9 "idaho"
264 "i am the master"
obviously there's no reason on making a normal array that would take up 265 * sizeof(void *) when all you need is a small array that holds 4 * sizeof(void *)
and your question about nested tables vs associative arrays
in essence a table IS an associative array. A nested table is a table stored inside another table... totally different.
cheers (hope that helped, and admittedly I'm no db expert so a second opinion might serve you well, but I did Google the nested table stuff, since I wasn't sure about that, however I'm positive about the associative array stuff... and their relation to tables)
-Dan