hi guys,
basically what i'm trying to do is fetching a set of columns from an oracle database like so...
my_row=`sqlplus -s user/pwd << EOF
set head off
select user_id, username from all_users where rownum = 1;
EOF`
echo $my_row
the code above returns...
1 ADSHOCKER
so then i will create shell variables USER_ID and USERNAME which should hold the value of the my_row. problem is i have no idea how to do it.
are there any functions in shell that would convert my_sql into array that can be accessible like my_row(0) or my_row[0] ?
i am using SunOS by the way.
i'd appreciate any help.
thanks