jptxs has asked for the wisdom of the Perl Monks concerning the following question:
this code:
my $TYPE_QUERY = qq!SELECT APPT_TYPE||'|'||INFO_NEEDED FROM SC_APPT_TY +PE!; my $sth = $dbh->prepare("$TYPE_QUERY") or dienice("709 Couldn't prepare statement: " . $dbh->errstr); $sth->execute() or dienice("713 Couldn't execute statement: " . $sth->errstr); while (my @types = $sth->fetchrow_array()) { foreach my $types (@types) { chomp($types); my ($info, $type) = split "|", $types; print qq!<OPTION VALUE="$type_$info">$type</OPTION>\n!; } }
selecting these rows from an Oracle Database:
Onsite,FULL POC,FULL Phone Walkthru,PHONE Con Call,PHONE FTO,NONE Travel Day,NONE Admin Day,NONE Local Only,NONE Holiday,NONE SC Training,TRAIN
Produce this thing:
Appointment Type:<SELECT NAME="appt_type"><OPTION VALUE="O">n</OPTION> <OPTION VALUE="P">O</OPTION> <OPTION VALUE="P">h</OPTION> <OPTION VALUE="C">o</OPTION> <OPTION VALUE="F">T</OPTION> <OPTION VALUE="T">r</OPTION> <OPTION VALUE="A">d</OPTION> <OPTION VALUE="L">o</OPTION> <OPTION VALUE="H">o</OPTION> <OPTION VALUE="S">C</OPTION> </SELECT>
any ideas?
-- I'm a solipsist, and so is everyone else. (think about it)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unexpected result parsing rows from database
by Fastolfe (Vicar) on Sep 21, 2000 at 23:49 UTC | |
|
Re: unexpected result parsing rows from database
by jptxs (Curate) on Sep 21, 2000 at 23:49 UTC |