#!/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 ""; }