in reply to SP_HELP_DUMP
Anyway, please provide us(me), the sp_* less monks with a working version. Since I can't test this, I don't guarantee it, not that I would anyway, but here's a few workarounds.
First off I'd change line
tomy $sql = $dbh->prepare ("sp_columns $_") || die;;
That should work without question. (note the single ; %^)my $sql = $dbh->prepare ("SHOW COLUMNS FROM $_") || die;
And so should this
as opposed tomy @tables = $dbh->ListTables; print "<TABLE Border = 1>\n<TH>Select me!</TH>"; foreach (@tables) { print "<TR><TD>",checkbox(-name=>"view",-checked=>"", -value=> +"$tables[$_]"),"</TD>"; if(! (defined $tables[$_]) ) { print "<TD>--undef--</TD>"; } else { print "<TD>$tables[$_]</TD>"; } print "</TR>\n"; }
update:my $sql = $dbh->prepare ("sp_help") || die;; my $sth = $sql->execute or die "no ".$DBI::errstr; print "<TABLE Border = 1>\n<TH>Select me!</TH>"; my $THdone; while (my $result_ref = $sql->fetchrow_hashref()){ unless ($THdone) { foreach (sort keys %$result_ref) { print "<TH>$_ </TH>"; } $THdone = "yes, indeedy!"; } print "<TR><TD>",checkbox(-name=>"view",-checked=>"", -value=> +"$$result_r +ef{Name}"),"</TD>"; foreach (sort keys %$result_ref) { if (! defined $$result_ref{$_}) {print "<TD>--undef--</TD> +";next} print "<TD>$$result_ref{$_}</TD>"; } print "</TR>\n";
You know, I was really suprised by this, especially coming from you boo.if (! defined $$result_ref{$_}) { print "<TD>",checkbox(-name=>"view",-checked=>"", -val +ue=>),"</TD>"; print "<TD>--undef--</TD>"; next; } print "<TD>",checkbox(-name=>"view",-checked=>"", -value=> +"$$result_ref{$_}"),"</TD>"; print "<TD>$$result_ref{$_}</TD>";
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"
|
|---|