I have a select statement
sqlplus [credentials] select variable from table;
It returns 6 rows and I need to store them as an array in bash array variable.
If your variables contain spaces and you want the array to have an element for each line of output (as opposed to each word of output), you also need to set your IFS. And you may want to use quotes when using the array:
SaveIFS="$IFS"
IFS=$'\n'
array=( $(sqlplus [credentials] select variable from table;) )
echo "${array[*]}"
IFS="$SaveIFS"