Hi Ganesh,

On Sat, 18 May 2013 20:11:09 +0530
Ganesh Babu N <nbabugan...@gmail.com> wrote:

> $dbh = DBI->connect("dbi:mysqlPP:$dsn;host=$host", $user, $pw,
> {PrintError => 1, RaiseError => 1});
> if (!$dbh) {
>     print "error: connection: $DBI::err\n$DBI::errstr\n$DBI::state\n";
> }
> $drh = DBI->install_driver("mysqlPP");
> $ary_ref = $dbh->selectcol_arrayref("SELECT pui,spuid FROM inven WHERE
> dispatchdate=\"0000-00-00\" and dupli is NULL LIMIT 0, 5000", {
> Columns=>[1,2] });
> %masterdb = @$ary_ref; # build hash from key-value pairs so $hash{$id} =>
> name
> $sth = $dbh->prepare("SELECT DISTINCT spuid FROM inven WHERE
> dispatchdate<>\"0000-00-00\" and dupli is NULL LIMIT 0, 1000");
> $sth->execute();
> while ( @row = $sth->fetchrow_array ) {
>     push(@dspu, "@row\.dat");
> }

This code is really bad:

1. It lacks "use strict;" and "use warnings;".

2. It doesn't throw an exception when "$dbh" is undef.

3. It is not properly indented.

4. It lacks empty lines between code paragraphs.

Please fix all those. See the link
http://perl-begin.org/tutorials/bad-elements/ on The Perl Beginners Site, which
is a site I maintain.

> 
> The above code which uses mysqlPP module is giving our of memory exception
> and not getting executed.

Why are you using mysqlPP instead of https://metacpan.org/release/DBD-mysql ?

> 
> Where as if it uses ODBC connection it is working without any exception.
> 
> first query will fetch 3000 records and 2nd query fetches 500 records. it
> may increase in later stages.
> 
> $dbh = DBI->connect("dbi:ODBC:$dsn", $user, $pw,
> {PrintError => 1, RaiseError => 1});
> if (!$dbh) {
>     print "error: connection: $DBI::err\n$DBI::errstr\n$DBI::state\n";
> }
> 
> is there any bug in mysqlPP? or am i missing something obvious.
> 

There may be.

> Please help in resolving this error.
> 
> Regards,
> Ganesh


Regards,

        Shlomi Fish


-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
List of Portability Libraries - http://shlom.in/port-libs

For every A, Chuck Norris is both A and not-A.
Chuck Norris is freaking everything.
    — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to