Did you try the sql directly on sql prompt If that works, then the hanging has nothing to do with the query itself.
Ram On Thu, 2004-05-27 at 01:54, MCMULLIN, NANCY wrote: > Does anyone know why this script hangs when it's executed? It's probably due to > the complex select statement, but I'm not sure how to make it work. > > Also, is there a good 'DBI with SQL with Perl' book out there? > > ================ > #!c:/activeperl/bin/perl > use strict; > use warnings; > use DBI; > use CGI qw(:standard escapeHTML); > print ("Content-type: text/html\n\n"); > use vars qw($dbh); > my $dbh = DBI->connect('DBI:Oracle:db', 'user', 'pw'); > my $Command = "select cl.c_oac_oban, cd.c_fund_code, > cd.d_doc_nbr, > cd.ie_dollar_amt, > cd.d_cost_cd, > cd.d_coc > from cpas_difms cd, cpas_load cl > where cd.ie_proc_cd='1' > and cl.ie_infile = cd.ie_infile > and cl.ie_seq_nbr = cd.ie_seq_nbr > union all > select gl.g_oac || gl.g_asn_oban oac_oban, gd.g_fund_code, > gd.d_doc_nbr, > gd.ie_dollar_amt, > gd.d_cost_cd, > gd.d_coc > from gafs_difms gd, gafs_load gl > where gd.ie_proc_cd='1' > and gl.ie_infile = gd.ie_infile > and gl.ie_seq_nbr = gd.ie_seq_nbr"; > my $sth = $dbh->prepare($Command); > my $rc = $sth->execute; > while (my @row = $sth->fetchrow_array) > {print "<br> $row[0] $row[1] $row[2] $row[3] $row[4] $row[5]\n";} > $sth->finish; > exit(0); > ================ > > Thanks. > Nancy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>