Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> SQL*plus output etc
Thanks to all who replied my earlier question -- I can't thank enough
for those of you who spent time, offered not only help but also
education
to a novice :)
Here I got another problem that I don't understand ...
I am writing a perl script to do Oracle database queries using SQL*Plus'
silent mode. Things have been smooth -- i.e. I embed SQL in Perl, and
use command line Perl script to do my query and data processing etc.
Here I come to a situation where I need to parse a list of (single)
names
queried from Oracle and use "foreach" to loop for further queries:
@results = (queried list of names);
foreach $name(@results) {
do 2nd query "where=$name";
}
However, to my surprise the "$name" in foreach holds the whole list of
values in "@results", although the print out of "@results" shows
separate
lines of each "name". Is there anything special in SQL*Plus output that
prevent the perl from parsing the list in "foreach"?
(I checked on perl side -- it parses a list for no problem if it read
from
a file, but not from SQL*Plus).
Thanks in advance!
Zhiliang Received on Sat Apr 07 2001 - 15:54:20 CDT
![]() |
![]() |