in reply to generating list box form oracle database

Ok I have it working for one line with this code.
@ln = &make_list; print"<font size=5>Delete Attribute From Database</font>\n"; print"<form method=post action=/cgi-bin/BXJOH27/del_attrib_admin.pl>\n +"; print"<select size=10 name=\"attrib_lines\">\n"; print"<option>$ln[0] $ln[1] $ln[2] $ln[3]</option>\n"; print"</select>\n"; print"</form>\n"; sub make_list { $sql = "select * \n"; $sql .= "from e1_attrib_type \n"; my $cur = ora_open( $lda, $sql ); my @d = ora_fetch( $cur ); ora_close( $cur ); return( @d ); }
But I need the list box to have every line from the database table. How can I modufy this code to make the list box contain every line and not just 1. Thanks

Replies are listed 'Best First'.
Re: Re: generating list box form oracle database
by chromatic (Archbishop) on Jun 20, 2001 at 07:59 UTC
    Having never used oraperl, it's only a guess that ora_fetch() only returns one line of the result set. If there's an ora_fetchall() method, that might work better. Otherwise, you might need to loop:
    my @d; while (my $row = ora_fetch($cur)) { push @d, $row; }