> On Tue, Aug 15, 2000 at 03:26:03PM +0400, Vladislav Safronov wrote:
> > Hi,
> >
> > Could you have a look at the lines and answer the question ..
> > ---
> > sub foo {
> > my $dbh = shift;
> >
> > my $sql = ...
> >
> > my $sth = $dbh->prepare($sql);
> > $sth->execute;
> >
On Wed, Aug 16, 2000 at 08:26:09AM +0200, Henrik Tougaard wrote:
> From: Jay Jacobs [mailto:[EMAIL PROTECTED]]
> > On Tue, 15 Aug 2000, Tom Mornini wrote:
> >
> > > It is my understanding of the DBI docs that you only need to call
> > > $sth->finish when you DON'T fetch all the rows that the
> >
On Tue, Aug 15, 2000 at 12:22:46PM -0500, Jay Jacobs wrote:
>
>
> On Tue, 15 Aug 2000, Tom Mornini wrote:
>
> > It is my understanding of the DBI docs that you only need to call
> > $sth->finish when you DON'T fetch all the rows that the $sth has ready to
> > return.
> >
>
> >From "Writing Ap
On Tue, Aug 15, 2000 at 03:26:03PM +0400, Vladislav Safronov wrote:
> Hi,
>
> Could you have a look at the lines and answer the question ..
> ---
> sub foo {
> my $dbh = shift;
>
> my $sql = ...
>
> my $sth = $dbh->prepare($sql);
> $sth->execute;
> $sth->finish;
>
Well, summarizing all the answers and assuming using Mysql
1. $sth->finish should be used if (and ONLY if) the
the returned data (any SELECT, but not INSERT, UPDATE?)
has not been fetched ALL and $sth is going to be
overwritten..
2. $sth (defined as 'my') should not call finish before
> From: Vladislav Safronov [mailto:[EMAIL PROTECTED]]
> What can you say about this code? is it ok (overwriting
> previous handle)?
>
> ==
> sub foo {
> my $dbh = shift;
>
> my $sql1 = "select *...
> my $sql2 = "select *...
>
> my $sth = $dbh->prepare($sql1);
> $
From: Jay Jacobs [mailto:[EMAIL PROTECTED]]
> On Tue, 15 Aug 2000, Tom Mornini wrote:
>
> > It is my understanding of the DBI docs that you only need to call
> > $sth->finish when you DON'T fetch all the rows that the
> $sth has ready to
> > return.
> >
>
> From "Writing Apache Modules with Pe
On Tue, 15 Aug 2000, Tom Mornini wrote:
> It is my understanding of the DBI docs that you only need to call
> $sth->finish when you DON'T fetch all the rows that the $sth has ready to
> return.
>
>From "Writing Apache Modules with Perl and C":
"You should still call finish() at the end of e
On Tue, 15 Aug 2000, Vladislav Safronov wrote:
> Ok. I think, the answers clear the problem, but I have yet more question.
>
> What can you say about this code? is it ok (overwriting previous handle)?
>
> ==
> sub foo {
> my $dbh = shift;
>
> my $sql1 = "select *...
> my $sql
Matt Sergeant writes:
> On Tue, 15 Aug 2000, Michael Peppler wrote:
>
> > Matt Sergeant writes:
> > > On Tue, 15 Aug 2000, Vladislav Safronov wrote:
> > >
> > > > Ok. I think, the answers clear the problem, but I have yet more question.
> > > >
> > > > What can you say about this c
On Tue, 15 Aug 2000, Michael Peppler wrote:
> Matt Sergeant writes:
> > On Tue, 15 Aug 2000, Vladislav Safronov wrote:
> >
> > > Ok. I think, the answers clear the problem, but I have yet more question.
> > >
> > > What can you say about this code? is it ok (overwriting previous handle)?
>
Matt Sergeant writes:
> On Tue, 15 Aug 2000, Vladislav Safronov wrote:
>
> > Ok. I think, the answers clear the problem, but I have yet more question.
> >
> > What can you say about this code? is it ok (overwriting previous handle)?
>
> [snip]
>
> Well it depends on the DBMS. For exam
On Tue, 15 Aug 2000, Keith G. Murphy wrote:
> (Boggle) Really? 'My' variables going out of scope don't always get
> freed up? Or is this strictly an object thing with DESTROY?
Well why would you care if my $str = "hello world" didn't get freed via
this bug? It only matters for objects that do
Matt Sergeant wrote:
>
> On Tue, 15 Aug 2000, Vladislav Safronov wrote:
>
> > Hi,
> >
> > Could you have a look at the lines and answer the question ..
> > ---
> > sub foo {
> > my $dbh = shift;
> >
> > my $sql = ...
> >
> > my $sth = $dbh->prepare($sql);
> > $sth->execut
On Tue, 15 Aug 2000, Vladislav Safronov wrote:
> Ok. I think, the answers clear the problem, but I have yet more question.
>
> What can you say about this code? is it ok (overwriting previous handle)?
[snip]
Well it depends on the DBMS. For example Sybase might not like it if you
haven't read
Ok. I think, the answers clear the problem, but I have yet more question.
What can you say about this code? is it ok (overwriting previous handle)?
==
sub foo {
my $dbh = shift;
my $sql1 = "select *...
my $sql2 = "select *...
my $sth = $dbh->prepare($sql1);
Matt Sergeant <[EMAIL PROTECTED]> wrote:
>
> This can be demonstrated with a very simple object class with a DESTROY
> method. There's a message somewhere in the p5p archives about this from
> me.
That's
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-03/msg00604.html
to save anyone
On Tue, 15 Aug 2000, Vladislav Safronov wrote:
> "my" (perl's my) variables doesn't always get destoyed, does it Perl's
> documentation say that "my" vars are the most safe since they get destroyed
> when they get out of scope ...
I said this was a bug in Perl, although I don't think that 5
> On Tue, 15 Aug 2000, Vladislav Safronov wrote:
>
> > Hi,
> >
> > Could you have a look at the lines and answer the question ..
> > ---
> > sub foo {
> > my $dbh = shift;
> >
> > my $sql = ...
> >
> > my $sth = $dbh->prepare($sql);
> > $sth->execute;
> > $sth->finish;
> >
>From: Vladislav Safronov [mailto:[EMAIL PROTECTED]]
> sub foo {
> my $dbh = shift;
>
> my $sql = ...
>
> my $sth = $dbh->prepare($sql);
> $sth->execute;
> $sth->finish;
> }
> ===
> Do I always need to call $sth->finish? Wouldn't it be
> automaticly called when
> s
On Tue, 15 Aug 2000, Vladislav Safronov wrote:
> Hi,
>
> Could you have a look at the lines and answer the question ..
> ---
> sub foo {
> my $dbh = shift;
>
> my $sql = ...
>
> my $sth = $dbh->prepare($sql);
> $sth->execute;
> $sth->finish;
> }
> ===
> Do I alway
as written in the manpage, this is rarely used, it will be called for you
when the handle is going out of scope, but if something is still left in the
buffer some warnings will be generated.
-Original Message-
From: Vladislav Safronov
To: [EMAIL PROTECTED]
Sent: 8/15/00 7:26 PM
Subject:
22 matches
Mail list logo