newperldeveloper has asked for the wisdom of the Perl Monks concerning the following question:
If I try to do another query it fails and give an errormy $prod_dbh = DBI->connect_cached('DBI:Sybase:database','web_','web') + || die "Couldn't connect to DB!\n" . DBI->errstr; my $parent_sth = $prod_dbh->prepare_cached('select * from table where +id = ?'); $parent_sth->bind_param(1,$id); $parent_sth->execute(); my @parent_data = $parent_sth->fetchrow_array();
Fails with statement handle DBI::st=HASH(0x1ed1280) still Active at When I add the line $parent_sth->finish(); to the first block of code. I get no data from the @child_data If I just grab the query and run it data is returned so I know the result should contain data but nothing is being returned when I dump child_data. I know it is executing the code when I print after the dumper I get my printed content. I was reading I need tomy $child_sth = $prod_dbh->prepare_cached('select * from table2 where +id = ?'); $child_sth->bind_param(1,$parent_data[0]); $child_sth->execute(); my @child_data = $child_sth->fetchrow_array(); print Dumper(@child_data);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl DBI connect cached still active
by tybalt89 (Monsignor) on Oct 29, 2020 at 01:53 UTC | |
by newperldeveloper (Sexton) on Oct 29, 2020 at 11:03 UTC | |
by Corion (Patriarch) on Oct 29, 2020 at 11:11 UTC | |
by derby (Abbot) on Oct 30, 2020 at 10:43 UTC | |
by tybalt89 (Monsignor) on Oct 29, 2020 at 13:52 UTC |