Retrieve values from Oracle
From: Nancy McMullin (NANCY.MCMULLIN_at_DFAS.MIL)
Date: 02/09/05
- Next message: Ronald J Kimball: "RE: Retrieve values from Oracle"
- Previous message: David Goodman: "Mixing select and print statements using DBI, DBD::Sybase"
- Next in thread: Ronald J Kimball: "RE: Retrieve values from Oracle"
- Reply: Ronald J Kimball: "RE: Retrieve values from Oracle"
- Maybe reply: Amonotod: "Re: Retrieve values from Oracle"
- Maybe reply: De Simone: "RE: Retrieve values from Oracle"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 9 Feb 2005 11:45:09 -0700 To: <dbi-users@perl.org>
Here's the easiest question you've had all day ;-)
I'm attempting to retrieve values and pass them to another program. But
I'm only able to grab and save the first value. What do I have wrong?
CODE snippet:
my $sth = $dbh->prepare("SELECT field1, field2 FROM table WHERE field1
= '$p1'")
or die "Preparing: ", $dbh->errstr;
$sth->execute or die "Executing: ", $sth->errstr;
while (my $row = $sth->fetchrow_arrayref())
{
print Tr( td( $field1, $field2 ) );
# note - I can print both values here
}
# note - as soon as I leave the loop field2 is gone but not field1...
If something then
{
print "<a href=/cgi-bin/next.pl?field1=$p1&field2=$field2>go
here</a>";
}
- Next message: Ronald J Kimball: "RE: Retrieve values from Oracle"
- Previous message: David Goodman: "Mixing select and print statements using DBI, DBD::Sybase"
- Next in thread: Ronald J Kimball: "RE: Retrieve values from Oracle"
- Reply: Ronald J Kimball: "RE: Retrieve values from Oracle"
- Maybe reply: Amonotod: "Re: Retrieve values from Oracle"
- Maybe reply: De Simone: "RE: Retrieve values from Oracle"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|