Bhuvan A wrote:
> 
> how can we retrive a result of a query in pre-formatted HTML
> format in DBD::Pg??

This prints the results of a Pg (or any DBI database) query as an HTML
table:

use DBI;
my $ad_dbh   = DBI->connect('dbi:AnyData:(RaiseError=>1)');
my $pg_dbh   = DBI->connect( @pg_connect_values );
my $sql      = "SELECT * FROM $table_name WHERE id < 3";
$ad_dbh->func('temp','DBI',$pg_dbh,{sql=>$sql},'ad_import');
print $ad_dbh->func('temp','HTMLtable','ad_export');
__END__

If it's meant to go to a browser, don't forget to print the
content-header first.

-- 
Jeff

Reply via email to