shadowfae has asked for the wisdom of the Perl Monks concerning the following question:
$myvar="location.location_code = '${l}' "
$retcode is always 0E0. It should be >1200 rows. $query prints out fine, and I cut and pasted that printed value into sqlplus to make sure I was using the same query. What am I missing?my $dbh = DBI->connect('DBI:Oracle:','user', 'pass', { RaiseError => 1 + }) or die "Could not connect to Oracle backend: $DBI::errstr"; my $query = "select bib_mfhd.bib_id from mfhd_master, bib_mfhd, bib_location, location where ( $myvar ) and bib_mfhd.mfhd_id = mfhd_master.mfhd_id and bib_location.location_id = location.location_id and bib_mfhd.bib_id = bib_location.bib_id and mfhd_master.suppress_in_opac='N' and display_call_no is not null order by bib_id asc"; print "$query\n" if ($ARGV[0] eq "-d"); my $sth = $dbh->prepare($query) || die "Failed preparing the q +uery. WTF?"; my $retcode = $sth->execute;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Query works in sqlplus but not DBI
by moritz (Cardinal) on Feb 29, 2008 at 14:09 UTC | |
|
Re: Query works in sqlplus but not DBI
by olus (Curate) on Feb 29, 2008 at 14:07 UTC | |
|
Re: Query works in sqlplus but not DBI
by stiller (Friar) on Feb 29, 2008 at 14:10 UTC | |
by shadowfae (Initiate) on Feb 29, 2008 at 14:33 UTC | |
by moritz (Cardinal) on Feb 29, 2008 at 14:42 UTC | |
by shadowfae (Initiate) on Feb 29, 2008 at 14:58 UTC |