vivekvp has asked for the wisdom of the Perl Monks concerning the following question:
do I have this right?$sth=$dbh->prepare("select b.req_id,ccode from rtsdet a,rtshead b where b.req_id =a.req_id and date_stamp BETWEEN '2002/01/01' AND '2002/02/28'"); $sth->execute (); # will dump out all fields $data=$sth->dump_results(); #$data=$sth->dump_results(); #@data=$sth->fetchrow_array(); while (@data = $sth->fetchrow_array() ) { print "Row: @data \n"; ($req,$ccode)=split(/ /,@data);
The Problem: It is not printing the split data - but the number 2. I want to separate the two pieces of data - and eventually use them. Any help as to what I am doing wrong? Thanks, Vprint " $req $ccode \n"; } $sth->finish; Here is the output: Row: 1784996 CAABBA 2 Row: 1785155 PHAD 2 Row: 1785153 PHAD 2 Row: 1785173 SEABBA 2 Row: 1785175 SEABBA 2 Row: 1785176 SEABBA 2 Row: 1785176 SEABBA
He who laughs last, doesn't get the joke.
Edit by tye to remove excessive trailing spaces
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Split and the tears it caused me.
by YuckFoo (Abbot) on Feb 28, 2002 at 22:38 UTC | |
by impossiblerobot (Deacon) on Feb 28, 2002 at 22:51 UTC | |
|
Re: Split and the tears it caused me.
by steves (Curate) on Mar 01, 2002 at 09:28 UTC | |
|
Re: Split and the tears it caused me.
by strat (Canon) on Mar 01, 2002 at 15:15 UTC |