Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > iis dbi

Thread Tools

iis dbi

John Giblin
Posts: n/a

I am making a simple program that connects to Oracle and then display the
results. When I exec the program via command like, there does not seem to
be a problem. When I do it through a browser I do not get any print commands
past the connection

here is what I have:
use strict;
use DBI;

my ($dbh, $sth, @row);
my %attr = (
PrintError => 0,
RaiseError => 0,

print "Content-type:text/html\n\n";
print <<HEADER;
<TITLE>A Test Page</TITLE>

print "Connecting to DB..<br>\n";
$dbh = DBI->connect( 'dbi:Oracle:Mysid','SYSTEM','pawel', \%attr)
or die "Can't connect to database: $DBI::errstr\n";
print "Connected<br>\n";
print "Create sql statement<br>\n";

$sth = $dbh->prepare( "SELECT * FROM Scott.dept" )
or die "Can't prepare SQL statement: $DBI::errstr\n";

print "Exec sql statement<br>\n";

or die "Can't execute SQL statement: $DBI::errstr\n";

### Retrieve the returned rows of data
while ( my @row = $sth->fetchrow_array() ) {
print "Row: @row\n";

warn "Data fetching terminated early by error: $DBI::errstr\n"
if $DBI::err;


Results in a browser:
Connecting to DB..

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
DBI Mysql storing DBI:binary, trouble with character 26 Jerome Hauss Ruby 0 10-13-2004 03:04 PM
DBI and DBI::Oracle packages configuration ulloa Perl 1 07-22-2004 05:52 PM
DBI problem : How can I load quickly one huge table with DBI ??. Tim Haynes Perl Misc 3 09-13-2003 03:43 AM
Mason, DBI, and DBI::Pg Asby Perl Misc 0 07-24-2003 09:04 PM
iis and dbi John Giblin Perl Misc 1 07-10-2003 05:44 PM