Retrieve values from Oracle

From: Nancy McMullin (NANCY.MCMULLIN_at_DFAS.MIL)
Date: 02/09/05


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>";
   }



Relevant Pages

  • RE: Retrieve values from Oracle
    ... > I'm attempting to retrieve values and pass them to another program. ... > I'm only able to grab and save the first value. ... > CODE snippet: ... into your SQL statement. ...
    (perl.dbi.users)
  • sp_helpsrvrolemember
    ... Currently I am using sp_helpsrvrolemember to retrieve all of the users and ... Then I use a filter to grab an individual user. ...
    (microsoft.public.sqlserver.programming)
  • Find last/previous non-blank cell in current column
    ... I would like to be able to grab a value from a cell in the current ... column, starting at the current row, and looking backwards/upwards to ... retrieve the last non-blank entry. ...
    (microsoft.public.excel.worksheet.functions)
  • PHP and Curl (CURLOPT_RANGE - not working)
    ... I'm trying to pull a remote page to retrieve some data from it and I'd ... like to only grab a section of the site as opposed to retrieving the ...
    (php.general)
  • Catching error on insert statement
    ... I have a piece of code that queries an existing table to retrieve the last ... that procedure is that someone else could grab the same number and use it ... Prev by Date: ...
    (microsoft.public.access.modulesdaovba)