aennen has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use DBI; my @listOfPaths; my @listOfNames; my %dbf; my $linkpage; my %rels=(); my %relsdt=(); my %vals=(); my $dbh; $ENV{"ORACLE_HOME"}="ORACLE_HOME=/oravl01/oracle/8.0.6/"; $ENV{"TWO_TASK"}="nxt1"; &sqlConnect("alan1", "alan1"); &getRef; &sqlDisconnect; ###################################################################### +############# sub sqlConnect() { $connectString=join '/', $_[0], $_[1]; $dbh = DBI->connect('dbi:Oracle:',$connectString); unless ($dbh) { &showSQLError($DBI::errstr); } } ###################################################################### +############# sub sqlDisconnect() { $dbh->disconnect; } ###################################################################### +############# sub getRef() { $statement = "select * from OPEN_ISSUES order by OI_REFERENCE asc" +; print "$statement\n"; $rqry = $dbh->prepare($statement) or &showSQLError($dbh->errstr); $rqry->execute or &showSQLError($DBI::errstr); &showSQLError($DBI::errstr); unless ($dbh) { &showSQLError($DBI::errstr); } print "\n#"; while($oir=$rqry->fetchrow_hashref) { print "\n- $oir->{'OI_REFERENCE'}"; } print "\n#\n"; $rqry->finish or &showSQLError($DBI::errstr); print "- $oir->{'OI_REFERENCE'}\n"; } sub showSQLError() { print "<SCRIPT> alert('$_[0]');</SCRIPT>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl : DBI and Oracle
by chromatic (Archbishop) on Jan 09, 2003 at 23:00 UTC | |
|
Re: Perl : DBI and Oracle
by rbc (Curate) on Jan 09, 2003 at 19:38 UTC | |
by steves (Curate) on Jan 09, 2003 at 19:47 UTC | |
by aennen (Acolyte) on Jan 09, 2003 at 20:23 UTC |