Hi All,

I did a trial and error by reducing the {LongReadLen} and the script is running without any problems.

#$dbh_prod->{LongReadLen} = 100000000;
$dbh_prod->{LongReadLen}=30000000;

My 'select' reads the data from a long field, specifying {LongReadLen} to a higher value might have been causing the unable to allocate memory error.

Thanks,
-Jibo



At 04:05 PM 11/13/2002 -0800, Steven Hajducko wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Also,

Why use eval?  I believe ( from my minor experience here.. ) that
eval is meant to do 2 things.

a) execute code at runtime -
        my $code_snip = "print 'hi\n'";
        eval $code_snip

        would print:

        hi

b) trap errors that would otherwise kill the program.

In your case, you're killing your script anyways if the eval fails.
So why not just do...

print $stmt2;
$csr2 = $dbh_prod->prepare($stmt2) or die
$dbh_prod->trace(6),"\n\nCould not prepare statement:
\n",$dbh_prod->errstr();

Like I said, my perl experience is small, so I'm not sure if maybe
the whole eval testing thing is taking up too much memory or what.

Hope it helps,

- --
sh


- -----Original Message-----
From: Jibo John [mailto:jijohn@;cisco.com]
Sent: Wednesday, November 13, 2002 3:31 PM
To: [EMAIL PROTECTED]
Subject: DBI giving unable to allocate memory error


Folks,

I am running into a problem here:

My script is running on:

Solaris SunOS  5.8 Generic_108528-15 sun4u sparc
SUNW,Ultra-Enterprise
Perl 5.6.1
DBI 1.18
DBD::Oracle 1.07


It gives the following error while preparing a select query:
DBD::Oracle::db prepare failed: ORA-01062: unable to allocate memory
for
define buffer (DBD ERROR: OCIDefineByPos) at script.pl line 159.

Here is the code snippet:
print $stmt2;
eval{
$csr2 = $dbh_prod->prepare($stmt2);
};
if($@){
      $dbh_prod->trace(6);
      die "prepare failed : $DBI::errstr\n"
}

A 'select count(*)' of the same query $stmt2 runs without any issues.

Here is the Oracle trace 6 output:

DBI::db=HASH(0x208b10) trace level set to 6 in DBI 1.18-nothread
     Note: perl is running without the recommended perl -w option
     -> $DBI::errstr (&) FETCH from lasth=DBI::db=HASH(0x208b10)
prepare failed : ORA-01062: unable to allocate memory for define
buffer
(DBD ERROR: OCIDefineByPos)
     -> DESTROY for DBD::Oracle::db (DBI::db=HASH(0x208b10)~INNER)
Issuing rollback() for database handle being DESTROY'd without
explicit
disconnect() during global destruction.
OCITransRollback(22d0e4,22d30c,0)=SUCCESS
OCISessionEnd(22d0e4,22d30c,239724,0)=SUCCESS
OCIServerDetach(22d150,22d30c,0)=SUCCESS
OCIHandleFree(239724,9)=SUCCESS
OCIHandleFree(22d150,8)=SUCCESS
OCIHandleFree(22d0e4,3)=SUCCESS
OCIHandleFree(22d30c,2)=SUCCESS
     <- DESTROY= undef during global destruction.


Any help regarding this is highly appreciated.

Thanks,
- -Jibo





-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>

iQA/AwUBPdLor5j4tZe4p/BuEQKrOQCeMqKOvBIm1ki7tm7gRv6wnRuPI+EAoOdB
3YUwCyosfQ6As1dLKa1rDdDt
=jH75
-----END PGP SIGNATURE-----



Reply via email to