DBD::Oracle

2005-11-16 Thread piet paaltjens
Dear Jay,
  
  some time ago you've helped me to try and get Oracleinstantclient 10.2  to 
work on my machine. You even sent me your installed software. For  me, alas, it 
did not work. Just to let you know, recently I've found  info about how to 
install Oracle 9 and/or 10 on Fedora Core. Now I've  got my system running as 
it did some time ago. Thanks alot for your  effort(s).
  
  
  


-
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: Can't connect to MySQL server (99)

2005-11-16 Thread Badai Aqrandista



Where is the database located? Is it local or remote? You might be
experiencing lost of connection to the host. If your using a URL
instead of the IP address you should check that the DNS server you are
using works fine, etc. In resume, it could be a lot of things related
to connectivity.


It's local. I think I'll just use IP address to prevent name resolving 
issues to come up.


Thanks a lot.

---
Badai Aqrandista
Cheepy (?)

_
REALESTATE: biggest buy/rent/share listings   
http://ninemsn.realestate.com.au




Re: Can't connect to MySQL server (99)

2005-11-16 Thread garbaro
Where is the database located? Is it local or remote? You might be
experiencing lost of connection to the host. If your using a URL
instead of the IP address you should check that the DNS server you are
using works fine, etc. In resume, it could be a lot of things related
to connectivity.


2005/11/16, Badai Aqrandista <[EMAIL PROTECTED]>:
> >System error: 99 = Cannot assign requested address. are you using the
> >correct host??
>
> Yes, definitely. This error occurs intermittently. Most of the time the code
> works, but sometime it doesn't and throws this error. I don't think it is
> related to load because sometime this error happens in off-peak period.
>
> Do you have any other idea why this is happening? I've been chasing this
> error for a week. Previously, another error came up often: 'fetch() without
> execute()'. Then I started using 'Apache::DBI' and then that error disappear
> and this error starts to happen.
>
> Thanks...
>
> >
> >
> >
> >Badai Aqrandista wrote:
> >>Hi All,
> >>
> >>I am using Apache::DBI in a mod_perl environment. Intermittently, I get
> >>the following error message:
> >>
> >>DBI connect('host=db-server.net;database=elres','elres',...) failed: Can't
> >>connect to MySQL server on 'db-server.net' (99)
> >>
> >>I read in MySQL documentation that their server error codes are between
> >>1000 to 1999 and client error codes are between 2000 to 2999.
> >>
> >>Does anyone know what does this error mean? Or can anyone point me to
> >>where I can get more information?
> >>
> >>Thanks...
> >>
> >>---
> >>Badai Aqrandista
> >>Cheepy (?)
> >>
> >>
> >>
> >>
> >>
> >>>From: "Lincoln A. Baxter" <[EMAIL PROTECTED]>
> >>>Reply-To: [EMAIL PROTECTED]
> >>>To: Markus Trenkle <[EMAIL PROTECTED]>
> >>>CC: dbi-users@perl.org
> >>>Subject: Re: Compiling dbd-oracle on hpux64
> >>>Date: Tue, 15 Nov 2005 23:04:07 -0500
> >>>
> >>>On Wed, 2005-11-09 at 19:54 +0100, Markus Trenkle wrote:
> >>> > Tim Bunce <[EMAIL PROTECTED]> wrote:
> >>> >
> >>> > > Of course, please do. A patch to Makefile.PL would be nice.
> >>> >
> >>> > That's my problem. I don't speak perl, I'm merely the unix admin who
> >>>has
> >>> > to install the software. I corrected the generated Makefiles by
> >>> > skript/hand. This seems to be successfull.
> >>> >
> >>> > Markus
> >>> >
> >>>If you are willing to test a new Makefile.PL after I update it, (since I
> >>>am already familiar with it), send me a context diff of the original
> >>>(generated Makefile), and the version you hacked that worked.
> >>>
> >>>If I can figure out what you did, and you will test the resulting
> >>>Makefile.PL, I will take a stab at it.
> >>>
> >>>Lincoln
> >>>
> >>>
> >>
> >>_
> >>SEEK: Over 80,000 jobs across all industries at Australia's #1 job site.
> >>http://ninemsn.seek.com.au?hotmail
> >>
> >>
> >>
> >
> >
> >--
> >Mike(mickalo)Blezien
> >=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> >Thunder Rain Internet Publishing
> >Providing Internet Solutions that work!
> >http://thunder-rain.com/
> >=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> >
>
>
> ---
> Badai Aqrandista
> Cheepy (?)
>
> _
> REALESTATE: biggest buy/rent/share listings
> http://ninemsn.realestate.com.au
>
>


Re: Can't connect to MySQL server (99)

2005-11-16 Thread Badai Aqrandista
System error: 99 = Cannot assign requested address. are you using the 
correct host??


Yes, definitely. This error occurs intermittently. Most of the time the code 
works, but sometime it doesn't and throws this error. I don't think it is 
related to load because sometime this error happens in off-peak period.


Do you have any other idea why this is happening? I've been chasing this 
error for a week. Previously, another error came up often: 'fetch() without 
execute()'. Then I started using 'Apache::DBI' and then that error disappear 
and this error starts to happen.


Thanks...





Badai Aqrandista wrote:

Hi All,

I am using Apache::DBI in a mod_perl environment. Intermittently, I get 
the following error message:


DBI connect('host=db-server.net;database=elres','elres',...) failed: Can't 
connect to MySQL server on 'db-server.net' (99)


I read in MySQL documentation that their server error codes are between 
1000 to 1999 and client error codes are between 2000 to 2999.


Does anyone know what does this error mean? Or can anyone point me to 
where I can get more information?


Thanks...

---
Badai Aqrandista
Cheepy (?)






From: "Lincoln A. Baxter" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: Markus Trenkle <[EMAIL PROTECTED]>
CC: dbi-users@perl.org
Subject: Re: Compiling dbd-oracle on hpux64
Date: Tue, 15 Nov 2005 23:04:07 -0500

On Wed, 2005-11-09 at 19:54 +0100, Markus Trenkle wrote:
> Tim Bunce <[EMAIL PROTECTED]> wrote:
>
> > Of course, please do. A patch to Makefile.PL would be nice.
>
> That's my problem. I don't speak perl, I'm merely the unix admin who 
has

> to install the software. I corrected the generated Makefiles by
> skript/hand. This seems to be successfull.
>
> Markus
>
If you are willing to test a new Makefile.PL after I update it, (since I
am already familiar with it), send me a context diff of the original
(generated Makefile), and the version you hacked that worked.

If I can figure out what you did, and you will test the resulting
Makefile.PL, I will take a stab at it.

Lincoln




_
SEEK: Over 80,000 jobs across all industries at Australia's #1 job site.   
http://ninemsn.seek.com.au?hotmail







--
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://thunder-rain.com/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=




---
Badai Aqrandista
Cheepy (?)

_
REALESTATE: biggest buy/rent/share listings   
http://ninemsn.realestate.com.au




Re: Can't connect to MySQL server (99)

2005-11-16 Thread Mike Blezien

System error: 99 = Cannot assign requested address. are you using the correct 
host??



Badai Aqrandista wrote:

Hi All,

I am using Apache::DBI in a mod_perl environment. Intermittently, I get 
the following error message:


DBI connect('host=db-server.net;database=elres','elres',...) failed: 
Can't connect to MySQL server on 'db-server.net' (99)


I read in MySQL documentation that their server error codes are between 
1000 to 1999 and client error codes are between 2000 to 2999.


Does anyone know what does this error mean? Or can anyone point me to 
where I can get more information?


Thanks...

---
Badai Aqrandista
Cheepy (?)






From: "Lincoln A. Baxter" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: Markus Trenkle <[EMAIL PROTECTED]>
CC: dbi-users@perl.org
Subject: Re: Compiling dbd-oracle on hpux64
Date: Tue, 15 Nov 2005 23:04:07 -0500

On Wed, 2005-11-09 at 19:54 +0100, Markus Trenkle wrote:
> Tim Bunce <[EMAIL PROTECTED]> wrote:
>
> > Of course, please do. A patch to Makefile.PL would be nice.
>
> That's my problem. I don't speak perl, I'm merely the unix admin who 
has

> to install the software. I corrected the generated Makefiles by
> skript/hand. This seems to be successfull.
>
> Markus
>
If you are willing to test a new Makefile.PL after I update it, (since I
am already familiar with it), send me a context diff of the original
(generated Makefile), and the version you hacked that worked.

If I can figure out what you did, and you will test the resulting
Makefile.PL, I will take a stab at it.

Lincoln




_
SEEK: Over 80,000 jobs across all industries at Australia's #1 job 
site.   http://ninemsn.seek.com.au?hotmail







--
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://thunder-rain.com/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



Can't connect to MySQL server (99)

2005-11-16 Thread Badai Aqrandista

Hi All,

I am using Apache::DBI in a mod_perl environment. Intermittently, I get the 
following error message:


DBI connect('host=db-server.net;database=elres','elres',...) failed: Can't 
connect to MySQL server on 'db-server.net' (99)


I read in MySQL documentation that their server error codes are between 1000 
to 1999 and client error codes are between 2000 to 2999.


Does anyone know what does this error mean? Or can anyone point me to where 
I can get more information?


Thanks...

---
Badai Aqrandista
Cheepy (?)






From: "Lincoln A. Baxter" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: Markus Trenkle <[EMAIL PROTECTED]>
CC: dbi-users@perl.org
Subject: Re: Compiling dbd-oracle on hpux64
Date: Tue, 15 Nov 2005 23:04:07 -0500

On Wed, 2005-11-09 at 19:54 +0100, Markus Trenkle wrote:
> Tim Bunce <[EMAIL PROTECTED]> wrote:
>
> > Of course, please do. A patch to Makefile.PL would be nice.
>
> That's my problem. I don't speak perl, I'm merely the unix admin who has
> to install the software. I corrected the generated Makefiles by
> skript/hand. This seems to be successfull.
>
> Markus
>
If you are willing to test a new Makefile.PL after I update it, (since I
am already familiar with it), send me a context diff of the original
(generated Makefile), and the version you hacked that worked.

If I can figure out what you did, and you will test the resulting
Makefile.PL, I will take a stab at it.

Lincoln




_
SEEK: Over 80,000 jobs across all industries at Australia's #1 job site.   
http://ninemsn.seek.com.au?hotmail




RE: anyway to determine # rows before fetch loop ends and without seperate count(*)

2005-11-16 Thread Rutherdale, Will
It doesn't work according to the DBI documentation.
 
>From _Programming the Perl DBI_, p. 223 (for example):
 
>For SELECT statements, execute simply "starts" the query within the
database engine.  Use one of
>the fetch methods to retrieve the data after calling execute.  The execute
method does _not_ return
>the number of rows that will be returned by the query (because most
databases can't tell in advance),
>it simply returns a true value.
 
If you are relying on that 'feature' you are asking for trouble.
 
There have been discussions over this issue on the list before.
 
-Will
 
-Original Message-
From: Rob Craig [mailto:[EMAIL PROTECTED] 
Sent: Wednesday 16 November 2005 17:19
To: [EMAIL PROTECTED]
Cc: dbi-users@perl.org
Subject: Re: anyway to determine # rows before fetch loop ends and without
seperate count(*)


I am using DBD::mysql and I can get the number of rows by assigning the
result of the execute to a scalar:

my $rows = $sth->execute or die "Couldn't execute statement: " .
DBI->errstr;

maybe this doesn't work with DBD::Oracle?

Rob


 



 - - - - - - -  Appended by Scientific-Atlanta, Inc.  - - - - - - -  
This e-mail and any attachments may contain information which is confidential, 
proprietary, privileged or otherwise protected by law. The information is 
solely intended for the named addressee (or a person responsible for delivering 
it to the addressee). If you are not the intended recipient of this message, 
you are not authorized to read, print, retain, copy or disseminate this message 
or any part of it. If you have received this e-mail in error, please notify the 
sender immediately by return e-mail and delete it from your computer.



Re: anyway to determine # rows before fetch loop ends and without seperate count(*)

2005-11-16 Thread Dan Scott
On 11/16/05, Rob Craig <[EMAIL PROTECTED]> wrote:
>  I am using DBD::mysql and I can get the number of rows by assigning the
> result of the execute to a scalar:
>
>  my $rows = $sth->execute or die "Couldn't execute statement: " .
> DBI->errstr;
>
>  maybe this doesn't work with DBD::Oracle?
>
>  Rob


When you execute a SELECT statement in MySQL, it (by default)
immediately returns all of the rows back to you under the covers,
which is why it is able to give you a row count. Woe betide you if
your SELECT statement returns a million rows.

>
>  [EMAIL PROTECTED] wrote:
>  #Here's an example which shows what I am trying to accomplish. If I
> can determine the number of rows before pushing the data, this can
> simply things for #me when processing the data throught my scripts.
> #
> use warnings;
> use strict;
> use DBI;
> use DBD::Oracle;
>
> my $sql=q{ select name, location
>  from mytable
> };
>
> my $dbh;
>
> eval {
>  $dbh = DBI->connect("dbi:Oracle:MYDB",
>  'dbuser', 'dbpass',
>  {
>  RaiseError => 1,
>  AutoCommit => 0,
>  ora_session_mode => 0
>  }
>  );
> };
>
> if ( $@ ) {
>  outprint('end',"$DBI::errstr\n");
> }
>
> my $sth=$dbh->prepare($sql) or die "Couldn't prepare statement: " . DBI-
>
>
>  errstr;
>
>  $sth->execute or die "Couldn't execute statement: " . DBI->errstr;
>
> my $ary;
>
> while ($ary = $sth->fetchrow_array()) {
>  #I need to determine number of rows as this will affect
> whether a matrix is used or not
>  #a boolean variable $matrix could be returned or a ref
> check done so that the data
>  #processing code can act accordingly
>  #$sth->rows only shows total rows after the while loop
> is processed
>  #Can I accomplish this without a seperate count(*)
> statement?
>  #
>  #push @newary,[ @{$ary} ]; # if more than one row
>  #or
>  #push @newary, @{$ary} ; # single row
> }
>
> $sth->finish;
>
> $dbh->disconnect;
> #
> #ActivePerl 5.8.7 813
> #ppm
> #-DBD-Oracle 1.16
> #-DBI 1.48
>
>
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.13.3/173 - Release Date: 11/16/2005
>
>
>


Re: anyway to determine # rows before fetch loop ends and without seperate count(*)

2005-11-16 Thread JupiterHost.Net



[EMAIL PROTECTED] wrote:

#Here's an example which shows what I am trying to accomplish.  If I 
can determine the number of rows before pushing the data, this can 
simply things for #me when processing the data throught my scripts.  
#

use warnings;
use strict;


Good good :)


use DBI;
use DBD::Oracle;

my $sql=q{  select name, location
from mytable
};

my $dbh;

eval {
$dbh = DBI->connect("dbi:Oracle:MYDB",
'dbuser', 'dbpass',
  {
   RaiseError => 1,
   AutoCommit => 0,
   ora_session_mode => 0
  }
);
};

if ( $@ ) {
outprint('end',"$DBI::errstr\n");
}


Hmm, perhaps the oracle specific stuff needs it but why are you evaling 
that?


my $dbh = DBI->connect(@DBI_CONNECT_ARGS) or outprint('end', 
$DBI::errstr); # assumign its die()ing or exit()ing




my $sth=$dbh->prepare($sql) or die "Couldn't prepare statement: " . DBI-


errstr;



$sth->execute or die "Couldn't execute statement: " . DBI->errstr;

my $ary;

while ($ary = $sth->fetchrow_array()) {
#I need to determine number of rows as this will affect 
whether a matrix is used or not


Also very convoluted, all of that can be done with:

my $results = $dbh->selectall_arrayref($sql); # if you only want to 
process a certain amount just LIMIT in your $sql...


my $count = @{ $results };

$dbh->disconnect;

if($count < 1000) { # or whatever you wanted teh count for...
for my $record(@{ $results }) {
# now use the data:
# $record->[0]
# $record->[1]
}
}


Re: anyway to determine # rows before fetch loop ends and without seperate count(*)

2005-11-16 Thread Rob Craig




I am using DBD::mysql and I can get the number of rows by assigning the
result of the execute to a scalar:

my $rows = $sth->execute or die "Couldn't execute statement: " .
DBI->errstr;

maybe this doesn't work with DBD::Oracle?

Rob

[EMAIL PROTECTED] wrote:

  #Here's an example which shows what I am trying to accomplish.  If I 
can determine the number of rows before pushing the data, this can 
simply things for #me when processing the data throught my scripts.  
#
use warnings;
use strict;
use DBI;
use DBD::Oracle;

my $sql=q{  select name, location
from mytable
};

my $dbh;

eval {
$dbh = DBI->connect("dbi:Oracle:MYDB",
'dbuser', 'dbpass',
  {
   RaiseError => 1,
   AutoCommit => 0,
   ora_session_mode => 0
  }
);
};

if ( $@ ) {
outprint('end',"$DBI::errstr\n");
}

my $sth=$dbh->prepare($sql) or die "Couldn't prepare statement: " . DBI-
  
  
errstr;

  
  
$sth->execute or die "Couldn't execute statement: " . DBI->errstr;

my $ary;

while ($ary = $sth->fetchrow_array()) {
#I need to determine number of rows as this will affect 
whether a matrix is used or not
#a boolean variable $matrix could be returned or a ref 
check done so that the data 
#processing code can act accordingly
#$sth->rows only shows total rows after the while loop 
is processed
#Can I accomplish this without a seperate count(*) 
statement?
#
#push @newary,[ @{$ary} ]; # if more than one row
#or
#push @newary, @{$ary} ; # single row
}

$sth->finish;

$dbh->disconnect;
#
#ActivePerl 5.8.7 813
#ppm
#-DBD-Oracle 1.16
#-DBI 1.48


  



No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.3/173 - Release Date: 11/16/2005


RE: anyway to determine # rows before fetch loop ends and without seperate count(*)

2005-11-16 Thread Reidy, Ron
The short answer is ... No.

The long answer is ...

How could the DBI (or the SQL and/or PL/SQL engine for that matter) know
in advance of getting the data, how much would be retrieved?  According
to the concepts manual, part II, chapter 13 for 10gR2:

In a single-user database, the user can modify data in the database
without concern for
other users modifying the same data at the same time. However, in a
multiuser
database, the statements within multiple simultaneous transactions can
update the
same data. Transactions executing at the same time need to produce
meaningful and
consistent results.

Given this, there is no way for the DBI to know how much data will be
retrieved by a SELECT statement.

--
Ron Reidy
Lead DBA
Array BioPharma, Inc.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 16, 2005 2:27 PM
To: dbi-users@perl.org
Subject: anyway to determine # rows before fetch loop ends and without
seperate count(*)


#Here's an example which shows what I am trying to accomplish.  If I 
can determine the number of rows before pushing the data, this can 
simply things for #me when processing the data throught my scripts.  
#
use warnings;
use strict;
use DBI;
use DBD::Oracle;

my $sql=q{  select name, location
from mytable
};

my $dbh;

eval {
$dbh = DBI->connect("dbi:Oracle:MYDB",
'dbuser', 'dbpass',
  {
   RaiseError => 1,
   AutoCommit => 0,
   ora_session_mode => 0
  }
);
};

if ( $@ ) {
outprint('end',"$DBI::errstr\n");
}

my $sth=$dbh->prepare($sql) or die "Couldn't prepare statement: " . DBI-
>errstr;

$sth->execute or die "Couldn't execute statement: " . DBI->errstr;

my $ary;

while ($ary = $sth->fetchrow_array()) {
#I need to determine number of rows as this will affect 
whether a matrix is used or not
#a boolean variable $matrix could be returned or a ref 
check done so that the data 
#processing code can act accordingly
#$sth->rows only shows total rows after the while loop 
is processed
#Can I accomplish this without a seperate count(*) 
statement?
#
#push @newary,[ @{$ary} ]; # if more than one row
#or
#push @newary, @{$ary} ; # single row
}

$sth->finish;

$dbh->disconnect;
#
#ActivePerl 5.8.7 813
#ppm
#-DBD-Oracle 1.16
#-DBI 1.48

This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is 
intended 
to be for the use of the individual or entity named above. If you are not the 
intended recipient, please be aware that any disclosure, copying, distribution 
or use of the contents of this information is prohibited. Please notify the
sender  of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.



anyway to determine # rows before fetch loop ends and without seperate count(*)

2005-11-16 Thread listmail
#Here's an example which shows what I am trying to accomplish.  If I 
can determine the number of rows before pushing the data, this can 
simply things for #me when processing the data throught my scripts.  
#
use warnings;
use strict;
use DBI;
use DBD::Oracle;

my $sql=q{  select name, location
from mytable
};

my $dbh;

eval {
$dbh = DBI->connect("dbi:Oracle:MYDB",
'dbuser', 'dbpass',
  {
   RaiseError => 1,
   AutoCommit => 0,
   ora_session_mode => 0
  }
);
};

if ( $@ ) {
outprint('end',"$DBI::errstr\n");
}

my $sth=$dbh->prepare($sql) or die "Couldn't prepare statement: " . DBI-
>errstr;

$sth->execute or die "Couldn't execute statement: " . DBI->errstr;

my $ary;

while ($ary = $sth->fetchrow_array()) {
#I need to determine number of rows as this will affect 
whether a matrix is used or not
#a boolean variable $matrix could be returned or a ref 
check done so that the data 
#processing code can act accordingly
#$sth->rows only shows total rows after the while loop 
is processed
#Can I accomplish this without a seperate count(*) 
statement?
#
#push @newary,[ @{$ary} ]; # if more than one row
#or
#push @newary, @{$ary} ; # single row
}

$sth->finish;

$dbh->disconnect;
#
#ActivePerl 5.8.7 813
#ppm
#-DBD-Oracle 1.16
#-DBI 1.48