Re: DBD-Oracle-1.16 Error on AIX 5.3

2008-09-02 Thread John Scoles

Can you send us the output of the Perl Makefile.PL?

At first glance it look like you are trying to compile against an old 
client?


Deo wrote:

Hello...

 I am trying to build DBD-Oracle-1.16 on AIX box..

my env ...looks like this...
PROD $ env
AUTHSTATE=compat
SHELL=/usr/bin/bash
TERM=xterm
TMPDIR=/tmp
ORACLE_PATH=/oracle/product/10.0.2/bin:/opt/bin:/usr/oracle/local:/
bin:/usr/ccs/bin:/usr/bin
go=/export/home/oracle/DevStr
OLDPWD=/
LOCPATH=/usr/lib/nls/loc
USER=root
ORACLE_SID=PROD
ODMDIR=/etc/objrepos
ORACLE_BASE=/oracle
TNS_ADMIN=/oracle/product/10.0.2/network/admin
MAIL=/usr/spool/mail/root
PATH=/usr/loal/bin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/oracle/
product/10.0.2/bin:/etc:/usr/ccs/bin:/usr/ucb:/usr/sbin:/usr/local/bin
LOGIN=root
PWD=/DBD-Oracle-1.22
LANG=en_US
TZ=PST8PDT
PS1=PROD $
SHLVL=1
HOME=/
LC__FASTMSG=true
MAILMSG=[YOU HAVE NEW MAIL]
LOGNAME=root
DISPLAY=192.168.1.13:0.0
ORACLE_HOME=/oracle/product/10.0.2
_=/usr/bin/env
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
LD_LIBRARY_PATH=/oracle/product/10.0.2/lib:/oracle/product/10.0.2/
lib32
PROD $
and when I am trying to run make it give me..the following
err...please help.

PROD $ make
/usr/local/bin/perl /usr/local/lib/perl5/5.8.8/ExtUtils/
xsubpp  -typemap /usr/local/lib/perl5/5.8.8/ExtUtils/typemap
Oracle.xs > Oracle.xsc && mv Oracle.xsc Oracle.c
Error: 'OCILobLocator *' not in typemap in Oracle.xs, line 277
Error: 'OCILobLocator *' not in typemap in Oracle.xs, line 331
Error: 'OCILobLocator *' not in typemap in Oracle.xs, line 385
Error: 'OCILobLocator *' not in typemap in Oracle.xs, line 433
Error: 'OCILobLocator *' not in typemap in Oracle.xs, line 451
Error: 'OCILobLocator *' not in typemap in Oracle.xs, line 470
make: 1254-004 The error code from the last command is 1.




  


Re: question about DBD::Oracle

2008-09-02 Thread John Scoles

Sorry for the late reply I have been off on vacation for the past few weeks.

DBD::Oracle has been successfully installed with 2008 but I have not 
done it. If have CC the DBI-users list with this post as someone there 
might have gotten it to work.


First of I would say you do not have the correct libs from MS linked 
into your project. Having never used VC++ 2008 I can't really help you 
here. You might have to install the .net stuff?


Chuck Pareto wrote:


Hi,

I have a question I would like to ask you.

I just installed Oracle 10g on a Win 2003 Server 64 bit machine with 
the latest version of Perl 5.10 (64 bit version)


I need to install DBD::Oracle and I’m having trouble with the makefile.pl

I downloaded and installed VC++ 2008 to use, but I don’t know if this 
is the best version. In the readme, you say to use MS Visual Toolkit 
2003 and the SDK.


Do you think I should go and install the app you suggest and try with 
them, because I’m getting a no linker issue with the makefile.pl and 
other notes that say:


Linker: not found

Sysliblist:

Note (probably harmless): No library found for kernel32.lib

Note (probably harmless): No library found for user32.lib

Note (probably harmless): No library found for gdi32.lib

Note (probably harmless): No library found for winspool.lib

Note (probably harmless): No library found for comdlg32.lib

Note (probably harmless): No library found for advapi32.lib

Note (probably harmless): No library found for shell32.lib

Note (probably harmless): No library found for ole32.lib

Note (probably harmless): No library found for oleaut32.lib

Note (probably harmless): No library found for netapi32.lib

Note (probably harmless): No library found for uuid.lib

Note (probably harmless): No library found for ws2_32.lib

Note (probably harmless): No library found for mpr.lib

Note (probably harmless): No library found for winmm.lib

Note (probably harmless): No library found for version.lib

Note (probably harmless): No library found for odbc32.lib

Note (probably harmless): No library found for odbccp32.lib

Note (probably harmless): No library found for bufferoverflowU.lib

LD_RUN_PATH=C:/oracle/product/10.2.0/client_1/lib:C:/oracle/product/10.2.0/client_1/rdbms/lib

Using DBD::Oracle 1.22.

Using DBD::Oracle 1.22.

Using DBI 1.604 (for perl 5.01 on MSWin32-x64-multi-thread) 
installed in C:/Perl64/lib/auto/DBI/


Writing Makefile for DBD::Oracle

*** If you have problems...

read all the log printed above, and the README and README.help.txt files.

(Of course, you have read README by now anyway, haven't you?)

I haven’t tried to continue on for fear that it won’t work. Can you 
give me any advice???


-Chuck



ATTENTION: DO NOT read, copy or disseminate this communication unless 
you are the intended addressee. This message and any file(s) or 
attachment(s) transmitted with it are confidential, intended only for 
the named recipient, and may contain information that is a trade 
secret, proprietary, protected by the attorney work product doctrine, 
subject to the attorney-client privilege, or is otherwise protected 
against unauthorized use or disclosure. This message and any file(s) 
or attachment(s) transmitted with it are transmitted based on a 
reasonable expectation of privacy consistent with ABA Formal Opinion 
No. 99-413. If you have received this communication in error, please 
e-mail the sender and notify the sender immediately that you have 
received the communication in error. Thank you.


Re: Why do I encounter this error ? ORA-12705 : Cannot access NLS data files or invalid environment specified

2008-07-31 Thread John Scoles



[EMAIL PROTECTED] wrote:

Hello John

I think you shot very well and very fast :-)

I compiled DBD::Oracle with the 32 client of Oracle 9i that is installed in 
64bit too.

So because NLS data in Oracle 9i are stored by default in 
/app/oracle/product/9.2.0/enterprise64bit/ocommon/nls/admin/data
I set the ORA_NLS33 to this path (I set ORA_NLS33 because I am using within 
Perl the Oracle 9i client library).
And then it works !

  
I am glad It was sort of a wisdom guess on my part. I have never used 
32/64 bit boxes but I have seen lots of posts on this vain
So I am happy : it works but I am confused now. 
Did I do something wrong ?
  
No nothing these configuration snafus happen all the time especially 
when working on 32/64 bit boxes

My environment is a mix of Oracle 9i and Oracle 10g installed in 64bit on 
different Unix
I decided to build DBD::Oracle with Oracle 9i, perhaps would it be better to 
compile with Oracle 10g.

And for Perl scripts, perhaps is it better to set variables inside the script 
itself instead of using variable of environment ?
I test that too it works.
Do you have recommendations in regards with your experience ?

  

The instant client might be what you it has a very small footprint.

As for setting the variables in the script I think that will make you 
code work for a entire environment and removes possiable users problems 
who might have different setting that override or confuse DBD::Oracle or 
Oracle. Of course it all depends on what you are going to use the script 
for and who is using it.  So short answer Yes with a But, Long Answer No 
with a Maybe.


Cheers


  


Re: Why do I encounter this error ? ORA-12705 : Cannot access NLS data files or invalid environment specified

2008-07-31 Thread John Scoles
Had to give you a 100% answer to this but the good thing (at least to me 
:-) ) is it not really a DBD::Oracle issue.


Looking at your env it  seems your db is 64 bit in that case  
DBD::Oracle is most likely compiled and running with the 32 client 
someplace other than


ORACLE_HOME=/app/oracle/product/10.2.0/enterprise64bit

and Oracle cannot find the NLSdata files  it was compiled against. 


This is just a shot in the dark.

you might want to unset NLS_LANG and then set it from within your perl 
script so it is the same value as the DB.  When you do not set


NLS_LANG is simply uses the DBs default with might work here as well.

cheers
John Scoles




[EMAIL PROTECTED] wrote:

Hello
 
I do not understand why I encounter this error : 
ORA-12705 : Cannot access NLS data files or invalid environment

specified
 
My env is :

  ORACLE_BASE=/app/oracle
  ORACLE_HOME=/app/oracle/product/10.2.0/enterprise64bit
  ORACLE_SID=sidtest
  NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
  PATH=$PATH:$ORACLE_HOME/bin
  LD_LIBRARY_PATH=/app/oracle/product/10.2.0/enterprise64bit/lib
  export ORACLE_BASE ORACLE_HOME ORACLE_SID NLS_LANG PATH
LD_LIBRARY_PATH

My Perl script is :
  use DBI; 
  my $dbh = DBI->connect( 'dbi:Oracle:sidtest', 'test', 'test', {

RaiseError => 1, AutoCommit => 0 } );
  print $dbh->selectrow_array(qq{ SELECT 'Hello World from
DBI/DBD::Oracle' FROM DUAL }),"\n"; 
  $dbh->disconnect();


When I execute it, it fails with this error 
  DBI connect('sidtest','test',...) failed: ORA-12705: Cannot access NLS

data files or invalid environment specified (DBD ERROR: OCISessionBegin)
at test2.pl line 3

If I unset NLS_LANG it works fine. Why setting NLS_LANG disturbs the
script ?
"Oracle strongly recommends that you set the NLS_LANG on the client "
when you read this link :
http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20fa
q.htm#_Toc110410548


My Perl config is : perl 5.8.8 on Solaris 10 with DBI 1.58 and
DBD::Oracle 1.19

Thanks for your explanation
Regards

Pascal

  


Re: DBD::Oracle - Problem with LOB's (regression ?)

2008-07-31 Thread John Scoles

You might be running into this bug

http://rt.cpan.org//Ticket/Display.html?id=36069


Which is fixed in 1.22 which will be release either today or tomorrow.

cheers John Scoles

Steve Baldwin wrote:

I've just noticed an apparent regression/change_of_behaviour that
affects me.

We do a good deal of our DB access accessing tables via private
synonyms.  That is, we connect via schema_X which has a private synonym
(lob_table) to schema_Y.lob_table.

On our 'current' machines which have DBD::Oracle ver 1.15, everything
works fine.

On our 'new' machines which have DBD::Oracle ver 1.21, if I attempt to
insert/update a lob column, connecting as schema_X, I get an error 942 -
table or view does not exist.

It would seem the error is not being caused by the insert/update, but
something DBD::Oracle is doing afterwards.  Here is a snippet from the
trace ...

:
DBI 1.605-ithread default trace level set to 0x0/2 (pid 26352) at
sb3.plx line 79 via sb3.plx line 124
-> prepare for DBD::Oracle::db (DBI::db=HASH(0x8e59c0c)~0x8e59738 '
insert
intosb1 (id, text_b)
values  (100, :txt)
') thr#8153008
dbd_preparse scanned 1 distinct placeholders
<- prepare= DBI::st=HASH(0x8edbeb4) at sb3.plx line 80
-> bind_param for DBD::Oracle::st (DBI::st=HASH(0x8edbeb4)~0x8bef8c0
':txt' '���A..zip-usa.csv.Խ�.�:.�{�..��...' (type 0, attribs:
HASH(0x8153c28))
<- bind_param= 1 at sb3.plx line 85
-> execute for DBD::Oracle::st (DBI::st=HASH(0x8edbeb4)~0x8bef8c0)
thr#8153008
dbd_st_execute INSERT (out0, lob1)...
Statement Execute Mode is 0
dbd_st_execute INSERT returned (SUCCESS, rpc1, fn3, out0)
!! ERROR: '942' 'ORA-00942: table or view does not exist (DBD ERROR:
OCIStmtExecute/LOB refetch)' (err#1)
<- execute= undef at sb3.plx line 87
-> HandleError on DBI::st=HASH(0x8bef8c0) via CODE(0x8ed5ff4)
(undef)
:

If I either connect as schema_Y (which owns the table), or qualify the
table name with the schema name (e.g. schema_y.sb1), the error does not
occur.

If I wrap the insert/update with a BEGIN .. END; (i.e. turn it into an
anonymous pl/sql block), it works ok, but I'd rather not have to go
through all our code and do this.

Is this a regression, or intended new behaviour?

Thanks,

Steve



**
This email is intended solely for the use of the addressee and may
contain information that is confidential, proprietary, or both.
If you receive this email in error please immediately notify the
sender and delete the email.
**

  


Re: Questions related to DBI and DBD::Oracle

2008-07-30 Thread John Scoles

You will have to do all three

You will need

DBI
DBD::Oracle
Oracle client
and most likely some environment variables as well

First actually read the readme files 
http://search.cpan.org/src/PYTHIAN/DBD-Oracle-1.21/README it has 
detailed instructions on how to set up DBD::Oracle


You can use the Oracle Instant client for free and you can get it here

http://www.oracle.com/technology/tech/oci/instantclient/index.html

cheers
John Scoels


[EMAIL PROTECTED] wrote:


Thanks  for the input.
I have one more question. If I install oracle.pm will that solve my 
problem or do I need to install oracle client on the unix box to make 
it work.

Do I need to setup any other environment variables.

Looking forward for the answers.

Thanks,
Shikha Pandit
WHS IT - Clinical Solutions
Phone: (847) 964-8709
 
WHS -> Walgreens Health Services



[EMAIL PROTECTED]

07/29/2008 07:53 PM


To
[EMAIL PROTECTED]
cc
dbi-users@perl.org, [EMAIL PROTECTED]
Subject
Re: Questions related to DBI and DBD::Oracle









You will have to install the DBD::Oracle perl module befoer you can 
use it.

http://search.cpan.org/~pythian/DBD-Oracle-1.21/Oracle.pm

so far you only have DBI or th Data Base Interface you need a Data Base
Driver to make it actually connect ot a DB. This is why it is asking for
DBD::Oracle

> Hello,
>
> I am trying to connect to the oracle database through a perl script. I
> have installed DBI module on my server.
> I need to run my script on an App server and the database is on the 
other

> server.
> When I am running the test script which is
> use DBI;
> $dbh = DBI->connect( 'dbi:Oracle:dwhs01',
> 'username',
>'password',
>   ) || die "Database connection not made:
> $DBI::errstr";
>
> print "Connected to Database";
>
> It gives me this error.
> install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (@INC
> contains: /usr/opt/perl5/lib/5.8.2/aix-thread-multi
> /usr/opt/perl5/lib/5.8.2
> /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi
> /usr/opt/perl5/lib/site_perl/5.8.2 /usr/opt/perl5/lib/site_perl .) at
> (eval 3) line 3.
> Perhaps the DBD::Oracle perl module hasn't been fully installed,
> or perhaps the capitalisation of 'Oracle' isn't right.
> Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge.
>  at test.pl line 9
>
> Please advice what all do I need to setup and install.
>
> Looking forward for the reply.
> Any inputs will be appeciated.
>
>
> Thanks,
> Shikha Pandit
> WHS IT - Clinical Solutions
> Phone: (847) 964-8709
>
> WHS -> Walgreens Health Services


<http://search.cpan.org/%7Epythian/DBD-Oracle-1.21/Oracle.pm>


Re: DBD::Oracle eats all my memory when using bind_param_inout_array()

2008-07-23 Thread John Scoles
Ok I found it. Seems I was allocating a little (year right) too much 
memory to the array. I set it up to do a max of 4k.


Tested this for 1,000,000 plus inserts and the memory did grow but you 
would expect that as you are generating a new array from the returned values


This is checked into trunk n SVN

I will be putting out a new version of DBD::Oracle next week so I would 
wait until then as there is no real fix for this right now.


You could get the Trunk version of DBD.Oracle. and use it. you can find 
it here


http://svn.perl.org/modules/dbd-oracle/trunk

cheers

John Scoles


John Scoles wrote:

Very odd indeed I will have a look at that.

Ricky Egeland wrote:

Hi,

Today I installed DBD::Oracle 1.21 and DBI 1.605 to run with oracle 
instant
client 10.2.0.3 on 32-bit linux.  (Scientific Linux 4 - basically 
RHEL4).


I wanted to try out bind_param_inout_array() in order to optimize 
writing.
Unfortunately, my test program resulted in an "Out of Memory" error.  
Below

is my program, which used the code in the DBD::Oracle perldoc as
inspiration.  For @in_values of 10 items it works, but for 100 it 
fails with

"Out of Memory".  I ran with DBI_TRACE=15=dbitrace.out and found the
following interesting lines:


OCIBindByName(9a79ee4,9a7c974,9a028f8,":p2",placeh_len=3,value_p=9975460,value_sz=160572495,dty=1,indp=9a7c98c,a 


lenp=0,rcodep=9a7c984,maxarr_len=0,curelep=0 (*=0),mode=2)=SUCCESS

OCIBindDynamic(9a78fa8,9a028f8,9a7c950,3f6db0,9a7c950,3f6ff0)=SUCCESS
OCIAttrGet(9a78fa8,OCI_HTYPE_BIND,9a7c960,0,31,9a028f8)=SUCCESS
dbd_rebind_ph(): bind :p2 <== ARRAY(0x99c39b4) (inout, not-utf8, csid
39->0->39, ftype 1, csform 0->0, maxlen 160572495,
 maxdata_size 0)
OCIAttrSet(9a78fa8,OCI_HTYPE_BIND,bffe65da,0,31,9a028f8)=SUCCESS
<- bind_param_inout_array= 1 at TestInOut.pl line 43 via  at
TestInOut.pl line 33
>> execute_array DISPATCH (DBI::st=HASH(0x9a7c110) rc1/1 @2 g0 
ima5041

pid#27874) at TestInOut.pl line 44 via  at Te
stInOut.pl line 33
-> execute_array in DBD::_::st for DBD::Oracle::st
(DBI::st=HASH(0x9a7c110)~0x9979d8c HASH(0x9979d68)) thr#979e008
>> FETCH   DISPATCH (DBI::st=HASH(0x9979d8c) rc1/2 @2 g0 ima404
pid#27874) at /data/phedex/Testbed/sw/slc4_ia32_
gcc345/external/p5-dbi/1.605/lib/site_perl/5.8.5/i386-linux-thread-multi/DBI.pm 


line 1851 via  at TestInOut.pl line 44
1   -> FETCH for DBD::Oracle::st (DBI::st=HASH(0x9979d8c)~INNER
'NUM_OF_PARAMS') thr#979e008
.. FETCH DBI::st=HASH(0x9979d8c) 'NUM_OF_PARAMS' = 2 (cached)
1   <- FETCH= 2 at
/data/phedex/Testbed/sw/slc4_ia32_gcc345/external/p5-dbi/1.605/lib/site_perl/5.8.5/i386-linux-thread- 


multi/DBI.pm line 1851 via  at TestInOut.pl line 44
>> execute_for_fetch DISPATCH (DBI::st=HASH(0x9979d8c) rc1/2 @3 g0
ima5041 pid#27874) at /data/phedex/Testbed/sw/slc
4_ia32_gcc345/external/p5-dbi/1.605/lib/site_perl/5.8.5/i386-linux-thread-multi/DBI.pm 


line 1924 via  at TestInOut.pl li
ne 44
1   -> execute_for_fetch for DBD::Oracle::st 
(DBI::st=HASH(0x9979d8c)~INNER

CODE(0x9a7c20c) ARRAY(0x9979d50)) thr#979e00
8
  ora_st_execute_array INSERT count=100 (ARRAY(0x99694f4) 
ARRAY(0x9a7c3a4)

undef)...

OCIBindByName(9a79ee4,9a7b434,9a028f8,":p1",placeh_len=3,value_p=0,value_sz=3,dty=1,indp=0,alenp=0,rcodep=0,maxa 


rr_len=0,curelep=0 (*=0),mode=2)=SUCCESS

OCIBindDynamic(9a790e0,9a028f8,9a7b410,3f6db0,9a7b410,3f6ff0)=SUCCESS

OCIBindByName(9a79ee4,9a7c974,9a028f8,":p2",placeh_len=3,value_p=0,value_sz=160572495,dty=1,indp=0,alenp=0,rcode 


p=0,maxarr_len=0,curelep=0 (*=0),mode=2)=SUCCESS

OCIBindDynamic(9a78fa8,9a028f8,9a7c950,3f6db0,9a7c950,3f6ff0)=SUCCESS
...
out ':p2' [0,0]: alen 160572496, piece 0
out ':p2' [1,0]: alen 160572496, piece 0
out ':p2' [2,0]: alen 160572496, piece 0
...

I looked up the meaning of 'alen' in OCI documentation and found that 
it is
related to the maximum size of the parameters to be bound.  Could it 
be that
DBD::Oracle is allocating 160572496 bytes of memory for each entry in 
the

array?  That would explain the "Out of Memory" error ;-)

If this is a known problem with a workaround, I would be most grateful.

Cheers,
Ricky



=== BEGIN CODE ===
#!/usr/bin/perl

use warnings;
use strict;

use DBI;
use DBD::Oracle;
use Data::Dumper;

my $data_source = 'dbi:Oracle:XXX';
my $username = XXX
my $auth = XXX
my %attr = ( RaiseError => 1,
 AutoCommit => 0 );

print "Connecting...";
my $dbh = DBI->connect($data_source, $username, $auth, \%attr);
print "Done.\n";

eval {
print "Dropping test objects...";
$dbh->do( qq{ drop table foo } );
$dbh->do( qq{ drop sequence foo_id_seq } );
print "Done\n";
};
warn $@ if $@;

print "Creating test objects...";
$dbh->do( qq{ create table foo (id number, bar number) }

Re: DBD::Oracle eats all my memory when using bind_param_inout_array()

2008-07-23 Thread John Scoles

Very odd indeed I will have a look at that.

Ricky Egeland wrote:

Hi,

Today I installed DBD::Oracle 1.21 and DBI 1.605 to run with oracle instant
client 10.2.0.3 on 32-bit linux.  (Scientific Linux 4 - basically RHEL4).

I wanted to try out bind_param_inout_array() in order to optimize writing.
Unfortunately, my test program resulted in an "Out of Memory" error.  Below
is my program, which used the code in the DBD::Oracle perldoc as
inspiration.  For @in_values of 10 items it works, but for 100 it fails with
"Out of Memory".  I ran with DBI_TRACE=15=dbitrace.out and found the
following interesting lines:


OCIBindByName(9a79ee4,9a7c974,9a028f8,":p2",placeh_len=3,value_p=9975460,value_sz=160572495,dty=1,indp=9a7c98c,a
lenp=0,rcodep=9a7c984,maxarr_len=0,curelep=0 (*=0),mode=2)=SUCCESS

OCIBindDynamic(9a78fa8,9a028f8,9a7c950,3f6db0,9a7c950,3f6ff0)=SUCCESS
OCIAttrGet(9a78fa8,OCI_HTYPE_BIND,9a7c960,0,31,9a028f8)=SUCCESS
dbd_rebind_ph(): bind :p2 <== ARRAY(0x99c39b4) (inout, not-utf8, csid
39->0->39, ftype 1, csform 0->0, maxlen 160572495,
 maxdata_size 0)
OCIAttrSet(9a78fa8,OCI_HTYPE_BIND,bffe65da,0,31,9a028f8)=SUCCESS
<- bind_param_inout_array= 1 at TestInOut.pl line 43 via  at
TestInOut.pl line 33
>> execute_array DISPATCH (DBI::st=HASH(0x9a7c110) rc1/1 @2 g0 ima5041
pid#27874) at TestInOut.pl line 44 via  at Te
stInOut.pl line 33
-> execute_array in DBD::_::st for DBD::Oracle::st
(DBI::st=HASH(0x9a7c110)~0x9979d8c HASH(0x9979d68)) thr#979e008
>> FETCH   DISPATCH (DBI::st=HASH(0x9979d8c) rc1/2 @2 g0 ima404
pid#27874) at /data/phedex/Testbed/sw/slc4_ia32_
gcc345/external/p5-dbi/1.605/lib/site_perl/5.8.5/i386-linux-thread-multi/DBI.pm
line 1851 via  at TestInOut.pl line 44
1   -> FETCH for DBD::Oracle::st (DBI::st=HASH(0x9979d8c)~INNER
'NUM_OF_PARAMS') thr#979e008
.. FETCH DBI::st=HASH(0x9979d8c) 'NUM_OF_PARAMS' = 2 (cached)
1   <- FETCH= 2 at
/data/phedex/Testbed/sw/slc4_ia32_gcc345/external/p5-dbi/1.605/lib/site_perl/5.8.5/i386-linux-thread-
multi/DBI.pm line 1851 via  at TestInOut.pl line 44
>> execute_for_fetch DISPATCH (DBI::st=HASH(0x9979d8c) rc1/2 @3 g0
ima5041 pid#27874) at /data/phedex/Testbed/sw/slc
4_ia32_gcc345/external/p5-dbi/1.605/lib/site_perl/5.8.5/i386-linux-thread-multi/DBI.pm
line 1924 via  at TestInOut.pl li
ne 44
1   -> execute_for_fetch for DBD::Oracle::st (DBI::st=HASH(0x9979d8c)~INNER
CODE(0x9a7c20c) ARRAY(0x9979d50)) thr#979e00
8
  ora_st_execute_array INSERT count=100 (ARRAY(0x99694f4) ARRAY(0x9a7c3a4)
undef)...

OCIBindByName(9a79ee4,9a7b434,9a028f8,":p1",placeh_len=3,value_p=0,value_sz=3,dty=1,indp=0,alenp=0,rcodep=0,maxa
rr_len=0,curelep=0 (*=0),mode=2)=SUCCESS

OCIBindDynamic(9a790e0,9a028f8,9a7b410,3f6db0,9a7b410,3f6ff0)=SUCCESS

OCIBindByName(9a79ee4,9a7c974,9a028f8,":p2",placeh_len=3,value_p=0,value_sz=160572495,dty=1,indp=0,alenp=0,rcode
p=0,maxarr_len=0,curelep=0 (*=0),mode=2)=SUCCESS

OCIBindDynamic(9a78fa8,9a028f8,9a7c950,3f6db0,9a7c950,3f6ff0)=SUCCESS
...
out ':p2' [0,0]: alen 160572496, piece 0
out ':p2' [1,0]: alen 160572496, piece 0
out ':p2' [2,0]: alen 160572496, piece 0
...

I looked up the meaning of 'alen' in OCI documentation and found that it is
related to the maximum size of the parameters to be bound.  Could it be that
DBD::Oracle is allocating 160572496 bytes of memory for each entry in the
array?  That would explain the "Out of Memory" error ;-)

If this is a known problem with a workaround, I would be most grateful.

Cheers,
Ricky



=== BEGIN CODE ===
#!/usr/bin/perl

use warnings;
use strict;

use DBI;
use DBD::Oracle;
use Data::Dumper;

my $data_source = 'dbi:Oracle:XXX';
my $username = XXX
my $auth = XXX
my %attr = ( RaiseError => 1,
 AutoCommit => 0 );

print "Connecting...";
my $dbh = DBI->connect($data_source, $username, $auth, \%attr);
print "Done.\n";

eval {
print "Dropping test objects...";
$dbh->do( qq{ drop table foo } );
$dbh->do( qq{ drop sequence foo_id_seq } );
print "Done\n";
};
warn $@ if $@;

print "Creating test objects...";
$dbh->do( qq{ create table foo (id number, bar number) } );
$dbh->do( qq{ create sequence foo_id_seq } );
print "Done.\n";

eval {
my @in_values=(1..100);
my @out_values;
my @status;
my $sth = $dbh->prepare(qq{
INSERT INTO foo (id, bar)
VALUES (foo_id_seq.nextval, ?)
RETURNING id INTO ?

});
$sth->bind_param_array(1,[EMAIL PROTECTED]);
$sth->bind_param_inout_array(2,[EMAIL PROTECTED], 0);   #,{ora_type =>
ORA_VARCHAR2});
$sth->execute_array({ArrayTupleStatus=>[]}) or die "error inserting";
foreach my $id
(@out_values){
print 'returned id='.$id."\n";

}
};
warn $@ if
$@;

print "Dropping test
objects...";
$dbh->do( qq{ drop table foo } );
$dbh->do( qq{ drop sequence foo_id_seq }
);
print "Done\n";

$dbh->disconnect();

exit;
=== END CODE ===

  


Re: Volunteers sought to help with or take over Oracle::OCI

2008-07-21 Thread John Scoles

I suppose I could take it over as I am doing DBD::Oracle as well.

cheers
John Scoles

Tim Bunce wrote:

The Oracle::OCI module provides access to the entire Oracle OCI
interface. Every feature Oracle offers can be accessed via OCI.
Including Transparent Application Failover (TAF) and bulk loading.

The Oracle::OCI module bootstraps itself at build time. Automatically
creating perl interfaces to all the OCI functions in your installed
version of Oracle.

It lets you write OCI code in perl:

 OCIHandleAlloc($env, my $dschp, OCI_HTYPE_DESCRIBE, 0, 0);
 OCIDescribeAny($dbh, $dbh, oci_buf_len($table), OCI_OTYPE_NAME, 1, 
OCI_PTYPE_TABLE, $dschp);
 OCIAttrGet($dschp, OCI_HTYPE_DESCRIBE, my $parmp, 0, OCI_ATTR_PARAM, $dbh, 
'OCIParamPtr');
 OCIAttrGet($parmp, OCI_DTYPE_PARAM, my $numcols, 0, OCI_ATTR_NUM_COLS, $dbh, 
2);
 OCIAttrGet($parmp, OCI_DTYPE_PARAM, my $collst, 0, OCI_ATTR_LIST_COLUMNS, 
$dbh, 'OCIParamPtr');

That may seem a little low-level, but that's not the point.
This is an enabling technology and what it enables is huge:
access to the *entire* Oracle OCI interface.

Soon there'd be modules built on top of Oracle::OCI that provide
higher-level interfaces to specific areas of functionality, like LOBs,
bulk loading, objects, advanced queuing, etc etc.

Oracle::OCI also integrates very well with DBI and DBD::Oracle.
You can use a $dbh or $sth wherever it would be reasonable to.

I've not worked on it since 2001 as I very rarely use Oracle these days.
The Oracle::OCI module had moved beyond proof-of-concept but still
needs a little love before it's ready for prime-time.

Interesting? Interested?

Tim.
  


Re: Problem with DBD::Oracle ora_auto_lob not working

2008-07-18 Thread John Scoles
Hi Martin I found the bug (well actually an omission) and fixed it so 
now It will return the data you expect. 

I committed the changes to  Trunk 
http://svn.perl.org/modules/dbd-oracle/trunk so if you will try the code 
from there and see if it works for you now.


Seem the not all the attributes for the SP were not being passed along 
so in actual fact it was only need the addition of 6 lines of code.  As 
is normal with anything to do with DBD::Oracle (well actully C in 
general)  it took 2 hours to find out where to put those lines fro the 2 
min change.


cheers
John Scoles

Martin Evans wrote:

John Scoles wrote:

Ouch nasty one Martin.

But I think that DBD oracle is doing the correct thing here.


Well that is what I'm after clarification on. The pod for ora_auto_lob 
says "retrieves the contents of the CLOB or BLOB column in most 
circumstances". What are the circumstances it does /not/ retrieve the 
clob/blob data and returns a lob locator instead?


I think when you bury the 'SELECT x from martin; ' in the SP like 
this you are essentially only ever going to get a lob locater back as 
that is what you are asking for.


I don't understand your comment here. I never asked for a lob locator, 
I asked for the contents of column 'x' and if I run this select in 
Perl I get the clob contents back (presumably because ora_auto_lob is 
on by default and works on normal statement handles). It is only when 
I run the select in an oracle procedure and return the cursor which 
gets magicked into a DBI statement handle and then run a fetch on that 
statement that I get a lob locator.


Of couser you could use all the neat lob function in DBD Oracle on it 
like 'ora_lob_read', 'ora_lob_write' etc, which of course kind of 
defeats the purpose of this exercise.


Actually, I do not mind running ora_lob_read to get my data back from 
the lob locator (although I'd prefer ora_auto_lob did it for me) but 
my data is utf8 and the pod says:


"Warning: Currently multi-byte character set issues have not been 
fully worked out. So these methods may not do what you expect if 
either the Perl data is utf8 or the CLOB is a multi-byte character set 
(including uft8). The current behaviour in these situations may not be 
correct and is subject to change."


which suggested to me that you can't get utf8 data back from 
ora_lob_read. What I am actually trying to do is hide the SQL and any 
schema from the perl by placing it in the database in a package, I'm 
not worried how I get the data out when the procedure is called.


If you are using DBD:ORacle 1.21 you would try using the 
ora_type=>SQLT_CHR or ora_pers_lob.


I did try using ora_pers_lob but it made no difference.

I going to release a new version of the code next week 1.22 that have 
a number of LOB improvements that might help.


Excellent, I look forward to that.

I will see if I can recreate you problem today right not I am little 
busy with real work.


Thanks. I have added to my test case a little to actually write utf8 
data and get it back - it would seem that the pod warning with respect 
to utf8 data not coming back from ora_lob_read /may/ be out of date. 
See new code example below.


use DBI (data_diff);
use warnings;
use strict;
use Data::Dumper;
use DBD::Oracle qw(:ora_types);
use Encode;
use charnames ':full';

my $h = DBI->connect('dbi:Oracle:XE', 'xxx', 'xxx');

eval {$h->do(q/drop table martin/);};
$h->do(q/create table martin (x clob)/);
my $data = "\x{263a}xxx" . chr(0x05d0) . "\N{ARABIC LETTER ALEF}";
print "Length of input data: " . length($data) . "\n";
$h->do(q/insert into martin values (?)/, undef, $data);

my $createproc = << 'EOT';
CREATE OR REPLACE PROCEDURE p_martin(pc OUT SYS_REFCURSOR) AS
l_cursor SYS_REFCURSOR;
BEGIN
OPEN l_cursor FOR
  SELECT x from martin;
pc := l_cursor;
END;
EOT

$h->do($createproc);

my $s = $h->prepare(
q/begin p_martin(?); end;/, {ora_auto_lob => 1});
my $sth;
$s->bind_param_inout(1, \$sth, 5,
 {ora_type => ORA_RSET});
$s->execute;
my ($lobl) = $sth->fetchrow;
print Dumper($lobl);
my $length =  $h->ora_lob_length($lobl);
print "lob length: $length\n";

my $cdata = $h->ora_lob_read($lobl, 1, $length);
print data_diff($data, $cdata);

which prints:

Length of input data: 6
$VAR1 = bless( do{\(my $o = 142150356)}, 'OCILobLocatorPtr' );
lob length: 6

and does not print anything for data_diff suggesting to me the input 
and output data are the same.


Martin


Re: Problem with DBD::Oracle ora_auto_lob not working

2008-07-18 Thread John Scoles



Martin Evans wrote:

John Scoles wrote:

Ouch nasty one Martin.

But I think that DBD oracle is doing the correct thing here.


Well that is what I'm after clarification on. The pod for ora_auto_lob 
says "retrieves the contents of the CLOB or BLOB column in most 
circumstances". What are the circumstances it does /not/ retrieve the 
clob/blob data and returns a lob locator instead?
I guess this must be one of these circumstances. When you try to get a 
LOB through a SP.




I think when you bury the 'SELECT x from martin; ' in the SP like 
this you are essentially only ever going to get a lob locater back as 
that is what you are asking for.


I don't understand your comment here. I never asked for a lob locator, 
I asked for the contents of column 'x' and if I run this select in 
Perl I get the clob contents back (presumably because ora_auto_lob is 
on by default and works on normal statement handles). It is only when 
I run the select in an oracle procedure and return the cursor which 
gets magicked into a DBI statement handle and then run a fetch on that 
statement that I get a lob locator.


Ah 'Prease to remembering frist wurle of robes' 

The value of an Oracle LOB column is not the content of the LOB,  It's a 
'LOB Locator' .


So every time you select a lob column you get a locater, DBD::Oracle 
just hides that fact from you. In this case the all DBD::Oracle know is 
that you are selecting a cursor (SP) which id does, I guess it does not 
have the smarts to know that the next level down is a locator  so it 
just returns that not the actual value locator points to.


Of couser you could use all the neat lob function in DBD Oracle on it 
like 'ora_lob_read', 'ora_lob_write' etc, which of course kind of 
defeats the purpose of this exercise.


Actually, I do not mind running ora_lob_read to get my data back from 
the lob locator (although I'd prefer ora_auto_lob did it for me) but 
my data is utf8 and the pod says:


"Warning: Currently multi-byte character set issues have not been 
fully worked out. So these methods may not do what you expect if 
either the Perl data is utf8 or the CLOB is a multi-byte character set 
(including uft8). The current behaviour in these situations may not be 
correct and is subject to change."


which suggested to me that you can't get utf8 data back from 
ora_lob_read. What I am actually trying to do is hide the SQL and any 
schema from the perl by placing it in the database in a package, I'm 
not worried how I get the data out when the procedure is called.


That might be a little dated there were a number of patches to fix that 
I guess the pod has yet to be cleaned up.
If you are using DBD:ORacle 1.21 you would try using the 
ora_type=>SQLT_CHR or ora_pers_lob.


I did try using ora_pers_lob but it made no difference.

I going to release a new version of the code next week 1.22 that have 
a number of LOB improvements that might help.


Excellent, I look forward to that.

I will see if I can recreate you problem today right not I am little 
busy with real work.


Thanks. I have added to my test case a little to actually write utf8 
data and get it back - it would seem that the pod warning with respect 
to utf8 data not coming back from ora_lob_read /may/ be out of date. 
See new code example below.


use DBI (data_diff);
use warnings;
use strict;
use Data::Dumper;
use DBD::Oracle qw(:ora_types);
use Encode;
use charnames ':full';

my $h = DBI->connect('dbi:Oracle:XE', 'xxx', 'xxx');

eval {$h->do(q/drop table martin/);};
$h->do(q/create table martin (x clob)/);
my $data = "\x{263a}xxx" . chr(0x05d0) . "\N{ARABIC LETTER ALEF}";
print "Length of input data: " . length($data) . "\n";
$h->do(q/insert into martin values (?)/, undef, $data);

my $createproc = << 'EOT';
CREATE OR REPLACE PROCEDURE p_martin(pc OUT SYS_REFCURSOR) AS
l_cursor SYS_REFCURSOR;
BEGIN
OPEN l_cursor FOR
  SELECT x from martin;
pc := l_cursor;
END;
EOT

$h->do($createproc);

my $s = $h->prepare(
q/begin p_martin(?); end;/, {ora_auto_lob => 1});
my $sth;
$s->bind_param_inout(1, \$sth, 5,
 {ora_type => ORA_RSET});
$s->execute;
my ($lobl) = $sth->fetchrow;
print Dumper($lobl);
my $length =  $h->ora_lob_length($lobl);
print "lob length: $length\n";

my $cdata = $h->ora_lob_read($lobl, 1, $length);
print data_diff($data, $cdata);

which prints:

Length of input data: 6
$VAR1 = bless( do{\(my $o = 142150356)}, 'OCILobLocatorPtr' );
lob length: 6

and does not print anything for data_diff suggesting to me the input 
and output data are the same.


Martin
Ok Martin I will try and get a look at this today. The change may be 
trivial but I aint promising anything.


cheers
John sCoes
Great marting.




Re: Problem with DBD::Oracle ora_auto_lob not working

2008-07-18 Thread John Scoles

Ouch nasty one Martin.

But I think that DBD oracle is doing the correct thing here.

I think when you bury the 'SELECT x from martin; ' in the SP like this 
you are essentially only ever going to get a lob locater back as that is 
what you are asking for. 

Of couser you could use all the neat lob function in DBD Oracle on it 
like 'ora_lob_read', 'ora_lob_write' etc, which of course kind of 
defeats the purpose of this exercise.


If you are using DBD:ORacle 1.21 you would try using the 
ora_type=>SQLT_CHR or ora_pers_lob.  I going to release a new version of 
the code next week 1.22 that have a number of LOB improvements that 
might help.


I will see if I can recreate you problem today right not I am little 
busy with real work.


cheers
John Scoles


Martin Evans wrote:

Hi,

I am in the process of moving some select SQL which was in Perl into 
functions and procedures in an oracle package which return a cursor 
the perl can read i.e., to hide the SQL from outside the database. 
Some of these select statements read clobs.


create table martin (x clob);

In perl we were doing:
set LognReadLen
prepare(q/select x from martin/);
execute
fetch

and this works ok, the clob is retrieved as data and not as a lob 
locator.


We are now calling a procedure which issues the select and returns a 
cursor. The cursor is magicked into a DBI statement handle by 
DBD::Oracle but fetching on it returns a lob locator and not the data 
(as before).


Have I perhaps hit the "most" in this quote from DBD::Oracle:

  ora_auto_lob

If true (the default), fetching retrieves the contents of the CLOB
or BLOB column in most circumstances. If false, fetching retrieves
the Oracle "LOB Locator" of the CLOB or BLOB value.

The code below demonstrates. I thought it may be that ora_auto_lob 
does not work on statement handles created for returned cursors so I 
attempted to use the DBD::Oracle lob functions to get the data but 
this data is UTF8 and does not come back correctly. Here again the 
DBD::Oracle pod says:


  Warning: Currently multi-byte character set issues have not been fully
  worked out. So these methods may not do what you expect if either the
  Perl data is utf8 or the CLOB is a multi-byte character set (including
  uft8). The current behaviour in these situations may not be correct
  and is subject to change.

Anyone got any suggestions?

use DBI;
use warnings;
use strict;
use Data::Dumper;
use DBD::Oracle qw(:ora_types);

my $h = DBI->connect('dbi:Oracle:XE', 'xxx', 'xxx');

eval {$h->do(q/drop table martin/);};
$h->do(q/create table martin (x clob)/);
my $data = 'A' x 8000;
$h->do(q/insert into martin values (?)/, undef, $data);

my $createproc = << 'EOT';
CREATE OR REPLACE PROCEDURE p_martin(pc OUT SYS_REFCURSOR) AS
l_cursor SYS_REFCURSOR;
BEGIN
OPEN l_cursor FOR
  SELECT x from martin;
pc := l_cursor;
END;
EOT

$h->do($createproc);

my $s = $h->prepare(
q/begin p_martin(?); end;/, {ora_auto_lob => 1});
my $sth;
$s->bind_param_inout(1, \$sth, 5,
 {ora_type => ORA_RSET});
$s->execute;
my $out = $sth->fetch;
print Dumper($out);

which prints:

$VAR1 = [
  bless( do{\(my $o = 151245220)}, 'OCILobLocatorPtr' )
];

Martin


Re: DBD-Oracle-1.21 installation issue

2008-07-15 Thread John Scoles

Looks from that one it cannot find you listener.

Set the TNS_ADMIN value to the directory that has your TNASNAMES.ORA file

cheers

Ejaz wrote:
Dear John, 

Many thanks for your reply, 



But  I cannot insert the values in the database, when ever I am trying  through my  radius profiile which we are using for authentications,  

When i tried to connect manually its ok, 

# sqllus  /[EMAIL PROTECTED]  


SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 15 09:51:53 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

SQL> quit

Here is the message in my radius logs, when i tried to connect from radius, 


, 212.119.67.21, 4475130
Mon Jul 14 17:08:06 2008: ERR: Could not connect to SQL database with 
DBI->connect dbi:Oracle:sunb, cybrad, cybrad:  ORA-12154: TNS:could not resolve 
the connect identifier specified (DBD ERROR: OCIServerAttach)
Mon Jul 14 17:08:06 2008: ERR: Could not connect to any SQL database. Request 
is ignored. Backing off for 600 seconds
Mon Jul 14 17:08


Regards
Ejaz 
- Original Message - 
From: "John Scoles" <[EMAIL PROTECTED]>

To: "Ej" <[EMAIL PROTECTED]>; 
Sent: Saturday, July 12, 2008 10:24 PM
Subject: RE: DBD-Oracle-1.21 installation issue



Looks like it installed just fine your need to set the 'ORACLE_USERID' to a 
valid user on your DB for the test to work or create a use called Scott with a 
pw tiger on your DB (This I would not do as every hacker knows this PW ad USer 
id)

  

To: dbi-users@perl.org
From: [EMAIL PROTECTED]
Subject: DBD-Oracle-1.21 installation issue
Date: Sat, 12 Jul 2008 04:22:57 -0700
CC: [EMAIL PROTECTED]

HI all.

Iam trying to install DBD-Oracle-5.1  on soalris 10_x86 and Oracle
10g,
I got the following error message while running " make test" Please
any suggestion would  highly appreciated,


t/31lob.DBI connect('','scott/tiger',...) failed:
ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach) at t/
nchar_test_lib.pl line 156
You tried to plan twice!  Second plan at t/31lob.t line 16
# Looks like your test died before it could output anything.
t/
31lob.dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-9
Failed 9/9 tests, 0.00% okay
t/32xmltype.ok 1/4DBI connect('','scott/tiger',...)
failed: ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach)
at t/32xmltype.t line 26
# Looks like you planned 4 tests but only ran 1.
# Looks like your test died just after 1.
t/
32xmltype.dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-4
Failed 3/4 tests, 25.00% okay
t/34pres_lobs...DBI connect('','scott/tiger',...) failed:
ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach) at t/
34pres_lobs.t line 31
# Looks like your test died before it could output anything.
t/
34pres_lobs...dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-11
Failed 11/11 tests, 0.00% okay
t/40ph_type.DBI connect('','scott/tiger',...) failed:
ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach) at t/
40ph_type.t line 29
Unable to connect to Oracle (ORA-12546: TNS:permission denied (DBD
ERROR: OCIServerAttach))
Tests skipped.
skipped
all skipped: no reason given
t/50cursor..Unable to connect to Oracle as scott/tiger
(ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach))
Tests skipped.
skipped
all skipped: no reason given
t/51scroll..ok 1/33DBI connect('','scott/tiger',...)
failed: ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach)
at t/51scroll.t line 26
# Looks like you planned 33 tests but only ran 1.
# Looks like your test died just after 1.
t/
51scroll..dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-33
Failed 32/33 tests, 3.03% okay
t/55nested..Unable to connect to Oracle as scott/tiger
(ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach))
Tests skipped.
skipped
all skipped: no reason given
t/56embbededok 1/5DBI connect('','scott/tiger',...)
failed: ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach)
at t/56embbeded.t line 28
# Looks like you planned 5 tests but only ran 1.
# Looks like your test died just after 1.
t/
56embbededdubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-5
Failed 4/5 tests, 20.00% okay
t/60reauth..ORACLE_USERID_2 not defined.  Tests skipped.
skipped
all skipped: no reason given
t/70metaUnab

RE: DBD-Oracle-1.21 installation issue

2008-07-12 Thread John Scoles

Looks like it installed just fine your need to set the 'ORACLE_USERID' to a 
valid user on your DB for the test to work or create a use called Scott with a 
pw tiger on your DB (This I would not do as every hacker knows this PW ad USer 
id)

> To: dbi-users@perl.org
> From: [EMAIL PROTECTED]
> Subject: DBD-Oracle-1.21 installation issue
> Date: Sat, 12 Jul 2008 04:22:57 -0700
> CC: [EMAIL PROTECTED]
> 
> HI all.
> 
> Iam trying to install DBD-Oracle-5.1  on soalris 10_x86 and Oracle
> 10g,
> I got the following error message while running " make test" Please
> any suggestion would  highly appreciated,
> 
> 
> t/31lob.DBI connect('','scott/tiger',...) failed:
> ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach) at t/
> nchar_test_lib.pl line 156
> You tried to plan twice!  Second plan at t/31lob.t line 16
> # Looks like your test died before it could output anything.
> t/
> 31lob.dubious
> Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-9
> Failed 9/9 tests, 0.00% okay
> t/32xmltype.ok 1/4DBI connect('','scott/tiger',...)
> failed: ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach)
> at t/32xmltype.t line 26
> # Looks like you planned 4 tests but only ran 1.
> # Looks like your test died just after 1.
> t/
> 32xmltype.dubious
> Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 2-4
> Failed 3/4 tests, 25.00% okay
> t/34pres_lobs...DBI connect('','scott/tiger',...) failed:
> ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach) at t/
> 34pres_lobs.t line 31
> # Looks like your test died before it could output anything.
> t/
> 34pres_lobs...dubious
> Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-11
> Failed 11/11 tests, 0.00% okay
> t/40ph_type.DBI connect('','scott/tiger',...) failed:
> ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach) at t/
> 40ph_type.t line 29
> Unable to connect to Oracle (ORA-12546: TNS:permission denied (DBD
> ERROR: OCIServerAttach))
> Tests skipped.
> skipped
> all skipped: no reason given
> t/50cursor..Unable to connect to Oracle as scott/tiger
> (ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach))
> Tests skipped.
> skipped
> all skipped: no reason given
> t/51scroll..ok 1/33DBI connect('','scott/tiger',...)
> failed: ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach)
> at t/51scroll.t line 26
> # Looks like you planned 33 tests but only ran 1.
> # Looks like your test died just after 1.
> t/
> 51scroll..dubious
> Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 2-33
> Failed 32/33 tests, 3.03% okay
> t/55nested..Unable to connect to Oracle as scott/tiger
> (ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach))
> Tests skipped.
> skipped
> all skipped: no reason given
> t/56embbededok 1/5DBI connect('','scott/tiger',...)
> failed: ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach)
> at t/56embbeded.t line 28
> # Looks like you planned 5 tests but only ran 1.
> # Looks like your test died just after 1.
> t/
> 56embbededdubious
> Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 2-5
> Failed 4/5 tests, 20.00% okay
> t/60reauth..ORACLE_USERID_2 not defined.  Tests skipped.
> skipped
> all skipped: no reason given
> t/70metaUnable to connect to Oracle as scott/tiger
> (ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach))
> Tests skipped.
> skipped
> all skipped: no reason given
> t/80ora_charset.DBI connect('','scott/tiger',...) failed:
> ORA-12546: TNS:permission denied (DBD ERROR: OCIServerAttach) at t/
> 80ora_charset.t line 118
> skipped
> all skipped: Not connected to oracle
> Failed Test  Stat Wstat Total Fail  Failed  List of Failed
> ---
> t/10general.t 255 6528033   66 200.00%  1-33
> t/26exe_array.t   255 6528014   26 185.71%  2-14
> t/28array_bind.t  255 6528015   30 200.00%  1-15
> t/30long.t255 65280   470  940 200.00%  1-470
> t/31lob.t 255 65280 9   18 200.00%  1-9
> t/32xmltype.t 255 65280 46 150.00%  2-4
> t/34pres_lobs.t   255 6528011   22 200.00%  1-11
> t/51scroll.t  255 6528033   64 193.94%  2-33
> t/56embbeded.t255 65280 58 160.00%  2-5
> 17 tests and 9 subtests skipped.
> Failed 9/28 test scripts, 67.86% okay. 590/608 subtests failed, 2.96%
> okay.
> make: *** [test_dynamic] Error 29
> 

_



DBD::CSV group by on multiple columns not working

2008-07-05 Thread John Krystynak
I cannot get DBD::CSV & SQL::Statement to work correctly when there is
more than 1 column in the group by.
I have version 1.15 of SQL::Statement and version 0.22 of DBD::CSV.

I wonder if this is a known bug, or I am missing something, because
the docs for SQL::Statement show that it should be supported?

Example:
% cat > testData.csv
1,1,10
1,2,10
1,3,10
2,1,10
2,1,10
2,1,10

% cat > testdbdcsv.pl
#!/usr/bin/perl
use strict;
use warnings;
use DBI;

my $csvdb = DBI->connect( "dbi:CSV:" ) || die "Cannot connect: $DBI::errstr";
$csvdb->{'csv_tables'}->{'log'} = {
 'file' => "testData.csv",
 'eol'  => "\n",
 'col_names' => ["a","b","c"]
 };
$csvdb->{'RaiseError'} = 1;
$@ = '';
eval {
my $csth = $csvdb->prepare("SELECT a,b,sum(c) as tot from log
GROUP BY a,b");
$csth->execute();
while (my $row = $csth->fetchrow_hashref) {
print " row: " . join(",",
  $row->{'a'},
  $row->{'b'},
      $row->{'tot'},
  ) . "\n";

}
$csth->finish();
};
if ($@) { warn "SQL database error: $@";}

$csvdb->disconnect;


% perl testdbdcsv.pl
 row: 2,1,40
 row: 1,2,10
 row: 1,3,10


Thanks,
John Krystynak

-- 
Amazon Prime Users - add my search tool to your Firefox search bar!
http://searchaprime.com <-- new URL!


Re: Generic DBI question about backups

2008-06-19 Thread John Scoles

export to CSV and use DBD::CSV?

Curtis Leach wrote:

My big problem is that the new database hasn't been selected yet & the
our only Oracle database will be gone by the time one is selected.
Which was the reason for the need of a database independent solution.  I
won't be able to load it back into Oracle again for a 2nd attempt.

Curtis

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 19, 2008 1:33 PM

To: Curtis Leach
Cc: dbi-users@perl.org
Subject: Re: Generic DBI question about backups

I guess I'd be more concerned initially with ensuring the datatype
mappings are identical or in the 'to-be' database, the ingress is valid.

Has that been considered yet?

On Thu, 19 Jun 2008, Curtis Leach wrote:

  

Does anyone know of a module that would backup an Oracle database in a



  

database independent way?

We are decommissioning our only Oracle database & we would like to be 
able to preserve it's contents so that it can be reloaded into another



  

database at a later date.  Such as Windows SQL Server or Informix.

But all Oracle backup tools use proprietary formats.


Curtis





--
Louis Gonzales
[EMAIL PROTECTED]
http://www.linuxlouis.net



  


Re: FW: DBD::Oracle on Darwin 8.11

2008-06-19 Thread John Scoles
Me thinks your Perl was compiled using one flavour of C compiler and you 
are trying to compile DBD::Oracle with another flavour or C compiler.


I have seen this a number of times with HP systems. 

Basically it meas you have to recompile your Perl with the same C 
compiler you are going to use to compile DBD::ORacle and your other perl 
mods.


Do a Google search for

Oracle.c: In function `XS_DBD__Oracle_constant':

you will find a number of other hits in the list that are similar.

Unfortunately that is all the help I can offer as I have never had to do 
this myself




Stewart Anderson wrote:
Thanks for  the response John.  

I just tried  the same thing  on perl 5.10  and had the same results.  

Perl Makefile.PL   and make  output shown below.  


Perl Makefile.PL  looks   ok to me - but I am far from expert,
clearly!! 


I can see a problem  with the includes in the make  output but do not
know how  to correct this,  I thought  the   Makefile  looked at  the
INCLUDE env var, which I tried to  set with  paths to  the  stdarg.h
but that did not help at all.

I appreciate your  help  :)

Regards

Stu



Perl Makefile.PL Output

=
perl Makefile.PL
Using DBI 1.601 (for perl 5.01 on darwin-thread-multi-2level)
installed in /usr/local/ActivePerl-5.10/lib/auto/DBI/
Argument "6.42_01" isn't numeric in numeric ge (>=) at Makefile.PL line
59.

Configuring DBD::Oracle for perl 5.01 on darwin
(darwin-thread-multi-2level)

Remember to actually *READ* the README file! Especially if you have any
problems.

Using Oracle in /usr/local/oracle/instantclient10_1
DEFINE _SQLPLUS_RELEASE = "1001000300" (CHAR)
Oracle version 10.1.0.3 (10.1)
Looks like an Instant Client installation, okay
Your DYLD_LIBRARY_PATH env var is set to
'/usr/local/oracle/instantclient10_1:'
Oracle sysliblist:
Found header files in /usr/local/oracle/instantclient10_1/sdk/include.

Checking for functioning wait.ph


System: perl5.01 darwin sphinx 8.11.0 darwin kernel version 8.11.0:
wed oct 10 18:26:00 pdt 2007; root:xnu-792.24.17~1release_ppc power
macintosh powerpc
Compiler:   gcc -O3 -fno-common -DPERL_DARWIN -no-cpp-precomp -arch ppc
-arch i386 -nostdinc -B/Developer/SDKs/MacOSX10.4u.sdk/usr/include/gcc
-B/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc
-isystem/Developer/SDKs/MacOSX10.4u.sdk/usr/include
-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks
-mmacosx-version-min=10.3 -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC
-fno-strict-aliasing -pipe
Linker: /usr/bin/ld
Sysliblist:
Linking with -lclntsh.

LD_RUN_PATH=/usr/local/oracle/instantclient10_1
Using DBD::Oracle 1.21.
Using DBD::Oracle 1.21.
Using DBI 1.601 (for perl 5.01 on darwin-thread-multi-2level)
installed in /usr/local/ActivePerl-5.10/lib/auto/DBI/
Writing Makefile for DBD::Oracle

***  If you have problems...
 read all the log printed above, and the README and README.help.txt
files.
 (Of course, you have read README by now anyway, haven't you?)




Make  output 


Skip blib/lib/DBD/Oracle.pm (unchanged)
Skip blib/lib/DBD/mkta.pl (unchanged)
Skip blib/lib/oraperl.ph (unchanged)
Skip blib/arch/auto/DBD/Oracle/dbdimp.h (unchanged)
Skip blib/arch/auto/DBD/Oracle/ocitrace.h (unchanged)
Skip blib/lib/Oraperl.pm (unchanged)
Skip blib/arch/auto/DBD/Oracle/Oracle.h (unchanged)
Skip blib/arch/auto/DBD/Oracle/mk.pm (unchanged)
Skip blib/lib/DBD/Oracle/GetInfo.pm (unchanged)
gcc -c  -I/usr/local/oracle/instantclient10_1/sdk/include
-I/usr/local/ActivePerl-5.10/lib/auto/DBI -fno-common -DPERL_DARWIN
-no-cpp-precomp -arch ppc -arch i386 -nostdinc
-B/Developer/SDKs/MacOSX10.4u.sdk/usr/include/gcc
-B/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc
-isystem/Developer/SDKs/MacOSX10.4u.sdk/usr/include
-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks
-mmacosx-version-min=10.3 -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC
-fno-strict-aliasing -pipe -O3   -DVERSION=\"1.21\"
-DXS_VERSION=\"1.21\"  "-I/usr/local/ActivePerl-5.10/lib/CORE"  -Wall
-Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT
-DORA_OCI_VERSION=\"10.1.0.3\" Oracle.c
In file included from
/usr/local/oracle/instantclient10_1/sdk/include/ociap.h:197,
 from
/usr/local/oracle/instantclient10_1/sdk/include/oci.h:2351,
 from Oracle.h:37,
 from Oracle.xs:1:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: no include
path in which to find stdarg.h
In file included from
/usr/local/oracle/instantclient10_1/sdk/include/oci.h:2351,
 from Oracle.h:37,
 from Oracle.xs:1:
/usr/local/oracle/instantclient10_1/sdk/include/ociap.h:6267: error:
parse error before "va_list"
In file included from /usr/local/ActivePerl-5.10/lib/CORE/perl.h:598,
 from
/usr/local/ActivePerl-5.10/lib/auto/DBI/DBIXS.h:19,
 from Oracle.h:51,
 from Oracle

Re: DBD::Oracle on Darwin 8.11

2008-06-19 Thread John Scoles
To start you should post the output of your perl Makefil.PL  as that 
will give the other here on the list a good deal of what we need to go on.


Also you should have a look at the readmes they might help

Cheers John Scoles

Stewart Anderson wrote:

Hi,

I'm   having real probs  getting DBD::Oracle  onto  a sphinx  version of
MAC OS ppc.

I have  tried numerous repositories but can't find pre-compiled modules.
If they exist somewhere please can you point me in the right direction.

I have also tried to complie the module myself but am  getting  problems
with  finding libraries  and linking I think (not a C  dev).

I have  DBD 1.21 which I think  is targeted at MAC 10.x ?   Is there a
suitable version I should use for  my version of MAC OS?.

Oracle  instant client is installed and seems to be working fine,   in
that I can  use sqlplus quite happily to get  to   the DB I need to.

This is the first time I have tried to use the list so not sure how much
gumf to include  with  this request,   nay plea  for help :)

Regards

Stu



Information in this email including any attachments may be privileged, 
confidential and is intended exclusively for the addressee. The views expressed 
may not be official policy, but the personal views of the originator. If you 
have received it in error, please notify the sender by return e-mail and delete 
it from your system. You should not reproduce, distribute, store, retransmit, 
use or disclose its contents to anyone. Please note we reserve the right to 
monitor all e-mail communication through our internal and external networks. 
SKY and the SKY marks are trade marks of British Sky Broadcasting Group plc and 
are used under licence. British Sky Broadcasting Limited (Registration No. 
2906991), Sky Interactive Limited (Registration No. 3554332), Sky-In-Home 
Service Limited (Registration No. 2067075) and Sky Subscribers Services Limited 
(Registration No. 2340150) are direct or indirect subsidiaries of British Sky 
Broadcasting Group plc (Registration No. 2247735). All of the companies 
mentioned in this paragraph are incorporated in England and Wales and share the 
same registered office at Grant Way, Isleworth, Middlesex TW7 5QD.
  




Re: DBD::Oracle & overloaded stored procedure

2008-06-10 Thread John Scoles
unfortunately the second package does not compile as it 'returns 1' 
which is not a valid pl/SQL command


Eugene Krivdyuk wrote:

2008/6/10 John Scoles <[EMAIL PROTECTED]>:
  

More a PL/SQL question than a DBI/DBD one but I will give it a shot but I
will need to have the original package  or at least a dumbed down version of
it to test it out.



Please, see attached package source.
I've found workaround for this issue (misunderstanding?). If two
function versions have different parameter names, e.g.:

FUNCTION #1:
  procedure test_func(i_nParam1in NUMBER
, i_dtParam2   in DATE
, i_dtParam3   in DATE
, o_nDays  out NUMBER
 ) is
  begin

return 1;
  end test_func;

FUNCTION #2:
  procedure test_func(i_nParam1in NUMBER
, i_sParam2in VARCHAR2
, i_sParam3in VARCHAR2
, o_nDays  out NUMBER
 ) is
  begin

return 1;
  end test_func;

With this, we can use named parameters while calling procedure:

 $sSQL = q{
   begin

 package.function_name( i_nParam1 => :i_param1
  , i_sParam2 => :i_param2
  , i_sParam3 => :i_param3
  , o_nDays => :o_param1
  );
   end;
 };

The question here is: What if parameters named equally in both functions ?

  


Re: DBD::Oracle & overloaded stored procedure

2008-06-10 Thread John Scoles
Well I spent the last few mins playing with a similar overloaded 
procedure found here


http://www.psoug.org/reference/packages.html, you have to scroll down a 
bit to '*Package Overloading'


*and I got it to work with this code

my $dbh =$dbh = DBI->connect('dbi:Oracle:',xxx','xxx');
$sth  = $dbh->prepare("begin overloaded.insby(?); end;");
$sth->bind_param(1, 22);

$sth->execute();*

*and

$sth  = $dbh->prepare("begin overloaded.insby(?); end;");
$sth->bind_param(1, 'test');

$sth->execute();

both worked for me.

See if you can get that example working and then build it up from there? 


cheers
John Scoles


John Scoles wrote:
More a PL/SQL question than a DBI/DBD one but I will give it a shot 
but I will need to have the original package  or at least a dumbed 
down version of it to test it out.


Seems it should work.

cheers
John Scoles


Eugene Krivdyuk wrote:

I'm trying to make a call of packaged stored procedure, e.g.:

=== perl code ===
  $sSQL = q{
begin

  package.function_name( :i_param1
   , :i_param2
   , :i_param3
   , :o_param1
   );
end;
  };

  $sth = $dbh->prepare($sSQL);

  $sth->bind_param(':i_param1', 1);
  $sth->bind_param(':i_param2',  $sDateStart, { ora_type => 
ORA_VARCHAR2 });
  $sth->bind_param(':i_param3',  $sDateEnd,  { ora_type => 
ORA_VARCHAR2 });


  $sth->bind_param_inout( ':o_param1', \$iDaysCnt, 10, { ora_type
=> ORA_NUMBER } );

  $sth->execute;
=== perl code ===

function_name is an overloaded PL/SQL stored procedure, one accepts
i_param2 & i_param3 of type DATE, second accepts i_param2 & i_param3
of type VARCHAR2.
When executing code like above, I'm getting this error:

   PLS-00307: too many declarations of 'function_name' match this call

Is there any way to make it work?

  


Re: DBD::Oracle & overloaded stored procedure

2008-06-10 Thread John Scoles
More a PL/SQL question than a DBI/DBD one but I will give it a shot but 
I will need to have the original package  or at least a dumbed down 
version of it to test it out.


Seems it should work.

cheers
John Scoles


Eugene Krivdyuk wrote:

I'm trying to make a call of packaged stored procedure, e.g.:

=== perl code ===
  $sSQL = q{
begin

  package.function_name( :i_param1
   , :i_param2
   , :i_param3
   , :o_param1
   );
end;
  };

  $sth = $dbh->prepare($sSQL);

  $sth->bind_param(':i_param1', 1);
  $sth->bind_param(':i_param2',  $sDateStart, { ora_type => ORA_VARCHAR2 });
  $sth->bind_param(':i_param3',  $sDateEnd,  { ora_type => ORA_VARCHAR2 });

  $sth->bind_param_inout( ':o_param1', \$iDaysCnt, 10, { ora_type
=> ORA_NUMBER } );

  $sth->execute;
=== perl code ===

function_name is an overloaded PL/SQL stored procedure, one accepts
i_param2 & i_param3 of type DATE, second accepts i_param2 & i_param3
of type VARCHAR2.
When executing code like above, I'm getting this error:

   PLS-00307: too many declarations of 'function_name' match this call

Is there any way to make it work?

  


RE: Problems with DBD 1.21 build?

2008-06-06 Thread John Scoles

Thanks for the report, personally the Errors you are getting in the make Test 
would not worry me very much.  They are mostly related to the very old version 
of the client you are using or an older unpatched Oracle DB. 
 
Most of them are trivial things dealing with Unicode and UTF8 stuff and unless 
you are working with a DB that deals with these issues I am fairly sure it will 
not cause you much grief.  The last test are for some really old code that 
hopefully you will not be using (Oraperl)
 
You may want to get the latest version of the Oracle  instant client that might 
make most of the test pass.  I would use the latest Trunk version of the 
Makefile.PL which can be found here
 
http://svn.perl.org/modules/dbd-oracle/trunk/Makefile.PL 
 
I would just go ahead and do a make install.cheers
John Scoles


Subject: Problems with DBD 1.21 build?Date: Fri, 6 Jun 2008 10:49:57 -0500From: 
[EMAIL PROTECTED]: dbi-users@perl.org




Attached is the output from a DBD build (I know it says dbi-build, but it’s a 
DBD build).  There was a line in the output that said to report to this mailing 
list.
 
I’m trying to build DBD-1.21 on a new Solaris 10 system.  There are some 
failures in there I’m not sure of, especially the last one for test_dynamic, 
but other than that it looks ok, I would guess.  I haven’t done an ‘make 
install’ yet.
 
Any suggestions on this?
 
Thanks
_



Re: DBD::Oracle Installation

2008-06-06 Thread John Scoles
Go out an get the Oracle instant client basic and SDK and user that. 
Looks like you do not have a complete Oracle client  or you did not set 
your Oracle_home and or LD_LIBRARY_PATH correctly.  Do what it says Read 
the READMEs


[EMAIL PROTECTED] wrote:

Hi,

 


I successfully installed Perl 5.10 in my system, but when I tried to
connect Oracle database, I got an DBD::Oracle not found error. I
downloaded the file and tried to do run the Makefile.PL file, but I am
getting the following error 

 


  Unable to find required Oracle OCI files for the build.  Please
check

  that you have your OCI installed in your oracle home
(D:/oracle/ora92)

  directory and that it has the following files (and probably more):

 


D:/oracle/ora92\oci\include\oratypes.h

D:/oracle/ora92\oci\lib\MSVC\.lib

 


  Please install OCI or send comments back to dbi-users@perl.org

  if you have an OCI directory other than oci.

 


  Alternatively, if you're using ActiveState perl on Windows try

ppm install ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.3/DBI.ppd

ppm install
ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.3/DBD-Oracle.ppd

 


   at Makefile.PL line 258.

 


The OCI has installed at D:\oracle\ora92, but the file oratypes.h was
not found. I copied the oratypes.h file from D:\oracle\ora92\rdbms\demo
directory, but still have the same problem and I don't know what files
it is expecting at D:/oracle/ora92\oci\lib\MSVC\ directory. 

 


So please help me to resolve this issue as early as possible.

 

Regards, 
Sreejith.R | Eagle COE
Cognizant Technology Solutions, PKN, Chennai 
Mob: 9940074936 Extn: 451921


 




This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. 
Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.
  


Re: getting error while installing DBD-Oracle-1.19

2008-05-30 Thread John Scoles

Try this version of the makefile

http://svn.perl.org/modules/dbd-oracle/trunk/Makefile.PL

you might have better luck with is as we have done a few thing to make 
oracle 11 compile easier.



cheers
John Scoles


[EMAIL PROTECTED] wrote:

HI,
i m getting below error while trying to install DBD-Oracle-1.19
the oracle installed is 11g in the machince  
 
 
 
[EMAIL PROTECTED] DBD-Oracle-1.19]$ perl Makefile.PL

Multiple copies of Driver.xst found in: 
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI/ 
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI/ at 
Makefile.PL line 35
Using DBI 1.601 (for perl 5.008008 on x86_64-linux-thread-multi) installed in 
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI/
Configuring DBD::Oracle for perl 5.008008 on linux (x86_64-linux-thread-multi)
Remember to actually *READ* the README file! Especially if you have any 
problems.
Using Oracle in /oracle/app/product/11.1.0/db_1
DEFINE _SQLPLUS_RELEASE = "1101000600" (CHAR)
Oracle version 11.1.0.6 (11.1)
Unable to locate an oracle.mk, proc.mk or other suitable *.mk
file in your Oracle installation.  (I looked in
/oracle/app/product/11.1.0/db_1/rdbms/demo/demo_xe.mk 
/oracle/app/product/11.1.0/db_1/rdbms/lib/oracle.mk 
/oracle/app/product/11.1.0/db_1/rdbms/demo/oracle.mk 
/oracle/app/product/11.1.0/db_1/rdbms/demo/demo_rdbms.mk 
/oracle/app/product/11.1.0/db_1/precomp/demo/proc/proc.mk 
/oracle/app/product/11.1.0/db_1/precomp/demo/proc/demo_proc.mk 
/oracle/app/product/11.1.0/db_1/proc/lib/proc.mk 
/oracle/app/product/11.1.0/db_1/proc16/lib/proc16.mk under 
/oracle/app/product/11.1.0/db_1)
The oracle.mk (or demo_rdbms.mk) file is part of the Oracle
RDBMS product. The proc.mk (or demo_proc.mk) file is part of
the Oracle Pro*C product.  You need to build DBD::Oracle on a
system which has one of these Oracle components installed.
(Other *.mk files such as the env_*.mk files will not work.)
Alternatively you can use Oracle Instant Client.
In the unlikely event that a suitable *.mk file is installed
somewhere non-standard you can specify where it is using the -m option:
perl Makefile.PL -m /path/to/your.mk
See README.clients.txt for more information and some alternatives.
 at Makefile.PL line 1072.

 
 
 
 
 



DISCLAIMER:
This message contains privileged and confidential information and is intended 
only for an individual named. If you are not the intended recipient, you should 
not disseminate, distribute, store, print, copy or deliver this message. Please 
notify the sender immediately by e-mail if you have received this e-mail by 
mistake and delete this e-mail from your system. E-mail transmission cannot be 
guaranteed to be secure or error-free as information could be intercepted, 
corrupted, lost, destroyed, arrive late or incomplete or contain viruses. The 
sender, therefore,  does not accept liability for any errors or omissions in 
the contents of this message which arise as a result of e-mail transmission. If 
verification is required, please request a hard-copy version.

  


Re: getting problem while installing DBD-Oracle-1.19

2008-05-29 Thread John Scoles
We need to know what you are compiling against.  Would you please post 
the results of your Makefile.PL?? Thie error can happen in a nuymber of ways


Cheers
John Scoles

[EMAIL PROTECTED] wrote:

Hi,

 

 


When I tried to install DBD-Oracle-1.19 then I m getting below error in
make test step

 

 


PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t

t/01baseFailed to load Oracle extension and/or shared
libraries:

install_driver(Oracle) failed: Can't load
'/opt/batman/DBD-Oracle-1.19/blib/arch/auto/DBD/Oracle/Oracle.so' for
module DBD::Oracle: /oracle/oracle/product/10.2.0/db_1/lib/libnnz10.so:
cannot restore segment prot after reloc: Permission denied at
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.

 at (eval 3) line 3

Compilation failed in require at (eval 3) line 3.

Perhaps a required shared library or dll isn't installed where expected

 at t/01base.t line 19

The remaining tests will probably also fail with the same error.

 

 

 

 

 

 


Thanks & Regards

 


Tushar

Ext:- 3933

 




DISCLAIMER:
This message contains privileged and confidential information and is intended 
only for an individual named. If you are not the intended recipient, you should 
not disseminate, distribute, store, print, copy or deliver this message. Please 
notify the sender immediately by e-mail if you have received this e-mail by 
mistake and delete this e-mail from your system. E-mail transmission cannot be 
guaranteed to be secure or error-free as information could be intercepted, 
corrupted, lost, destroyed, arrive late or incomplete or contain viruses. The 
sender, therefore,  does not accept liability for any errors or omissions in 
the contents of this message which arise as a result of e-mail transmission. If 
verification is required, please request a hard-copy version.

  


Re: Problem installing DBD::Oracle

2008-05-29 Thread John Scoles




I would go and get a copy of the instant client and compile DBD.Oracle
against that. It will still connect to any Oracle DB down to 8  and
maybe even 7.  I will pull your hair out trying to find little bits and
pieces of a 9 client.

Cheers
John Scoles

Himanshu Kumar wrote:

  
  

  
  
  
  Hi,
  I am using Oracle 9i in
windows and I’ve installed Active
Perl 5.8.8 Build 820.
  I am able to install
DBI-1.48.
  But I am not able to
install DBD-Oracle-1.16 or DBD-Oracle-1.15.
  It is giving the
following error.
   
   
  Unable to
find required Oracle OCI files
for the build.  Please check
  That you have
your OCI installed in your
oracle home (C:/oracle/ora92)
  Directory and
that it has the following
files (and probably more):
   
   
C:/oracle/ora92\oci\include\oratypes.h
   
C:/oracle/ora92\oci\lib\MSVC\.lib
   
  Please
install OCI or send comments back to
dbi-users@perl.org
  if you have
an OCI directory other than
oci.
   
   
  I’ve
checked in oci directory also.
  There is
only one file oramts.h in
oci\include
directory and
  oramts.lib in
oci\lib\msvc directory.
  I searched
for oratypes.h file and
pasted it to C:/oracle/ora92\oci\include\ 
  but again
it is giving the same error.
   
   Thanks
&
Regards,
  Himanshu
Kumar Gaur
  HCL Comnet
Ltd.
  A-
9, Sector 3, Noida 201301, U.P. (India)
  Board
No: 0121-4382800 Ext: 3075
  Mob:
+91-346828
  
   
  “Wanna
Live while Alive”
   
  
  

  
DISCLAIMER:
---

The contents of this e-mail and any attachment(s) are confidential and
intended for the named recipient(s) only. 
It shall not attach any liability on the originator or HCL or its
affiliates. Any views or opinions presented in 
this email are solely those of the author and may not necessarily
reflect the opinions of HCL or its affiliates. 
Any form of reproduction, dissemination, copying, disclosure,
modification, distribution and / or publication of 
this message without the prior written consent of the author of this
e-mail is strictly prohibited. If you have 
received this email in error please delete it and notify the sender
immediately. Before opening any mail and 
attachments please check them for viruses and defect.

---

  

  





Re: Perl - connecting to Oracle

2008-05-21 Thread John Scoles

I guess I can get that in for 1.22

Cheers
John Scoles
Tim Bunce wrote:

Nevertheless, I've seen several instances of people not understanding
that the "<*>" was added to the statement by DBD::Oracle as a marker
when it reports the error.

Changing it to something unambiguous would help.

Tim.

On Wed, May 21, 2008 at 05:42:17PM +0800, Paul Gallagher wrote:
  

Hi Tim,
I don't think <*> is really an issue ... I understood Mike to be flagging
"staion_id" as the probable typo (hence ORA-00904), not <*>.
Paul
http://tardate.blogspot.com

On Wed, May 21, 2008 at 5:00 PM, Tim Bunce <[EMAIL PROTECTED]> wrote:



On Tue, May 20, 2008 at 07:44:33PM -0400, John Scoles wrote:
  

No the <*> is DBI way of pointing to where the error is.


Seems like a common misunderstanding.

Perhaps the "<*>" should be changed to something like ""

Tim.

  


Re: Perl - connecting to Oracle

2008-05-21 Thread John Scoles

D'ho!!

That is so funny!!

I guess I really sounded like a smarty pants on that one!!

Dyslexia and computer coding do not mix very well on my part.

anyway I do not believe in Dog!

Thanks for the morning laugh!!


Paul Gallagher wrote:

Hi Tim,
I don't think <*> is really an issue ... I understood Mike to be 
flagging "staion_id" as the probable typo (hence ORA-00904), not <*>.

Paul
http://tardate.blogspot.com

On Wed, May 21, 2008 at 5:00 PM, Tim Bunce <[EMAIL PROTECTED] 
<mailto:[EMAIL PROTECTED]>> wrote:


    On Tue, May 20, 2008 at 07:44:33PM -0400, John Scoles wrote:
> No the <*> is DBI way of pointing to where the error is.

Seems like a common misunderstanding.

Perhaps the "<*>" should be changed to something like ""

Tim.




Re: Building DBD::Oracle on XP w/ VC 2005

2008-05-08 Thread John Scoles

Seem I now have access to an Oracle 11 box so I can have a look into this.

So far I get the same results as you.

Tomorrow I will have to do some debugging with this.

Cheers John Scoles

John Scoles wrote:
I will CC this one to a contact I have at Oracle as  the first 
question Oracle suport will as is what it DBD::Oracle??? followed by 
we don't support it.


If you do follow up say the execute array dose not work as expected.  
and that it works in 9.


cheers
John Scoles

Gerber, Christopher J wrote:

Can you point it to a different  non 11 DB instance??

and run the tests again?

Could be a bug on the oracle side?

seems to be a number of them on 11 64 dbs coming up the past few days.



Using an Oracle 9i server, the errors went away.  I think that you're
right about the 11g bug.  Thanks for the assistance.  I guess I have to
find someone at Oracle to pester now! :)

 

cheers
John Scoles
Gerber, Christopher J wrote:
   

Odd

Gerber, Christopher J wrote:
   

First off, I am new to the list.  If there is a FAQ, feel free to


point
   

me there!

This morning I built DBD-Oracle-1.21 on my XP machine using Visual
Studio 2005.  After building, I needed to copy the redistributable
files
to blib/arch/auto/DBD/Oracle, and I needed to embed the manifest
into
Oracle.dll with the following command:

  mt.exe -manifest Oracle.dll.manifest -outputresource:Oracle.dll;2
  


 

I also needed to include my SID in ORACLE_USERID:

  set ORACLE_USERID=user/[EMAIL PROTECTED]/ORCL
   ^

After all this, things worked, *except* for two tests:

t/26exe_array...ok 1/14
t/26exe_array...NOK 11/14#   Failed test '... we should
  

have
 


19
   

tuple_status'
#   at t/26exe_array.t line 120.
#  got: 10
# expected: 19

  

this means that 9 rows did not get inserted  for some reason
   

t/26exe_array...NOK 14/14#   Failed test '... we should
  

have
 


48
   

rows'
#   at t/26exe_array.t line 146.
#  got: 30
# expected: 48
# Looks like you failed 2 tests of 14.
t/26exe_array...dubious
Test returned status 2 (wstat 512, 0x200)

  

this is linked to the not inserted 9 above so if we fix 11 we fix


this
 
   

I'm curious if others have seen these problems.

  

Can you tell me the which Oracle version you are running the tests


on?
 

   

and which version of DBI?


I am using Oracle Instant Client 11.1.0.6.0 32bit on Windows to
  

connect
 

to a server running Oracle 11.1.0.6.0 64bit on Linux.  I am using DBI
version 1.601, although I see that 1.602 is now available.

   

This could be a permission problem with the user that is running the

test.

Try running the tests again with the 'system' user and password and

see  

what you get.



Using the SYSTEM account I get the same test results.

I just updated DBI to 1.602 and tested again... the results are the
same.

   

cheers
John Scoles
   

Chris
  


Re: Building DBD::Oracle on XP w/ VC 2005

2008-05-01 Thread John Scoles
I will CC this one to a contact I have at Oracle as  the first question 
Oracle suport will as is what it DBD::Oracle??? followed by we don't 
support it.


If you do follow up say the execute array dose not work as expected.  
and that it works in 9.


cheers
John Scoles

Gerber, Christopher J wrote:

Can you point it to a different  non 11 DB instance??

and run the tests again?

Could be a bug on the oracle side?

seems to be a number of them on 11 64 dbs coming up the past few days.



Using an Oracle 9i server, the errors went away.  I think that you're
right about the 11g bug.  Thanks for the assistance.  I guess I have to
find someone at Oracle to pester now! :)

  

cheers
John Scoles
Gerber, Christopher J wrote:


Odd

Gerber, Christopher J wrote:



First off, I am new to the list.  If there is a FAQ, feel free to
  
  

point
  
  

me there!

This morning I built DBD-Oracle-1.21 on my XP machine using Visual
Studio 2005.  After building, I needed to copy the redistributable
files
to blib/arch/auto/DBD/Oracle, and I needed to embed the manifest
into
Oracle.dll with the following command:

  mt.exe -manifest Oracle.dll.manifest -outputresource:Oracle.dll;2
  


  

I also needed to include my SID in ORACLE_USERID:

  set ORACLE_USERID=user/[EMAIL PROTECTED]/ORCL
   ^

After all this, things worked, *except* for two tests:

t/26exe_array...ok 1/14
t/26exe_array...NOK 11/14#   Failed test '... we should
  

have
  
  
  

19
  
  

tuple_status'
#   at t/26exe_array.t line 120.
#  got: 10
# expected: 19

  
  
  

this means that 9 rows did not get inserted  for some reason



t/26exe_array...NOK 14/14#   Failed test '... we should
  

have
  
  
  

48
  
  

rows'
#   at t/26exe_array.t line 146.
#  got: 30
# expected: 48
# Looks like you failed 2 tests of 14.
t/26exe_array...dubious
Test returned status 2 (wstat 512, 0x200)

  
  
  

this is linked to the not inserted 9 above so if we fix 11 we fix


this
  



I'm curious if others have seen these problems.

  
  
  

Can you tell me the which Oracle version you are running the tests


on?
  


  
  

and which version of DBI?



I am using Oracle Instant Client 11.1.0.6.0 32bit on Windows to
  

connect
  

to a server running Oracle 11.1.0.6.0 64bit on Linux.  I am using DBI
version 1.601, although I see that 1.602 is now available.

  
  

This could be a permission problem with the user that is running the


test. 
  
  

Try running the tests again with the 'system' user and password and

see 
  

what you get.



Using the SYSTEM account I get the same test results.

I just updated DBI to 1.602 and tested again... the results are the
same.

  
  

cheers
John Scoles



Chris
  


Re: Building DBD::Oracle on XP w/ VC 2005

2008-05-01 Thread John Scoles

Can you point it to a different  non 11 DB instance??

and run the tests again?

Could be a bug on the oracle side?

seems to be a number of them on 11 64 dbs coming up the past few days.

cheers
John Scoles
Gerber, Christopher J wrote:

Odd

Gerber, Christopher J wrote:


First off, I am new to the list.  If there is a FAQ, feel free to
  

point
  

me there!

This morning I built DBD-Oracle-1.21 on my XP machine using Visual
Studio 2005.  After building, I needed to copy the redistributable
  

files
  

to blib/arch/auto/DBD/Oracle, and I needed to embed the manifest
  

into
  

Oracle.dll with the following command:

  mt.exe -manifest Oracle.dll.manifest -outputresource:Oracle.dll;2 


I also needed to include my SID in ORACLE_USERID:

  set ORACLE_USERID=user/[EMAIL PROTECTED]/ORCL
   ^

After all this, things worked, *except* for two tests:

t/26exe_array...ok 1/14
t/26exe_array...NOK 11/14#   Failed test '... we should have
  

19
  

tuple_status'
#   at t/26exe_array.t line 120.
#  got: 10
# expected: 19

  
  

this means that 9 rows did not get inserted  for some reason


t/26exe_array...NOK 14/14#   Failed test '... we should have
  

48
  

rows'
#   at t/26exe_array.t line 146.
#  got: 30
# expected: 48
# Looks like you failed 2 tests of 14.
t/26exe_array...dubious
Test returned status 2 (wstat 512, 0x200)

  
  

this is linked to the not inserted 9 above so if we fix 11 we fix this


I'm curious if others have seen these problems.

  
  

Can you tell me the which Oracle version you are running the tests on?



  

and which version of DBI?



I am using Oracle Instant Client 11.1.0.6.0 32bit on Windows to connect
to a server running Oracle 11.1.0.6.0 64bit on Linux.  I am using DBI
version 1.601, although I see that 1.602 is now available.

  

This could be a permission problem with the user that is running the

test. 
  

Try running the tests again with the 'system' user and password and

see 
  

what you get.




Using the SYSTEM account I get the same test results.

I just updated DBI to 1.602 and tested again... the results are the
same.

  

cheers
John Scoles


Chris
  
  


Re: Error - DBD::Oracle / ORA-1008 problem with placeholders

2008-04-30 Thread John Scoles
Thanks Pascal.  I wanted the Table deff so I could exactly mimic your 
situation.


I managed to get your code to work on my 10XE DB but I will give this 
new Table a shot and see what happens on my 10 linux box later to day or 
tomorrow


Would not surprize me if it is Oracle, It would not be the first time 
that they had a bug in their code.


For now I might add this to the Readme

cheers
John Scoles .






[EMAIL PROTECTED] wrote:

Hello John,

Please find the table definition : 
	create table owner1.table1  (

   col0CHAR(8)  not null,
   col1CHAR(5)  not null,
   col2CHAR(2)  not null,
   col3CHAR(3)  not null,
   col4NUMBER(5,2)   not null,
   col5CHAR(1),
   col6NUMBER(18,3),
   col7CHAR(1),
   col8NUMBER(18,3),
   col9DATE default SYSDATE not null
)

System information :
  Unix / SUN or AIX (the case is not depending on OS, I can reproduce it in all 
Unix)
  Oracle 10gR2 PatchSet 2 (10.2.0.3.0) with 2 patches installed 5556081 and 
5557962

The SQL is correct syntaxically and works fine when I execute it in sqlplus.
The only question I had is about col0 that is containing data like this format "dd/mm/yy" but is a string. But ... 


I analyzed this issue again and have news about it :

The problem is depend on an Oracle parameter : CURSOR_SHARING.
On our instances this parameter is set sometimes at the default (EXACT) and 
sometimes to FORCE.
So the problem is the difference of the behaviour between Oracle 9i and Oracle 
10g.
With Oracle 9i, the value of the parameter could be EXACT or FORCE, the Perl 
script works correctly
With Oracle 10g, if the value is FORCE, the Perl script report ORA-1008 error, 
else if the value is EXACT is works correctly.
=> so I have a workaround, it is to add and "alter session" after the 
DBH->connect.

There is an Oracle patch that should fix Oracle 10g behaviour
5254759 for 10.2.0.3 - ORA-12801/ORA-1008 OCCURS ON A PARALLEL QUERY WITH BIND 
VARIABLES
But I didn't tested it, yet.

Regards
Pascal
 


-----Message d'origine-
De : John Scoles [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 29 avril 2008 17:12

À : MONSCHEIN,PASCAL
Cc : dbi-users@perl.org
Objet : Re: Error - DBD::Oracle / ORA-1008 problem with placeholders

Can you give me what the table schema is?
I would like to know what  datatypes

col1,col2,col3,col4


are so I can try and recreate the error.

As well what operation system are you using and which version of DBI?

anyway just looking at the SQL it doesn't look quite right

cheers
John Scoles

[EMAIL PROTECTED] wrote:
  

Hello all,
 
I encouter an error with DBD::Oracle and Oracle instances 10g that I 
dont understand :
  DBD::Oracle::st execute failed: ORA-01008: not all variables bound 
(DBD ERROR: OCIStmtExecute)


This script works fine with Oracle 9i.
I compiled DBD::Oracle (1.19) based on Oracle 9i (on Sun-Solaris10) - 
DBI 1.58


I tried to compile DBD::Oracle (1.21) based on Oracle 10g (on
Sun-Solaris10) with the same error.
I tried to use DBI_TRACE=2 or 3 but I dont find the trace usefull.

My tests against Oracle instances :
  9i  (new install)  - ok (it is always ok with 9i)
  10g (new install)  - bad
  10g (migrated from 9i) - bad

My tests against placeholders :
  If I used placeholders like ":param1", it works the first time, then 
it will failed in general


My tests against the SQL query :
  If I comment the first column returned (the TO_CHAR(...) AS DT, it 
works the first time

  then it failed

So the problem seems to be with CACHE or something like that ?


My script is :
#
--
--
use DBI;
$dsn="dbi:Oracle:host=my_server;port=1521;sid=my_sid";
my $query = "
  SELECT
TO_CHAR(TO_DATE(col1,'DD/MM/YY'),'MMDD') AS DT,
col2,col3,col4 FROM  table1 WHERE SUBSTR(col1,4) = ? 
";
$DBH = DBI->connect($dsn,"toto","toto",{PrintError => 0, RaiseError => 
1}); $STH = $DBH -> prepare($extraction_query); my 
$month_MMAA="03/08"; #$STH->bind_param(":pr1", $month_MMAA); 
$STH->bind_param(1, $month_MMAA); $STH->execute();  
DBI::dump_results($STH); $STH->finish(); $DBH->disconnect(); #

--
--

I need your help

Regards

Pascal

  




  


Re: Error - DBD::Oracle / ORA-1008 problem with placeholders

2008-04-29 Thread John Scoles

Can you give me what the table schema is?
I would like to know what  datatypes

col1,col2,col3,col4


are so I can try and recreate the error.

As well what operation system are you using and which version of DBI?

anyway just looking at the SQL it doesn't look quite right

cheers
John Scoles

[EMAIL PROTECTED] wrote:

Hello all,
 
I encouter an error with DBD::Oracle and Oracle instances 10g that I

dont understand :
  DBD::Oracle::st execute failed: ORA-01008: not all variables bound
(DBD ERROR: OCIStmtExecute)

This script works fine with Oracle 9i.
I compiled DBD::Oracle (1.19) based on Oracle 9i (on Sun-Solaris10) -
DBI 1.58

I tried to compile DBD::Oracle (1.21) based on Oracle 10g (on
Sun-Solaris10) with the same error.
I tried to use DBI_TRACE=2 or 3 but I dont find the trace usefull.

My tests against Oracle instances :
  9i  (new install)  - ok (it is always ok with 9i)
  10g (new install)  - bad
  10g (migrated from 9i) - bad

My tests against placeholders :
  If I used placeholders like ":param1", it works the first time, then
it will failed in general

My tests against the SQL query :
  If I comment the first column returned (the TO_CHAR(...) AS DT, it
works the first time
  then it failed

So the problem seems to be with CACHE or something like that ?


My script is :
#

use DBI;
$dsn="dbi:Oracle:host=my_server;port=1521;sid=my_sid";
my $query = "
  SELECT
TO_CHAR(TO_DATE(col1,'DD/MM/YY'),'MMDD') AS DT,
col2,col3,col4 FROM  table1 WHERE SUBSTR(col1,4) = ? 
";

$DBH = DBI->connect($dsn,"toto","toto",{PrintError => 0, RaiseError =>
1});
$STH = $DBH -> prepare($extraction_query);
my $month_MMAA="03/08";
#$STH->bind_param(":pr1", $month_MMAA);
$STH->bind_param(1, $month_MMAA);
$STH->execute();
 DBI::dump_results($STH);
$STH->finish();
$DBH->disconnect();
#


I need your help

Regards

Pascal

  


Re: DBD::Oracle and Support for Oracle 8 and 9 clients

2008-04-18 Thread John D Groenveld
In message <[EMAIL PROTECTED]>, scoles
@pythian.com writes:
>With the upcoming demise of Oracle support of 9i we will see a good number

9i (9.2.0.8) still has some support life left:
http://www.oracle.com/support/collateral/oracle-technical-support-policies.pdf>
http://www.oracle.com/support/collateral/lifetime-support-coverage-chart.pdf>

That's not a cry for DBD::Oracle support moving forward as I'm mostly
dealing with more recent Instance Client.

John
[EMAIL PROTECTED]



Re: Log DBI query and values with placeholders

2008-04-15 Thread John Scoles

I would have to agree with Martin that DBIx::Log4perl will work quite well.

In the long term you might want to accomplish this by adding some 
triggers on your DB tables to record this data as well.


This way all changes to the table will be caught at the DB end.  So in 
cases where someone is able to log in and make changes in some other 
manner, other than your perl code, are caught as well. 


It will also save a great deal of coding.

The caveat being this does make the DB a little slower and you need 
space to store all these changes.


cheers

Martin Evans wrote:

aspiritus wrote:

Hello all experts !

I need to log every INSERT, UPDATE and DELETE queries even when using
placeholders. Here some code:

$sql = "UPDATE users SET `name`=? WHERE ìd`=1;";
$sth = $dbh->prepare($sql);
$sth->execute('Test User');
$sth->finish();

Of course execute params are given dynamically and I want to use
placeholders for more secure code.
I want to save that UPDATE query into file or database ( I'll prefer
DB :) ) for tracking purposes. Any idea how to do this?




DBIx::Log4perl will do this and more. Log4perl supports logging to 
files and databases and a lot more and DBIx::Log4perl can be inserted 
wherever you use DBI very easily. Whether the format will be how you 
want it is another question but as I have an interest in 
DBIx::Log4perl I would be happy to hear your suggestions.


Martin


Re: Urgent help required : Issue with DBD:Oracle 1.20 installation

2008-04-04 Thread John Scoles
Well you oracle clients it ancient for one this (8.0.6.0 )  and 
unfortunately installing DBD::Oracle on a sun box has always been 
problematic.


the

dbdimp.c:2997: error: `OCI_BATCH_ERRORS' undeclared (first use in this

error basically tells me that you are missing this constant in the 
'oci.h' of the client you are attempting to use.  If this is the case 
you will have to use an older version of DBD::ORACLE (1.17)  if you want 
to keep this client. I doesn't matter really as with this client you 
cannot use any of the functionality of the later versions.


So if you must use the old oracle client use an older DBD::Oracle.

You can also compile you DBD:Oracle against the Oracle instant client 
and it will work as well


cheers
John Scoles


Divyansh Nasa wrote:

Hi all

I am trying to install DBD-Oracle-1.20 downloaded from CPAN.

I am getting the following errors. Request you to help asap


[EMAIL PROTECTED] # perl Makefile.PL
Using DBI 1.601 (for perl 5.008007 on sun4-solaris) installed in
/opt/soe/local/perl-5.8.7/lib/site_perl/5.8.7/sun4-solaris/auto/DBI/

Configuring DBD::Oracle for perl 5.008007 on solaris (sun4-solaris)

Remember to actually *READ* the README file! Especially if you have any
problems.

Using Oracle in /u02/app/dvoa061a/oracle/8.0.6
DEFINE _SQLPLUS_RELEASE = "80006" (CHAR)
Oracle version 8.0.6.0 (8.0)
Found /u02/app/dvoa061a/oracle/8.0.6/rdbms/demo/demo_rdbms.mk
Found /u02/app/dvoa061a/oracle/8.0.6/precomp/demo/proc/demo_proc.mk
Using /u02/app/dvoa061a/oracle/8.0.6/rdbms/demo/demo_rdbms.mk
Your LD_LIBRARY_PATH env var is set to
'/usr/openwin/lib:/u02/app/dvoa061a/oracle/8.0.6/lib'
Reading /u02/app/dvoa061a/oracle/8.0.6/rdbms/demo/demo_rdbms.mk
Reading /u02/app/dvoa061a/oracle/8.0.6/rdbms/lib/env_rdbms.mk

Attempting to discover Oracle OCI build rules
gcc -c  -I/u02/app/dvoa061a/oracle/8.0.6/rdbms/demo
-I/u02/app/dvoa061a/oracle/8.0.6/rdbms/demo
-I/u02/app/dvoa061a/oracle/8.0.6/rdbms/public
-I/u02/app/dvoa061a/oracle/8.0.6/plsql/public
-I/u02/app/dvoa061a/oracle/8.0.6/network/public -I/opt/soe/local/perl-5.8.7
/lib/site_perl/5.8.7/sun4-solaris/auto/DBI  -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O
-DVERSION=\"1.20\"  -DXS_VERSION=\"1.20\" -fPIC
"-I/opt/soe/local/perl-5.8.7/lib/5.8.7/sun4-solaris/CORE"  -Wall
-Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"8.0.6.0\"
-DUSE_ORA_OCI_STMNT_FETCH DBD_ORA_OBJ.c
by executing: [make -f /u02/app/dvoa061a/oracle/8.0.6
/rdbms/demo/demo_rdbms.mk build ECHODO=echo ECHO=echo GENCLNTSH='echo
genclntsh' CC=true OPTIMIZE= CCFLAGS= EXE=DBD_ORA_EXE OBJS=DBD_ORA_OBJ.o]
Oracle oci build command:
[true -L/u02/app/dvoa061a/oracle/8.0.6/lib/
-L/u02/app/dvoa061a/oracle/8.0.6/rdbms/lib -o DBD_ORA_EXE DBD_ORA_OBJ.o
-lclntsh /u02/app/dvoa061a/oracle/8.0.6/lib/nautab.o
/u02/app/dvoa061a/oracle/8.0.6/lib/naeet.o /u02/app/dvoa061a/oracle/8.0.6
/lib/naect.o /u02/app/dvoa061a/oracle/8.0.6/lib/naedhs.o -lnetv2 -lnttcp
-lnetwork -lncr -lnetv2 -lnttcp -lnetwork -lclient -lvsn -lcommon -lgeneric
-lmm -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lnetv2 -lnttcp
-lnetwork -lncr -lnetv2 -lnttcp -lnetwork -lclient -lvsn -lcommon -lgeneric
-lepc -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lclient -lvsn -lcommon
-lgeneric -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lnsl -lsocket
-lgen -ldl -lc -laio -lm -lthread]

Found header files in /u02/app/dvoa061a/oracle/8.0.6/rdbms/demo.

Checking for functioning wait.ph


System: perl5.008007 sunos zlggs002 5.8 generic_108528-07 sun4u sparc
sunw,ultra-250
Compiler:   gcc -O -fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
Linker: /usr/ccs/bin/ld
Sysliblist: -lnsl -lsocket -lgen -ldl
Oracle makefiles would have used these definitions but we override them:
  CC:   cc
  CFLAGS:   $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(QACCFLAGS)
$(PFLAGS)\
$(SHARED_CFLAG) $(USRFLAGS)
   [$(GFLAG) -xO2 $(CDEBUG) -Xa $(PROFILE) -xstrconst -xF $(XS) -mr
-xarch=v8 -xcache=16/32/1:1024/64/1 -xchip=ultra -D_REENTRANT -K PIC
$(QACCFLAGS) -I/u02/app/dvoa061a/oracle/8.0.6/rdbms/demo
-I/u02/app/dvoa061a/oracle/8.0.6/rdbms/public
-I/u02/app/dvoa061a/oracle/8.0.6/plsql/public
-I/u02/app/dvoa061a/oracle/8.0.6/network/public -DSLMXMX_ENABLE
-DSLTS_ENABLE $(LPFLAGS) $(USRFLAGS)]
  LDFLAGS:  -L$(LIBHOME) -L$(ORACLE_HOME)/rdbms/lib
   [-L$(LIBHOME) -L/u02/app/dvoa061a/oracle/8.0.6/rdbms/lib]
Linking with OTHERLDFLAGS = -L/u02/app/dvoa061a/oracle/8.0.6/lib/
-L/u02/app/dvoa061a/oracle/8.0.6/rdbms/lib   -lclntsh
/u02/app/dvoa061a/oracle/8.0.6/lib/nautab.o /u02/app/dvoa061a/oracle/8.0.6
/lib/naeet.o /u02/app/dvoa061a/oracle/8.0.6/lib/naect.o
/u02/app/dvoa061a/oracle/8.0.6/lib/naedhs.o -lnetv2 -lnttcp -lnetwork -lncr
-lnetv2 -lnttcp -lnetwork -lclient -lvsn -lcommon -lgeneric -lmm -lnlsrtl3
-lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lnetv2

RE: wrong ELF class:

2008-04-01 Thread John Scoles

this might help
 
http://coding.derkeiler.com/Archive/Perl/perl.dbi.users/2006-12/msg00029.html> 
Subject: wrong ELF class:> Date: Tue, 1 Apr 2008 10:30:00 -0400> From: [EMAIL 
PROTECTED]> To: dbi-users@perl.org> CC: [EMAIL PROTECTED]> > > Please advice 
where I can find more information for the following error,> suggestions as to 
how to debug, or any insight.> > Test runs from command prompt and when 
scheduled by "at now", but not> cron > > Thank you in advance. > > > Your 
"cron" job on sun105z3> ./test_dbi.pl> > produced the following output:> > 
install_driver(Oracle) failed: Can't load> 
'/usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/DBD/Oracle/Oracl> e.so' 
for module DBD::Oracle: ld.so.1: perl: fatal:> 
/apps/oracle/10gR2/client/lib/libclntsh.so.10.1: wrong ELF class:> ELFCLASS64 
at /usr/local/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line> 230.> at (eval 
3) line 3> Compilation failed in require at (eval 3) line 3.> Perhaps a 
required shared library or dll isn't installed where expected> at ./test_dbi.pl 
line 50> > script & full output below...> > John W Moon> > #! 
/usr/local/bin/perl -W> use lib "$ENV{HOME}/local/library";> BEGIN {> $x=0;> 
foreach $b (@INC) {> print "\$INC[$x] = $b\n";> $x++;> }> foreach $b (sort keys 
%ENV) {> if ($b eq 'PATH') {> @path = split /:/, $ENV{PATH};> print "Path\n";> 
foreach $p (@path) {> print "\t$p\n";> }> }> else {> print "$b\t = 
\t$ENV{$b}\n";> }> }> require MyOracle;> &MyOracle();> }> use DBI;> print 
"<$DATABASE, $PASSWD, $INSTANCE>\n";> print "After \&MyOracle()\n";> $x=0;> 
foreach $b (@INC) {> print "\$INC[$x] = $b\n";> $x++;> }> foreach $b (sort keys 
%ENV) {> if ($b eq 'PATH') {> @path = split /:/, $ENV{PATH};> print "Path\n";> 
foreach $p (@path) {> print "\t$p\n";> }> }> else {> print "$b\t = 
\t$ENV{$b}\n";> }> } > > $con_str=q{dbi:Oracle:x};> $u_str=q{xx};> 
$p_str=q{xx};> $dbh=DBI->connect($con_str,$u_str,$p_str) or die 
DBI->errstr;> $sth=$dbh->prepare(q{select count(*) from [EMAIL PROTECTED]) or> 
die DBI->errstr;> $sth->execute or die DBI->errstr;> while 
(@row=$sth->fetchrow_array) {> print join(',',@row), "\n";> }> > > Your "cron" 
job on sun105z3> ./test_dbi.pl> > produced the following output:> > 
install_driver(Oracle) failed: Can't load> 
'/usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/DBD/Oracle/Oracl> e.so' 
for module DBD::Oracle: ld.so.1: perl: fatal:> 
/apps/oracle/10gR2/client/lib/libclntsh.so.10.1: wrong ELF class:> ELFCLASS64 
at /usr/local/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line> 230.> at (eval 
3) line 3> Compilation failed in require at (eval 3) line 3.> Perhaps a 
required shared library or dll isn't installed where expected> at ./test_dbi.pl 
line 50> $INC[0] = /export/home/billing/local/library> $INC[1] = 
/usr/local/lib/perl5/5.8.8/sun4-solaris> $INC[2] = /usr/local/lib/perl5/5.8.8> 
$INC[3] = /usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris> $INC[4] = 
/usr/local/lib/perl5/site_perl/5.8.8> $INC[5] = /usr/local/lib/perl5/site_perl> 
$INC[6] = .> HOME = /export/home/billing> LOGNAME = x> Path> /usr/bin> 
SHELL = /usr/bin/sh> TZ = US/Eastern> > After 
&MyOracle()> $INC[0] = /export/home/billing/local/library> $INC[1] = 
/usr/local/lib/perl5/5.8.8/sun4-solaris> $INC[2] = /usr/local/lib/perl5/5.8.8> 
$INC[3] = /usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris> $INC[4] = 
/usr/local/lib/perl5/site_perl/5.8.8> $INC[5] = /usr/local/lib/perl5/site_perl> 
$INC[6] = .> HOME = /export/home/billing> LD_LIBRARY_PATH => 
/apps/oracle/10gR2/client/lib32:/usr/local/lib:/usr/lib:/lib:/etc/lib> 
LD_LIBRARY_PATH_64 => 
/apps/oracle/10gR2/client/lib:/usr/local/lib:/usr/lib:/lib:/etc/lib> LOGNAME = 
xxx> ORACLE_HOME = /apps/oracle/10gR2/client> Path> /usr/bin> 
/apps/oracle/10gR2/client/bin> /apps/oracle/10gR2/client/opmn/bin> 
/usr/local/bin> /usr/ucb> /etc> /usr/local/lib/perl5/5.8.8/site_perl> 
/usr/local/lib/perl5/5.8.8> SHELL = /usr/bin/sh> TWO_TASK = xx> TZ = 
US/Eastern> > > http://dmspulsesurvey.myflorida.com/is> > > > > > 
_
Enter today for your chance to win $1000 a day—today until May 12th. Learn more 
at SignInAndWIN.ca
http://g.msn.ca/ca55/215

wrong ELF class:

2008-04-01 Thread Moon, John
 
Please advice where I can find more information for the following error,
suggestions as to how to debug, or any insight.

Test runs from command prompt and when scheduled by "at now", but not
cron 

Thank you in advance. 


Your "cron" job on sun105z3
./test_dbi.pl

produced the following output:

install_driver(Oracle) failed: Can't load
'/usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/DBD/Oracle/Oracl
e.so' for module DBD::Oracle: ld.so.1: perl: fatal:
/apps/oracle/10gR2/client/lib/libclntsh.so.10.1: wrong ELF class:
ELFCLASS64 at /usr/local/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line
230.
 at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at ./test_dbi.pl line 50

script & full output below...

John W Moon

#! /usr/local/bin/perl -W
use lib "$ENV{HOME}/local/library";
BEGIN {
$x=0;
foreach $b (@INC) {
print "\$INC[$x] = $b\n";
$x++;
}
foreach $b (sort keys %ENV) {
if ($b eq 'PATH') {
@path = split /:/, $ENV{PATH};
print "Path\n";
foreach $p (@path) {
print "\t$p\n";
}
}
else {
print "$b\t = \t$ENV{$b}\n";
}
}
require MyOracle;
&MyOracle();
}
use DBI;
print "<$DATABASE, $PASSWD, $INSTANCE>\n";
print "After \&MyOracle()\n";
$x=0;
foreach $b (@INC) {
print "\$INC[$x] = $b\n";
$x++;
}
foreach $b (sort keys %ENV) {
if ($b eq 'PATH') {
@path = split /:/, $ENV{PATH};
print "Path\n";
foreach $p (@path) {
print "\t$p\n";
}
}
else {
print "$b\t = \t$ENV{$b}\n";
}
} 

$con_str=q{dbi:Oracle:x};
$u_str=q{xx};
$p_str=q{xx};
$dbh=DBI->connect($con_str,$u_str,$p_str) or die DBI->errstr;
$sth=$dbh->prepare(q{select count(*) from [EMAIL PROTECTED]) or
die DBI->errstr;
$sth->execute or die DBI->errstr;
while (@row=$sth->fetchrow_array) {
print join(',',@row), "\n";
}


Your "cron" job on sun105z3
./test_dbi.pl

produced the following output:

install_driver(Oracle) failed: Can't load
'/usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/DBD/Oracle/Oracl
e.so' for module DBD::Oracle: ld.so.1: perl: fatal:
/apps/oracle/10gR2/client/lib/libclntsh.so.10.1: wrong ELF class:
ELFCLASS64 at /usr/local/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line
230.
 at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at ./test_dbi.pl line 50
$INC[0] = /export/home/billing/local/library
$INC[1] = /usr/local/lib/perl5/5.8.8/sun4-solaris
$INC[2] = /usr/local/lib/perl5/5.8.8
$INC[3] = /usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris
$INC[4] = /usr/local/lib/perl5/site_perl/5.8.8
$INC[5] = /usr/local/lib/perl5/site_perl
$INC[6] = .
HOME =  /export/home/billing
LOGNAME  =  x
Path
/usr/bin
SHELL=  /usr/bin/sh
TZ   =  US/Eastern

After &MyOracle()
$INC[0] = /export/home/billing/local/library
$INC[1] = /usr/local/lib/perl5/5.8.8/sun4-solaris
$INC[2] = /usr/local/lib/perl5/5.8.8
$INC[3] = /usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris
$INC[4] = /usr/local/lib/perl5/site_perl/5.8.8
$INC[5] = /usr/local/lib/perl5/site_perl
$INC[6] = .
HOME =  /export/home/billing
LD_LIBRARY_PATH  =
/apps/oracle/10gR2/client/lib32:/usr/local/lib:/usr/lib:/lib:/etc/lib
LD_LIBRARY_PATH_64   =
/apps/oracle/10gR2/client/lib:/usr/local/lib:/usr/lib:/lib:/etc/lib
LOGNAME  =  xxx
ORACLE_HOME  =  /apps/oracle/10gR2/client
Path
/usr/bin
/apps/oracle/10gR2/client/bin
/apps/oracle/10gR2/client/opmn/bin
/usr/local/bin
/usr/ucb
/etc
/usr/local/lib/perl5/5.8.8/site_perl
/usr/local/lib/perl5/5.8.8
SHELL=  /usr/bin/sh
TWO_TASK =  xx
TZ   =  US/Eastern

  
http://dmspulsesurvey.myflorida.com/is
 
 
 

 
 


Re: question for DBD-Oracle driver

2008-03-28 Thread John Scoles



[EMAIL PROTECTED] wrote:

Thank you so much for providing me this information.

After I try the command you provide, I got the following error message.

Can't load
'/opt/perl5/lib/site_perl/5.8.0/PARISC2.0/auto/DBD/Oracle/Oracle.sl' for
module DBD::Oracle: No such file or directory at
/opt/perl5/lib/5.8.0/PA-RISC2.0/DynaLoader.pm line 229.
 at test_dbd_ver.pl line 5
Compilation failed in require at test_dbd_ver.pl line 5.
BEGIN failed--compilation aborted at test_dbd_ver.pl line 5.

Any suggestions for this error.

Thanks
Icheng


  


The means you do not have DBD::Oracle installed

you will have to install it with CPAN or alike

Cheers
John Scoles

give this a try

#!perl -w

use DBI;
use DBD::Oracle qw(:ora_types);
print DBD::Oracle::ORA_OCI()."\n";



if you dbi is 1.47 you can use up to DBD::Oracle 1.19

cheers

John Scoles
[EMAIL PROTECTED] wrote:


Dear sir/madam,


How can we tell that we have already install DBD-Oracle drive for
DBI ?

If we have already install DBD-Oracle, how can we check what version it
is ?

We have the unix (HP-UX houux14 B.11.11 U 9000/800 196921507
unlimited-user license) installed, and
perl version ( v5.8.0 built for PA-RISC2.0) install and DBI (DBI version
is => 1.47), what version
DBD-Oracle driver we need to install ?


Thank you very much for answering my questions.

Icheng





  



  


Re: question for DBD-Oracle driver

2008-03-28 Thread John Scoles


give this a try

#!perl -w

use DBI;
use DBD::Oracle qw(:ora_types);
print DBD::Oracle::ORA_OCI()."\n";



if you dbi is 1.47 you can use up to DBD::Oracle 1.19

cheers

John Scoles
[EMAIL PROTECTED] wrote:

Dear sir/madam,


How can we tell that we have already install DBD-Oracle drive for DBI ?

If we have already install DBD-Oracle, how can we check what version it is ?

We have the unix (HP-UX houux14 B.11.11 U 9000/800 196921507
unlimited-user license) installed, and
perl version ( v5.8.0 built for PA-RISC2.0) install and DBI (DBI version
is => 1.47), what version
DBD-Oracle driver we need to install ?


Thank you very much for answering my questions.

Icheng




  


Re: What causes this 32 bit problem??

2008-03-20 Thread John Scoles
Well unfortunately I have not access to a HP 64bit machine so I have 
never been able to look into this myself so any

opinion I have will be of little use to you.

This will be changing soon I hope as I am due to get access to HP 64 box 
soon.


Any patch that you may come up with will be good. 

and I think they should not be running in 64bit mode of course I could 
be wrong on this. I have never looked into it.


Sorry I cannot be more help to you
Cheers
John Scoles

Richard T Malafa wrote:

John,
I've tested your DBD::Oracle 1.20 against both PA-RISC and Itanium 
Machines with the 32 bit versions of 5.8.8 perl. Those worked fine as I 
reported back to you.


As you know on the HP-UX machine you have both 32 and 64 bit versions and 
that includes static or dynamic modes.   It all depends on how it is set.  
Usually the 32 bit version revert to the PA 1.1 architecture and not the 
PA 2.0 architecture.


Now,  I have to have the PA 2.0 64 bit & dynamic perl used for your 
DBD::Oracle 1.20 running.   Nothing has chanced except to change the perl 
path to reflect 64 bit and dynamic..The gcc 4.2.2 is the same.   And 
the Oracle 10 g is the same.  And the HP-UX is still 11i Version 2.


I can change (in my environment) the export 
LD_LIBRARY_PATH=$ORACLE_HOME/baloneypie and it still reverts to:


ora01/app/oracle/product/10.2/lib:/lib/pa20_64

The most madding thing is that 32-bit link message.What 32-bit link??? 
  I did a file command on everything in the library links and they're all 
64 bit
as they're suppose to be.   Still trying to find it with the Perl 
Debugger.


[EMAIL PROTECTED]> file /ora01/app/oracle/product/10.2/lib/libclntsh.sl
/ora01/app/oracle/product/10.2/lib/libclntsh.sl:ELF-64 shared 
object file - PA-RISC 2.0 (LP64)

[EMAIL PROTECTED]>

I just used that as an example.  Of course you know that ld handles both 
32 and 64 bit code.


Should I start taking code out of the makefile do to with -shared 
static-libgcc ???   Or removing the  gcc -Wl,+b   or 

Making sure the stuff passed to gcc -Wl,+b$1  comes from a different 
place???


Or ?? 


Any other comment..   Is DBD::Oracle 1.20 suppose to run in 64 bit mode???

Wondering because during my first contact with you on DBD::Oracle 1.19   I 
had the exact same problem and error on HP UX v1 running in 64 bit.


Thank You and Cheers
Rich
p.s. fyi gcc 4.2.3 and the new 4.2.3 library just came out on the HP UX 
porting site


  sample error  during make.  never varies  ***

Running Mkbootstrap for DBD::Oracle ()
chmod 644 Oracle.bs
rm -f blib/arch/auto/DBD/Oracle/Oracle.sl
gcc -Wl,+b"/ora01/app/oracle/product/10.2/lib:/lib/pa20_64" 
-shared -static-libgcc -fPIC -L/lib/pa20_64 Oracle.o  dbdimp.o  oci8.o  -o 
blib/arch/auto/DBD/Oracle/Oracle.sl \
   -L/ora01/app/oracle/product/10.2/lib -lclntsh -lrt -lpthread 
-lnsl   \
 
/usr/ccs/bin/ld: /ora01/app/oracle/product/10.2/lib/libclntsh.sl: 
Mismatched ABI. 64-bit PA shared library found in 32-bit link.

collect2: ld returned 1 exit status
*** Error exit code 1


• '•..• '•. ><º> .• '•. .• '•. •. .• '•. ><º>
“Anything that doesn’t eat you today is saving you for tomorrow.”

Computer Sciences Corporation 
Registered Office: 2100 East Grand Avenue, El Segundo California 90245, 
USA

Registered in USA No: C-489-59


This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. 
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to 
any order or other contract unless pursuant to explicit written agreement 
or government initiative expressly permitting the use of e-mail for such 
purpose.



  


Re: perl DBI oracle and error ORA 06502

2008-03-20 Thread John Scoles
You might want to set the DB handles "LongReadLen" attribute to a higher 
values say 100 meg like this


dbh->{LongReadLen} = 100*1024*1024

and then give it a try,

That might work for you.

Cheers John Scoles


John Scoles wrote:
It could be in perl but if this is the case I would need the exact 
procedure, schema, some data and the exact perl code that calls it.


However to start please set the dbh->debug(6) before you call your 
code and send me the results. There might be

a var that Perl is croaking on and this is one way to see where it dies.
Again I do not hold out much hope for this as it is a Oracle error 
that is being returned not a DBI/DBD one.


I would also need  the name of and version your OS, perl, DBI, 
DBD::Oracle, The Oracle client you are running and the Oracle DB itself


cheers
John Scoles

Pompiliu wrote:

Thanks a lot John.
The problem is that this is a company code and data,
and I would have to go through 'legal' or get cover
from a director or higher to show them outside; great,
huh? -- insert heavy sarcasm here ;-)

I found what the error means though this does not help
because:

(a) Calling that particular package from sqlplus works
fine and I get lots more rows in the output.
(b) The problem shows in the perl code.

The perl code is written in the usual/generic way (see
the examples in CPAN and elsewhere). Basically I do a
connect, $dbh->func(10, 'dbms_output_enable');
prepare (with a string containing a call to a PL/SQL
package), bind params (2 of them), execute, and then
start getting results with dbms_output_get (which is
simply  DBMS_OUTPUT.GET_LINE underneath, according to
the doc).
I used DBI quite a bit before running
selects/inserts/updates (simple SQL) with DB2 and
Oracle, and it worked like a charm in all cases.

Pompiliu

--- John Scoles <[EMAIL PROTECTED]> wrote:

 

Ah yes the APPLE][ error for those of us who are old
enough to remember those things

here is what the error code means

*ORA-06502:* PL/SQL: numeric or value error
/string/
*Cause:* An arithmetic, numeric, string,
conversion, or constraint error occurred. For example, this error 
occurs if an

attempt is made to assign the value NULL to a variable declared NOT
NULL, or if an attempt is made to assign an integer larger than 99 to a
variable declared NUMBER(2).
*Action:* Change the data, how it is manipulated,
or how it is declared so that values do not violate constraints.


So I would first have a look at your data looks like
there is something in the PSQL of the packge dbms_output_get  that is
giving you the error.  In this case DBI and DBD::Oracle are simply
working as they should returning an error message from the database.

cheers
John Scoles
Pompiliu wrote:
   

Hi,

I am running DBI and Oracle DB; I am executing a
package and using   $dbh->func('dbms_output_get') as in
my $row;
while (($row = $dbh->func('dbms_output_get')))
{
print "$row\n";
}
if ($sth->err) {
print STDERR "ERROR: $DBI::errstr";
}
to pull the output; I did set   $dbh->func(10, 
'dbms_output_enable');

right after connect.
The problem is that I am getting only part of the
result and the error I am getting is ORA 06502.

Everything works fine up to here. How can I fix
  

this?
   

Please email.
Thanks. P


   
 

 
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs





  
 

Looking for last minute shopping deals?  Find them fast with Yahoo! 
Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
  


Re: perl DBI oracle and error ORA 06502

2008-03-19 Thread John Scoles
It could be in perl but if this is the case I would need the exact 
procedure, schema, some data and the exact perl code that calls it.


However to start please set the dbh->debug(6) before you call your code 
and send me the results. There might be
a var that Perl is croaking on and this is one way to see where it dies. 

Again I do not hold out much hope for this as it is a Oracle error that 
is being returned not a DBI/DBD one.


I would also need  the name of and version your OS, perl, DBI, 
DBD::Oracle, The Oracle client you are running and the Oracle DB itself


cheers
John Scoles

Pompiliu wrote:
Thanks a lot John. 


The problem is that this is a company code and data,
and I would have to go through 'legal' or get cover
from a director or higher to show them outside; great,
huh? -- insert heavy sarcasm here ;-)

I found what the error means though this does not help
because:

(a) Calling that particular package from sqlplus works
fine and I get lots more rows in the output.
(b) The problem shows in the perl code.

The perl code is written in the usual/generic way (see
the examples in CPAN and elsewhere). Basically I do a
connect, $dbh->func(10, 'dbms_output_enable');
prepare (with a string containing a call to a PL/SQL
package), bind params (2 of them), execute, and then
start getting results with dbms_output_get (which is
simply  DBMS_OUTPUT.GET_LINE underneath, according to
the doc). 


I used DBI quite a bit before running
selects/inserts/updates (simple SQL) with DB2 and
Oracle, and it worked like a charm in all cases.

Pompiliu

--- John Scoles <[EMAIL PROTECTED]> wrote:

  

Ah yes the APPLE][ error for those of us who are old
enough to remember 
those things


here is what the error code means

*ORA-06502:*PL/SQL: numeric or value error
/string/
*Cause:*An arithmetic, numeric, string,
conversion, or constraint 
error occurred. For example, this error occurs if an
attempt is made to 
assign the value NULL to a variable declared NOT
NULL, or if an attempt 
is made to assign an integer larger than 99 to a
variable declared 
NUMBER(2).

*Action:*   Change the data, how it is manipulated,
or how it is declared 
so that values do not violate constraints.



So I would first have a look at your data looks like
there is something 
in the PSQL of the packge dbms_output_get  that is
giving you the 
error.  In this case DBI and DBD::Oracle are simply
working as they 
should returning an error message from the database.


cheers
John Scoles
Pompiliu wrote:


Hi,

I am running DBI and Oracle DB; I am executing a
package and using 
  $dbh->func('dbms_output_get') 
as in

my $row;
while (($row = $dbh->func('dbms_output_get')))
{
print "$row\n";
}
if ($sth->err) {
print STDERR "ERROR: $DBI::errstr";
}
to pull the output; I did set 
  $dbh->func(10, 'dbms_output_enable');

right after connect.
The problem is that I am getting only part of the
result and the error I am getting is ORA 06502.

Everything works fine up to here. How can I fix
  

this?


Please email.
Thanks. P


 
  


  
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
  
  




  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
  


Re: Google SoC: Fame and Fortune ($4500) await you!

2008-03-19 Thread John Scoles
Yep sounds like a good Idea and I have been using Memcached for aout two 
years now with DBD::Oracle but not in the way
you are looking at it.  I can offer my help as well but you might want 
to look at DBI::Gofer as I think Tim's

plan was to make that compatible with memcached

Cheers
John Scoles

mikhail maluyk wrote:

I'm currently very interested in DBI related stuff, and have a few of my own
ideas, which i'll reveal for your judgement.

I'm thinking about creating a merge between DBI and memcached. So cache
would be handled automaticly and integration would be seamless. This idea
occured to me a few times, since i was writing web app's which took
advantege of memcached. I was always getting tired of manual cache
management, and if you are using some ORM, it even harder to manage cache
propely. With plain SQL you could do something like $cache->set($key ,
$value), and then $cache->get($key), where $key would be your SQL statement,
which work fine in most cases. But using Rose::DB::Object, with it's lazy
loading, could become a caching nightmare (I'm not advertising against
Rose::DB::Object, it's really beautiful peace of software). So i think i
explained general idea of it.
Also in addition to memcached, i was thinking about adding seamless
beanstalkd support, but it should be thought over.

So i'm waiting for your judgement, point me out if i'm loosing general
design in all my thoughts.


2008/3/19, Tim Bunce <[EMAIL PROTECTED]>:
  

The Perl Foundation is participating in Google's 2008 Summer of Code.

http://code.google.com/soc/2008/

This means Google will give "successful student contributors a 4500 USD
stipend, enabling them to focus on their coding projects for three
months."

"In order to participate in the program, you must be a student. [...]
enrolled in or accepted into an accredited institution including (but
not necessarily limited to) colleges, universities, masters programs,
PhD programs and undergraduate programs"

There's a page of key information and suggested Perl-related projects at

http://www.perlfoundation.org/perl5/index.cgi?gsoc2008_projects

Naturally I'm hoping to find someone interested in helping with
a DBI-specific project:


http://www.perlfoundation.org/perl5/index.cgi?gsoc2008_projects#common_test_suite_for_dbi_and_drivers

but there are plenty of other interesting and useful projects.


Tim.




  


Re: perl DBI oracle and error ORA 06502

2008-03-19 Thread John Scoles
Ah yes the APPLE][ error for those of us who are old enough to remember 
those things


here is what the error code means

*ORA-06502:*PL/SQL: numeric or value error /string/
*Cause:* 	An arithmetic, numeric, string, conversion, or constraint 
error occurred. For example, this error occurs if an attempt is made to 
assign the value NULL to a variable declared NOT NULL, or if an attempt 
is made to assign an integer larger than 99 to a variable declared 
NUMBER(2).
*Action:* 	Change the data, how it is manipulated, or how it is declared 
so that values do not violate constraints.



So I would first have a look at your data looks like there is something 
in the PSQL of the packge dbms_output_get  that is giving you the 
error.  In this case DBI and DBD::Oracle are simply working as they 
should returning an error message from the database.


cheers
John Scoles
Pompiliu wrote:

Hi,

I am running DBI and Oracle DB; I am executing a
package and using 
  $dbh->func('dbms_output_get') 
as in

my $row;
while (($row = $dbh->func('dbms_output_get')))
{
print "$row\n";
}
if ($sth->err) {
print STDERR "ERROR: $DBI::errstr";
}
to pull the output; I did set 
  $dbh->func(10, 'dbms_output_enable');

right after connect.
The problem is that I am getting only part of the
result and the error I am getting is ORA 06502.

Everything works fine up to here. How can I fix this?
Please email.
Thanks. P


  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
  


Re: Library not found errors with DBD-Oracle-1.20

2008-03-18 Thread John Scoles
Not 100% sure on you situation but one thing I know is that with the 
instant cleint some of the .so files have been smooched together into 
one file called


ibclntsh.so.10.1  so what you might try is set a symbolic link to that 
file like this


ln -s libclntsh.so ibclntsh.so.10.1

to get this when you la -a

libclntsh.so -> libclntsh.so.10.1

Just a thought
cheers john scoles

James H. McCullars wrote:
Hi, I have successfully installed the Oracle instant client, DBI-1.602 
and DBD-Oracle 1.20 and can connect to a database on a remote host, 
but only if I set LD_LIBRARY_PATH to the directory where the instant 
client is installed.  This is fine, but I need to do this from a CGI 
script, and setting the environment there does not work.  I know that 
there is a way to do this in Apache using a SetEnv statement, but I 
would prefer not to do that.  The problem is, the library should be 
found.  The message that is being logged is this:


install_driver(Oracle) failed: Can't load 
'/usr/local/lib/perl5/site_perl/5.8.7/sun4-solaris/auto/DBD/Oracle/Oracle.so' 
for module DBD::Oracle: ld.so.1: perl: fatal: libnnz10.so: open 
failed: No such file or directory at 
/usr/local/lib/perl5/5.8.7/sun4-solaris/DynaLoader.pm line 230.

 at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected

If I set ORACLE_HOME and LD_LIBRARY_PATH before doing the perl 
Makefile.PL and the make, then Oracle.so gets compiled like this:


LD_RUN_PATH="/usr/local/pkg/oracle-instant-client/instantclient_10_2" 
gcc  -G -L/usr/local/lib Oracle.o dbdimp.o oci8.o  -o 
blib/arch/auto/DBD/Oracle/Oracle.so 
-L/usr/local/pkg/oracle-instantclient/instantclient_10_2 -lclntsh


I then unset LD_LIBRARY_PATH and do an ldd command on Oracle.so, and 
it cannot find libnnz10.so:


bash-2.05$ ldd blib/arch/auto/DBD/Oracle/Oracle.so
libclntsh.so.10.1 => 
/usr/local/pkg/oracle-instant-client/instantclient_10_2/libclntsh.so.10.1

libc.so.1 => /usr/lib/libc.so.1
libnnz10.so =>   (file not found)
libkstat.so.1 => /usr/lib/libkstat.so.1
libnsl.so.1 =>   /usr/lib/libnsl.so.1
libsocket.so.1 =>/usr/lib/libsocket.so.1
libgen.so.1 =>   /usr/lib/libgen.so.1
libdl.so.1 =>/usr/lib/libdl.so.1
libsched.so.1 => /usr/lib/libsched.so.1
libaio.so.1 =>   /usr/lib/libaio.so.1
librt.so.1 =>/usr/lib/librt.so.1
libm.so.1 => /usr/lib/libm.so.1
libmp.so.2 =>/usr/lib/libmp.so.2
libmd5.so.1 =>   /usr/lib/libmd5.so.1
/usr/platform/SUNW,UltraAX-i2/lib/libc_psr.so.1
/usr/platform/SUNW,UltraAX-i2/lib/libmd5_psr.so.1

Even if I manually recompile Oracle.so adding a -R parameter with the 
location of the Oracle libraries, it the ldd command will not locate 
the library:


bash-2.05$ gcc  -G -L/usr/local/lib Oracle.o dbdimp.o oci8.o  -o 
blib/arch/auto/DBD/Oracle/Oracle.so

-L/usr/local/pkg/oracle-instant-client/instantclient_10_2
-R/usr/local/pkg/oracle-instant-client/instantclient_10_2 -lclntsh
bash-2.05$ ldd blib/arch/auto/DBD/Oracle/Oracle.so libclntsh.so.10.1 
=> 
/usr/local/pkg/oracle-instant-client/instantclient_10_2/libclntsh.so.10.1

libc.so.1 => /usr/lib/libc.so.1
libnnz10.so =>   (file not found)
libkstat.so.1 => /usr/lib/libkstat.so.1
libnsl.so.1 =>   /usr/lib/libnsl.so.1
libsocket.so.1 =>/usr/lib/libsocket.so.1
libgen.so.1 =>   /usr/lib/libgen.so.1
libdl.so.1 =>/usr/lib/libdl.so.1
libsched.so.1 => /usr/lib/libsched.so.1
libaio.so.1 =>   /usr/lib/libaio.so.1
librt.so.1 =>/usr/lib/librt.so.1
libm.so.1 => /usr/lib/libm.so.1
libmp.so.2 =>/usr/lib/libmp.so.2
libmd5.so.1 =>   /usr/lib/libmd5.so.1
/usr/platform/SUNW,UltraAX-i2/lib/libc_psr.so.1
/usr/platform/SUNW,UltraAX-i2/lib/libmd5_psr.so.1

But the file is definitely there:

bash-2.05$ ls -la 
/usr/local/pkg/oracle-instant-client/instantclient_10_2/libnnz10.so
-rwxr-xr-x   1 jim  100  6135928 Dec 20  2006 
/usr/local/pkg/oracle-instant-client/instantclient_10_2/libnnz10.so


Does anyone have any idea why the library file is not being found at 
runtime without LD_LIBRARY_PATH?  It almost seems as if once the 
oracle-install-client directory is searced once, it will not search it 
again.  I know there are possible workarounds (like symlinking all 
those files to /usr/lib, or maybe setting the environment in Apache), 
but I would prefer to get this working with as few system changes as 
possible.  This is Solaris 9 and gcc 3.1.  Thanks...


Jim McCullars
University of Alabama in Huntsville



Re: Accessing Remote LOBs in Oracle

2008-03-06 Thread John Scoles
What I am going to need is some detailed code examples of what you want 
to do.


SQL, DATA perl examples etc and of course the SQL to generate the tables 
fields etc.



If you are using the 10.2.0 client that should be the same version as in 
you link and should be able to do it.  There are some limits of course 
as outlined in the doc.


The only problem I see is that I only have a 10ex oracle db to play with 
so I might not be able to do a link between two databases using link (at 
least not easily)


cheers

Eric Simon wrote:

Wow, thanks!  I am confident that we are running at least the 10.2.0 client, 
but as far as getting the OCI client version (if that's
different), I'm not sure...
 
  


RE: Accessing Remote LOBs in Oracle

2008-03-06 Thread John Scoles

I am in the middle of the next DBD::Oracle release  I might be able to get it 
in in a week or so if you want it there.
 
Does not look too complicated but I am not sure which OCI client you have to 
use.
 
Let me have a quick look at it this AM and get back to you later today.
 
You could try writing it youself but OCI is not something you can pick up in 
5min.  I been working in it for two years now and I still know nothing.
 
cheers
John Scoles
> From: [EMAIL PROTECTED]> To: dbi-users@perl.org> Subject: RE: Accessing 
> Remote LOBs in Oracle> Date: Wed, 5 Mar 2008 16:19:42 -0600> > I'm barely 
> familiar with stored procedures. How would you leverage a stored procedure 
> here? Would it be to create an actual table> in db2 and have a stored 
> procedure update a mirrored table in db1?> > Also, I'm paranoid about the 
> stored procedure introducing more overhead, as I am moving LOB data 
> frequently in and out of these> tables.> > > -Original Message-> 
> From: Ian Harisay [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 05, 2008 
> 3:06 PM> To: dbi-users@perl.org> Subject: RE: Accessing Remote LOBs in 
> Oracle> > Have you tried handling this thru a stored procedure? I think that 
> would make the database link transparent to you.> > -Original 
> Message-> From: Eric Simon [mailto:[EMAIL PROTECTED]> Sent: Wednesday, 
> March 05, 2008 1:13 PM> To: dbi-users@perl.org> Subject: Accessing Remote 
> LOBs in Oracle> > Hi,> > Has anyone else needed to write into LOB columns on 
> remote Oracle databases through a database link (created by the Oracle 
> statement> 'CREATE PUBLIC DATABASE LINK ...'). For example, we have this:> > 
> In Instance 1: (db1)> > CREATE TABLE foo (> a 
> NUMBER(10),> b CLOB> );> > In Instance 2: (db2)> > CREATE 
> SYNONYM foo FOR [EMAIL PROTECTED];> > Our Perl script creates a database 
> handle connected to db2 and tries to insert values into foo (which, because 
> it is a synonym will> insert the values into the foo table on db1), but fails 
> with the following error:> > Fatal: DBD::Oracle::st execute failed: 
> ORA-22992: cannot use LOB locators> selected from remote tables (DBD ERROR: 
> error possibly near <*> indicator> at char 36 in 'INSERT INTO foo (a,b) 
> VALUES (:p1,:<*>p2)') [for Statement> "INSERT INTO foo (a,b) VALUES 
> (:p1,:p2)" with ParamValues: :p1='1',:p2=undef]> > As of Oracle 10gR2, Oracle 
> claims to provide the facility to access remote LOBs through OCI (and they 
> provide a code example):> > 
> http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14249/adlob_data_interface.htm#CACIFCJF>
>  > Is there anyone capable of incorporating this new facility into 
> DBD::Oracle? I'm new to this package, but I could try if I was> pointed in 
> the right direction. Thanks!!> > --> Eric Simon> 
_



Re: Using to_dsinterval or INTERVAL with placeholder

2008-02-12 Thread John Scoles

Well maybe DBD::Oracle dose not know how to bind them,

Set the debug to 15 before the prepare statement and off after the binds 
and lets see what you get.


these are very obscure Oracle types so I could see that they may not work.

cheers
John Scoles



Vanole, Mike wrote:

Thanks Joseph,

I chickened out and built the full insert statement I knew would run and
ran it in a do().

I will goof around with bind_param, but I would love to know how to do
this with '?' style placeholders. There's got to be a syntax that works
- that will load INTERVAL DAY to SECOND

Mike


-Original Message-
From: Lamb Joseph [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 12, 2008 10:42 AM

To: dbi-users@perl.org
Subject: Re: Using to_dsinterval or INTERVAL with placeholder

Mike,

Here are some of the things that I would do.
1. Set the NLS Date Format

Example I pulled from the internet

# set Oracle NLS date format


if ( $optctl{dateformat} ) {


$dbh->do(qq{alter session set nls_date_format

= '$optctl{dateformat}'} );


}

2. Using bind_param set all your parameters. I usually have problem
using placeholders when I am inserting strings into Oracle. I really do
not know why.

3. I do all my calculation and date manipulations locally. For example,
calculate the hour to minute before insert. Format the date to the NLS
Format before inserting.

Hope this helps.
 
Joseph Lamb


- Original Message 
From: "Vanole, Mike" <[EMAIL PROTECTED]>
To: dbi-users@perl.org
Sent: Tuesday, February 12, 2008 8:17:28 AM
Subject: Using to_dsinterval or INTERVAL with placeholder


This 
may 
be 
less 
a 
DBI 
question 
and 
more 
Oracle 
- 
probably 
both...


Using 
DBD::Oracle


Given 
this 
table:


TABLE 
batch_application_sla
 
Name  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
Null?  
  
Type


 
- 



 
ASSOCIATION  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
VARCHAR2(100)


 
SLA  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
INTERVAL 
DAY(2) 
TO

SECOND(6)
 
DISPLAY  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
CHAR(1)


 
SUMMARY_DISPLAY  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
CHAR(1)


 
LOAD_STATUS  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
VARCHAR2(20)


 
PROCESS_DATE  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
DATE


 
DESCRIPTION  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
VARCHAR2(300)


 
SLA_DISP  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
CHAR(1)


 
SLA_ADD_DAYS  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
NUMBER  
  
  
  
  
  
 



I 
can 
insert 
a 
row 
as 
follows:


insert 
into 
batch_application_sla 
values('YYY',interval 
'23:32' 
HOUR 
to

MINUTE,'y','y','COMPLETE',to_date('2008/01/01',
'/MM/DD'),'TEST','y',0)

How 
can 
I 
use 
placeholders? 
I'm 
getting 
various 
errors 
with 
the
INTERVAL. 
This 
is 
one 
version:


INSERT 
into 
batch_application_sla
values(?,to_dsinterval(?,'HH:MI' 
HOUR 
to 
MINUTE),?,?,?,to_date(?,

'/MM/DD'),?,?,?)

The 
source 
data 
I'm 
loading 
is 
in 
"HH:MI" 
format, 
but 
I 
can 
transform 
it
into 
anything. 

I've 
also 
tried:


INSERT 
into 
batch_application_sla
values(?,INTERVAL 
? 
HOUR 
to 
MINUTE,?,?,?,to_date(?, 
'/MM/DD'),?,?,?)


Many 
thanks,

Mike





 



Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
  


RE: I want to install couple of package in my windows machine.

2008-02-09 Thread John Scoles

Best to use Active state perl and thier PPM program. Quick free and easy to 
use. 
> Subject: I want to install couple of package in my windows machine.> Date: 
> Fri, 8 Feb 2008 18:32:10 +0530> From: [EMAIL PROTECTED]> To: 
> dbi-users@perl.org> > > > > Hello,> > Here I am using windows operating 
> system and database as a oracle.> Please can u tell me in windows how to 
> install Perl packages.> > I need some detailed documents to install this 
> packages in my machine.> > > > Please help me> > > > If from installation is 
> to be carried out from PPM then please tell me> how to configure this PPM 
> correctly so that this ppm can take the> packages from respective site and 
> can install that package in my> machine.> > > > Regards,> > shafi> > > > > > 
> > > > > > > This message contains information that may be privileged or 
> confidential and is the property of the Capgemini Group. It is intended only 
> for the person to whom it is addressed. If you are not the intended 
> recipient, you are not authorized to read, print, retain, copy, disseminate, 
> distribute, or use this message or any part thereof. If you receive this 
> message in error, please notify the sender immediately and delete all copies 
> of this message.
_



RE: DBD-Oracle 1.20 - problems compiling on Windows (Visual Studio 2005 & Perl 5.10)

2008-02-02 Thread John Scoles

Unfortunately that would be unlawful. Oracle does not allow 3rd parties to 
bundle their software.  
Check out the Readmewin.txt it has a very good tutorial on how to compile for 
windows.
 
> Subject: DBD-Oracle 1.20 - problems compiling on Windows (Visual Studio 2005 
> & Perl 5.10)> Date: Fri, 1 Feb 2008 12:47:18 -0800> From: [EMAIL PROTECTED]> 
> To: dbi-users@perl.org> > Hi,> > > > > > If anyone has a pre-built DBD-Oracle 
> for Windows (XP/Pro)/Perl 5.10,> would love to have it.> > > > R > > > > 
> -> 
> *>
>  Notice: This e-mail, including any attachment(s), is confidential and 
> intended solely for the above named individual(s). It constitutes non-public 
> information and may contain information subject to certain legal privileges. 
> If you are the intended recipient, your use of any confidential or personal 
> information may be restricted by federal and state privacy laws. Any use of 
> this communication by others is strictly prohibited and may be unlawful. If 
> you have received this e-mail in error, please notify me immediately by 
> replying to sender and delete this e-mail and any attachment(s). Thank you.> 
> *>
>  -> 
_



Re: DBI-DBD::ORACLE EROR

2008-01-29 Thread John Scoles
There are part of the Oracle client.  Sending them to you will not help 
you problem, and only break numerous copyright laws,
If you do not have them then you are missing your Oracle client or you 
path/enlivenment is not pointing to the correct directory.


If you do not have a copy of the Oracle client go to the Oracle website 
and download the Instantclient and use that one instead.


check out the README.64bit.txt and the README.hpux.txt read mes  they 
have very good instructions on what to do.


Mohammed, Shafi wrote:

I need following files.

Please give me these files.
It will helpful for me

cpp: "Oracle.h", line 37: error 4036: Can't open include file 'oci.h'.

cpp: "Oracle.h", line 39: error 4036: Can't open include file
'ocidfn.h'.

cpp: "Oracle.h", line 40: error 4036: Can't open include file 'orid.h'.

cpp: "Oracle.h", line 41: error 4036: Can't open include file 'ori.h'.

I need this files.

Regards,
Mohammed Shafi|Capgemini | Bengalooru
Main: +91 80 66567000|Extn: 4264
[EMAIL PROTECTED]
Join the Collaborative Business Experience at www.capgemini.com

-Original Message-
From: Alexander V Alekseev [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 29, 2008 6:56 PM

To: John Scoles
Cc: Mohammed, Shafi; dbi-users@perl.org
Subject: Re: DBI-DBD::ORACLE EROR

Hello!

On Tue, 29 Jan 2008, John Scoles wrote:

  

It would be nice to see the output for the Makefile.PL as well

Looks like either one of few things

1) you do not have the full oracle 9 client installed
2) you do not have the ORACLE_HOME= or  LD_LIBRARY_PATH set correctly
3) you do not have execute permissions on the *.h  files



You mean read permissions, don't you?

Bye. Alex.

This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


  


Re: DBI-DBD::ORACLE EROR

2008-01-29 Thread John Scoles

It would be nice to see the output for the Makefile.PL as well

Looks like either one of few things

1) you do not have the full oracle 9 client installed
2) you do not have the ORACLE_HOME= or  LD_LIBRARY_PATH set correctly
3) you do not have execute permissions on the *.h  files

Have a look at the README.linux.txt and try some of the suggestions 
there as well


cheers
John Scoles
Mohammed, Shafi wrote:

Hello ,

 


Now I want to use DBI for my current project.

Here I have trying to install DBD::ORACLE PACKAGE it is thronging error.
And it is now allowing to install this package.

 


Please help us in installing this package.

 


Please tell me what are the steps to be taken care while installing this
packages.

 


I am getting following error while installing this package.

 

 


While executing the perl Makefile.PL is getting executed  and the make
is failing with the following error.

# make

cp Oracle.pm blib/lib/DBD/Oracle.pm

cp mkta.pl blib/lib/DBD/mkta.pl

cp oraperl.ph blib/lib/oraperl.ph

cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h

cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h

cp Oraperl.pm blib/lib/Oraperl.pm

cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h

cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm

cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm

/usr/bin/perl -p -e "s/~DRIVER~/Oracle/g"
/opt/perl_32/lib/site_perl/5.8.8/PA-RISC1.1-thread-multi/auto/DBI/Driver
..xst > Oracle.xsi

/usr/bin/perl /opt/perl_32/lib/5.8.8/ExtUtils/xsubpp  -typemap
/opt/perl_32/lib/5.8.8/ExtUtils/typemap -typemap typemap  Oracle.xs >
Oracle.xsc && mv Oracle.xsc Oracle.c

cc -c  -I/opt/app/oracle/product/9.2.0.6/rdbms/demo -I.
-I/opt/app/oracle/product/9.2.0.6/precomp/public
-I/opt/app/oracle/product/9.2.0.6/rdbms/public
-I/opt/app/oracle/product/9.2.0.6/rdbms/demo
-I/opt/app/oracle/product/9.2.0.6/plsql/public
-I/opt/app/oracle/product/9.2.0.6/network/public
-I/opt/perl_32/lib/site_perl/5.8.8/PA-RISC1.1-thread-multi/auto/DBI
-D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE
-Wl,+vnocompatwarnings +Z -DUSE_SITECUSTOMIZE -DNO_HASH_SEED
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fast +Onolimit
+Opromote_indirect_calls +DAportable +DS2.0-DVERSION=\"1.20\"
-DXS_VERSION=\"1.20\" +Z
"-I/opt/perl_32/lib/5.8.8/PA-RISC1.1-thread-multi/CORE"  -DUTF8_SUPPORT
-DNEW_OCI_INIT -DORA_OCI_VERSION=\"9.2.0.6\" Oracle.c

cpp: "Oracle.h", line 37: error 4036: Can't open include file 'oci.h'.

cpp: "Oracle.h", line 39: error 4036: Can't open include file
'ocidfn.h'.

cpp: "Oracle.h", line 40: error 4036: Can't open include file 'orid.h'.

cpp: "Oracle.h", line 41: error 4036: Can't open include file 'ori.h'.

*** Error exit code 1

 


Stop.

 

 

 


I am waiting for your reply.

 


I have Perl version V5.8.8

DBI version is 1.51

 




This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

  


Re: Silly Question

2008-01-28 Thread John Scoles

Ok Thanks for that,

Cheers
John Scoels

Patrick Galbraith wrote:

John Scoles wrote:


Who is the current maintainer of DBD::MySQL??


John,

I am.

regards,

Patrick



Silly Question

2008-01-28 Thread John Scoles

Who is the current maintainer of DBD::MySQL??


Re: Oracle procedure raises exception but looks to be successful from DBI

2008-01-25 Thread John Scoles

I sort if expected that for the exec it is usualy only used withing SP
perhaps

"begin; exec(user.package.proctest(?)); end; "  ?? who knows


The next error is usually a permission problem on the Oracle side. 
Either the use who is calling the SP dose not have execute permission 
for the package or something in the package (hard to debug that) or the 
present state of the package is stopping you from executing it.


you might want to try

GRANT execute  to the package


The fact that DBD is returning the error from Oracle usually means that 
DBD is running correctly.


Cheers

Martin Evans wrote:

John Scoles wrote:

Wow I go one right for once.

Not 100% sure on why that is? Me thinks when you use 'Begin End' it 
forces OCI to take it as an pseudo 'stored procedure' and runs in the 
current OCI client.


I think using call just executes as a thread off the present client 
and in the background someplace??


You might want to try 'exec proctest(?); '


Doesn't work:

DBD::Oracle::st execute failed: ORA-00900: invalid SQL statement (DBD 
ERROR: OCIStmtExecute) [for Statement "exec proctest(?)" with 
ParamValues: :p1=99] at procfail.pl line 17.



I think it does it in the local client.

Will have to crack open the OCI  docs to see and  as I am not 
suffering from insomnia right now I have no real want to start 
digging though it right now.


Cheers


Your solution with begin/end works for:

begin proctest(?); end;

but does not work for:

begin user.package.proctest(?); end;

DBD::Oracle::st execute failed: ORA-06550: line 1, column 11:
PLS-00302: component 'PACKAGE' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored (DBD ERROR: error possibly near <*> 
indicator at char 10 in 'begin user.<*>package.proctest(:p1); end;') 
[for Statement "begin user.package.proctest(?); end;" with 
ParamValues: :p1=99] at procfail.pl line 17.


Any idea how to call a procedure in a package in a particular uses 
schema because that would be a complete solution for me then?


Martin


Re: Oracle procedure raises exception but looks to be successful from DBI

2008-01-25 Thread John Scoles

Wow I go one right for once.

Not 100% sure on why that is? Me thinks when you use 'Begin End' it 
forces OCI to take it as an pseudo 'stored procedure' and runs in the 
current OCI client.


I think using call just executes as a thread off the present client and 
in the background someplace??


You might want to try 'exec proctest(?); '

I think it does it in the local client.

Will have to crack open the OCI  docs to see and  as I am not suffering 
from insomnia right now I have no real want to start digging though it 
right now.


Cheers

Martin Evans wrote:

John Scoles wrote:
That is an odd one,  I will check with the DBAs here to see if this 
is normal Oracle behavior



Well the error id correct but and on my box an error is thrown that I 
catch


I did change my code over to

"begin track.proctest(?) end;"

what version of DBI and DBD are you using??

cheers




Thanks for the reply John.

I am using Oracle XE, DBI 1.59 and DBD::Oracle 1.19.

I changed my sql to "begin proctest(?); end;" and lo and behold I get 
an error:


$ perl procfail.pl
DBD::Oracle::st execute failed: ORA-01403: no data found
ORA-06512: at "XXX.PROCTEST", line 4
ORA-06512: at line 1 (DBD NO_DATA: OCIStmtExecute) [for Statement 
"begin proctest(?); end;" with ParamValues: :p1=99] at procfail.pl 
line 17.


Any idea why that is? Is it something to do with those tests in 
DBD::Oracle (dbdimp.c) for whether the statement is a select or not or 
perhaps because DBD::Oracle recognises this as a procedure call now.


I can change to put begin/end around procedure calls but I'd like to 
know why this is required.


Martin


Re: Oracle procedure raises exception but looks to be successful from DBI

2008-01-25 Thread John Scoles
That is an odd one,  I will check with the DBAs here to see if this is 
normal Oracle behavior



Well the error id correct but and on my box an error is thrown that I catch

I did change my code over to

"begin track.proctest(?) end;"

what version of DBI and DBD are you using??

cheers



Martin Evans wrote:

Hi,

I've just spent a long time tracking down a bug in an Oracle procedure 
because DBI's execute method returned success even though the 
procedure raised an exception. Shouldn't exceptions raised in 
procedures cause execute to fail?


Here is an example:

use DBI;
use strict;
use warnings;

my $h = DBI->connect("xxx","xxx","xxx",{RaiseError=>1,PrintError=>1});
eval {$h->do("drop table test");};
$h->do("create table test (a integer)");
$h->do(q{create or replace procedure proctest(vv integer) as
x integer;
begin
select a into x from test where a = vv;
end;});

my $s = $h->prepare("call proctest(?)");
$s->bind_param(1, 99);
my $y = $s->execute;
print "$y\n";
print $s->err(), $s->errstr(), $s->state(), "\n";

which outputs:

0E0
Use of uninitialized value in print at procfail.pl line 19.
Use of uninitialized value in print at procfail.pl line 19.

If I run exactly the same procedure from sqlplus I get an error:

SQL> execute proctest(99);
BEGIN proctest(99); END;

*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at "BET.PROCTEST", line 4
ORA-06512: at line 1

If I replace the procedure with a single call to 
raise_application_error execute does fail.


I admit there is a bug in the procedure causing the exception which 
should have been caught but I was very surprised to find an exception 
in this procedure did not cause execute to fail.


Any ideas or suggestions.

Martin


Re: Does changing ORACLE_HOME affect DBI?

2008-01-18 Thread John Scoles

Long answer Yes with a maybe; Short answer No with a But.

All joking aside it would be a good idea to recompile DBD::Oracle when 
you Oracle home changes only because this usually means they (DBAs,SAs) 
have changed the client, Version or something else in your Oracle. So to 
keep everything in sync I would recompile.


That being said once DBD::Oracle is compiled is should be somewhat stand 
alone and not rely on the oracle client directly anymore.  So changing 
the the Home shouldn't matter.


Cheers John Scoels

RICHARD FERNANDEZ wrote:

Hello folks,

A while back (months and months, in fact) I was asked to install DBI for
use with an Oracle database. As part of the install I remember that I
was asked for the value of things like ORACLE_HOME and some others.

Today I'm told that they want to move ORACLE_HOME to someplace else on
the same box.

My question is:

Does moving ORACLE_HOME mean that I need to recompile DBI, or was that
information only used for testing during the install?

I've never used it myself, so it's kind of a black box. Any hints, docs,
etc would be appreciated.

Thanks much.

BTW, I'm not on the list, so if you could reply to this address (as well
as the list, of course) I would appreciate it. Thanks!

richf
  


Re: Which versions to use

2008-01-11 Thread John Scoles
Myself I would go with the latest version of both but unfortunately now 
you have opened a new kettle of fish as there is no workable precompiled 
binary distribution for windows.  From about DBD::Oracle  1.16 onwards  
you  will need to compile it yourself as Oracle does not allow 3rd 
parties to redistribute their binaries.  On can use the instant client 
from oracle if you do not have an Oracle DB.


If you look at the README.win32.txt in the DBD::ORACLE distribution 
there is a good tutorial on how to compile it yourself, allot of 
downloading I'm afraid, and you have to use Microsoft Visual C++ toolkit 
2003, not supported anymore by MS but the links to a mirror of it are 
still good.  I have just recently looked it over again and all the links 
and instructions are still current.


If you go to Activestate and use their PPM you might be able to get a 
hold of an earlier DBD::Oracle binary 1.16?? which could work for you.


Cheers
John Scoles


COUPRIE Kees wrote:

So finally, after struggling with DBD 1.48 and DBI-Oracle 1.12 for some time, I 
now have permission to upgrade to newer versions.

Newby question: which versions should I use. Is it advisable to use the latest version of both or should I stick to certain 
combinations and/or older versions?


For what it's worth, I'm an a WIN32 box without any compilers (sigh) so I'm 
stuck with precompiled binary distributions.

Thanks in advance,
Kees Couprie
  


Re: Using q() to define a query

2008-01-11 Thread John Scoles
I beleive most SQL parsers will ignore white space like that in an SQL 
query.  Normally single quotes in parameters are the bug bear of the the 
SQL programmer,


ie

select name,rank,ser_no from sailors where name = O'Tool

It is alway good practice to use parameterized queries instead that you 
prepared first


   my $sql="select name,rank,ser_no from sailors where name =:name";
   my $c=$db->prepare($sql);
   $c->bind_param(":name","O'Tool");
   $c->execute();

or
   my $sql="select name,rank,ser_no from sailors where name =?";
   my $c=$db->prepare($sql);
   $c->execute("O'Tool");


as DBI and DBD driver will take care of the quotes for you and it 
prevents any SQL injection attacks on your app.


Cheers

Colin Wetherbee wrote:

Greetings.

I have a DBI (DBD::Pg) application I'm building in mod_perl.  My 
queries tend to look something like the following.


  my $sql = q(SELECT departure_date, eq.name AS equipment,
dp.full_city AS departure_city, ap.full_city AS arrival_city,
ca.name AS carrier_name, number
FROM jsjourneys
FULL OUTER JOIN jscarriers AS ca ON jsjourneys.carrier = ca.id
FULL OUTER JOIN jsequipment AS eq ON jsjourneys.equipment = eq.id
JOIN jsports AS dp ON jsjourneys.departure_port = dp.id
JOIN jsports AS ap ON jsjourneys.arrival_port = ap.id
ORDER BY departure_date);

And, then, I execute them as follows.

  $dbh->selectall_arrayref($sql, { Slice => {} });

Which works quite well.

However, I'm concerned about $sql because when I output it to Apache's 
debug log, it looks like this:


[Fri Jan 11 03:49:09 2008] [debug] Log.pm(36): [client 192.168.171.80] 
[JetSet] SELECT departure_date, eq.name AS equipment,\n dp.full_city 
AS departure_city, ap.full_city AS arrival_city,\n ca.name AS 
carrier_name, number\n  FROM jsjourneys\n  FULL OUTER JOIN 
jscarriers AS ca ON jsjourneys.carrier = ca.id\n  FULL OUTER JOIN 
jsequipment AS eq ON jsjourneys.equipment = eq.id\n  JOIN jsports 
AS dp ON jsjourneys.departure_port = dp.id\n  JOIN jsports AS ap 
ON jsjourneys.arrival_port = ap.id\n  ORDER BY departure_date


Notice the newline characters in there.  If those were really in the 
query, I can't imagine the database would run it, so I suppose they're 
an artifact of the combination of using q() to quote my query and 
using Apache's logger to output it.


All this leads up to a pretty simple question: is using q() to quote 
my queries a bad thing, and/or will it cause trouble in the future?


(As an aside, how do you guys quote your queries?  I find that for 
anything longer than about 60 characters, q() and '' and everything 
else start to look horribly inelegant.)


Thanks.

Colin


RE: Segmentation Fault(Core dumped)

2008-01-08 Thread John Scoles

check out the readmes file that comes with DBD::Oracle 
http://svn.perl.org/modules/dbd-oracle/trunk/README it has good instructions 
there.  Not sure what your OS and enviornment settings are so I can't be that 
specific.
 
but in six lines
 
1) Ensure Perl, and DBI are installed and you have  gcc compiler on you box
2) go to the DBD::Oracle dir 
3) type 'perl Makefile.PL'
4) then 'make'
5) then 'make test'
6) then 'make install'
 


Subject: RE: Segmentation Fault(Core dumped)Date: Tue, 8 Jan 2008 12:37:44 
+From: [EMAIL PROTECTED]: [EMAIL PROTECTED]; [EMAIL PROTECTED]: 
dbi-users@perl.org; [EMAIL PROTECTED]



John/All,
 
Can you pls share steps to re compile the DBD::Oracle module.
 
we have perl 5.8.6 installed on separate path and I am not using the libraries 
under the oracle client (10.2.0) installation. Can you pls let me know how I 
can recompile DBD module from its path.
 
Thanks
Vijay


-Original Message-From: John Scoles [mailto:[EMAIL PROTECTED] Sent: 07 
January 2008 23:08To: Kasi, Vijay (London); Martin GaintyCc: 
dbi-users@perl.org; [EMAIL PROTECTED]: RE: Segmentation Fault(Core dumped)You 
can try the -w or anything else you fancy it will not help. As Peter said it is 
plain and simple. You change your Oracle Database client you will have to 
recompile DBD::Oracle. Sorry this is just the nature of the beast no way around 
it. Just as an aside there is usually no gain in speed (or anything else for 
that matter really) in updating the Oracle drivers. John Scoles> Subject: RE: 
Segmentation Fault(Core dumped)> Date: Mon, 7 Jan 2008 16:51:58 +> From: 
[EMAIL PROTECTED]> To: [EMAIL PROTECTED]> CC: dbi-users@perl.org; [EMAIL 
PROTECTED]> > Martin,> > I have executed script with -w option and got below 
result.> > Scalar value @results{$fields} better written as $results{$fields} 
at> ./ETDHUB_NSE_REUTERS_DQ_REPORT.pl line 50.> Scalar value 
@results1{$fields1} better written as $results1{$fields1}> at 
./ETDHUB_NSE_REUTERS_DQ_REPORT.pl line 83.> Segmentation Fault (core dumped)> > 
Thanks> Vijay> > > > -Original Message-> From: Martin Gainty 
[mailto:[EMAIL PROTECTED] > Sent: 07 January 2008 16:24> To: Kasi, Vijay 
(London)> Subject: RE: Segmentation Fault(Core dumped)> > > Vijay-> > > 
http://www.oracle-base.com/articles/misc/WebScriptingForOracle.php#perl> can 
you enable diagnostics with -w> > 
#!/u01/app/oracle/product/10.1.0/db_1/perl/bin/perl -w> > curious if you 
obtained the perl drivers from oracle or cpan?> > Cheers (from across the 
pond)> Martin > > __> Disclaimer 
and confidentiality note> Everything in this e-mail and any attachments relates 
to the> official business of Sender. This transmission is of a confidential> 
nature and Sender does not endorse distribution to any party other than> 
intended recipient. Sender does not necessarily endorse content> contained 
within this transmission.> > > > Subject: RE: Segmentation Fault(Core dumped)> 
> Date: Mon, 7 Jan 2008 15:02:41 +> > From: [EMAIL PROTECTED]> > To: [EMAIL 
PROTECTED]> > CC: dbi-users@perl.org> > > > Robert,> > > > The code was running 
fine when I have used Oracle 9.2.0> version, we have> > changed oracle client 
path to 10.2.0 (32 bit libraries) this> morning and> > it started failing 
since.> > > > When I try to execute any perl script, its not givin any info> on 
failure> > except a single line error message (' Segmentatino Fault (core> 
dumped)'> > > > Pls advise.> > > > Thanks> > Vijay> > > > -Original 
Message-> > From: Robert Roggenbuck [mailto:[EMAIL PROTECTED] > > Sent: 07 
January 2008 14:57> > To: Kasi, Vijay (London)> > Cc: dbi-users@perl.org> > 
Subject: Re: Segmentation Fault(Core dumped)> > > > > > Please give us some 
more information. Can You figure out where> (= which > > lines) in Your script 
the code crashes?> > > > Greetings> > > > Robert> > > > Kasi, Vijay (London) 
schrieb:> > > Hello,> > > > > > I am receiving 'Segmentation Fault (core 
dumped)' error> while> > executing> > > perl script on unix host. I am using 
oracle 10.2.0 with perl> 5.8.6 .> > > > > > Can you pls advise what could be 
the reason.> > > > > > Path configured in my environment file :> > > > > >> >> 
/etdhub-as1/apps/perl-5.8.6:/etdhub-as1/apps/perl-5.8.6/bin:/etdhub-as1/> > >> 
>> apps/perl-5.8.6/lib/5.8.6/sun4-solaris:/etdhub-as1/apps/perl-5.8.6/lib/5> > 
>> >

RE: Segmentation Fault(Core dumped)

2008-01-07 Thread John Scoles

You can try the -w or anything else you fancy it will not help. As Peter said 
it is plain and simple. You change your Oracle Database client you will have to 
recompile DBD::Oracle. 

Sorry this is just the nature of the beast no way around it. 


Just as an aside there is usually no gain in speed (or anything else for that 
matter really) in updating the Oracle drivers. 

John Scoles

> Subject: RE: Segmentation Fault(Core dumped)
> Date: Mon, 7 Jan 2008 16:51:58 +
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> CC: dbi-users@perl.org; [EMAIL PROTECTED]
> 
> Martin,
>  
> I have executed script with -w option and got below result.
>  
> Scalar value @results{$fields} better written as $results{$fields} at
> ./ETDHUB_NSE_REUTERS_DQ_REPORT.pl line 50.
> Scalar value @results1{$fields1} better written as $results1{$fields1}
> at ./ETDHUB_NSE_REUTERS_DQ_REPORT.pl line 83.
> Segmentation Fault (core dumped)
>  
> Thanks
> Vijay
> 
> 
> 
>   -Original Message-
>   From: Martin Gainty [mailto:[EMAIL PROTECTED] 
>   Sent: 07 January 2008 16:24
>   To: Kasi, Vijay (London)
>   Subject: RE: Segmentation Fault(Core dumped)
>   
>   
>   Vijay-
>   
>   
> http://www.oracle-base.com/articles/misc/WebScriptingForOracle.php#perl
>   can you enable diagnostics with -w
>   
>   #!/u01/app/oracle/product/10.1.0/db_1/perl/bin/perl -w
>   
>   curious if you obtained the perl drivers from oracle or cpan?
>   
>   Cheers (from across the pond)
>   Martin 
>   
>   __
>   Disclaimer and confidentiality note
>   Everything in this e-mail and any attachments relates to the
> official business of Sender. This transmission is of a confidential
> nature and Sender does not endorse distribution to any party other than
> intended recipient. Sender does not necessarily endorse content
> contained within this transmission.
>   
>   
>   > Subject: RE: Segmentation Fault(Core dumped)
>   > Date: Mon, 7 Jan 2008 15:02:41 +
>   > From: [EMAIL PROTECTED]
>   > To: [EMAIL PROTECTED]
>   > CC: dbi-users@perl.org
>   > 
>   > Robert,
>   > 
>   > The code was running fine when I have used Oracle 9.2.0
> version, we have
>   > changed oracle client path to 10.2.0 (32 bit libraries) this
> morning and
>   > it started failing since.
>   > 
>   > When I try to execute any perl script, its not givin any info
> on failure
>   > except a single line error message (' Segmentatino Fault (core
> dumped)'
>   > 
>   > Pls advise.
>   > 
>   > Thanks
>   > Vijay
>   > 
>   > -Original Message-
>   > From: Robert Roggenbuck [mailto:[EMAIL PROTECTED] 
>   > Sent: 07 January 2008 14:57
>   > To: Kasi, Vijay (London)
>   > Cc: dbi-users@perl.org
>   > Subject: Re: Segmentation Fault(Core dumped)
>   > 
>   > 
>   > Please give us some more information. Can You figure out where
> (= which 
>   > lines) in Your script the code crashes?
>   > 
>   > Greetings
>   > 
>   > Robert
>   > 
>   > Kasi, Vijay (London) schrieb:
>   > > Hello,
>   > > 
>   > > I am receiving 'Segmentation Fault (core dumped)' error
> while
>   > executing
>   > > perl script on unix host. I am using oracle 10.2.0 with perl
> 5.8.6 .
>   > > 
>   > > Can you pls advise what could be the reason.
>   > > 
>   > > Path configured in my environment file :
>   > > 
>   > >
>   >
> /etdhub-as1/apps/perl-5.8.6:/etdhub-as1/apps/perl-5.8.6/bin:/etdhub-as1/
>   > >
>   >
> apps/perl-5.8.6/lib/5.8.6/sun4-solaris:/etdhub-as1/apps/perl-5.8.6/lib/5
>   > >
>   >
> .8.6:/etdhub-as1/apps/perl-5.8.6/lib/site_perl:/etdhub-as1/apps/perl-5.8
>   > >
>   >
> .6/lib/site_perl/5.8.6:/etdhub-as1/apps/perl-5.8.6/lib/site_perl/5.8.6/s
>   > >
>   >
> un4-solaris:/opt/sybase/OpenClient_v12.5.64Bit/OCS/bin:/etdhub-ds1/ora01
>   > > /app/oracle/product/10.2.0/bin
>   > > 
>   > > Thanks
>   > > Vijay
>   > > 
>   > > 
>   > > This message w/attachments (message) may be privileged,
> confidential
>

ANNOUNCE: DBD::Oracle 1.20 Release Candidate 8

2008-01-07 Thread John Scoles
In an effort to broaden the testing base I would like as many of you out 
there to give a try at installing and running


http://svn.perl.org/modules/dbd-oracle/trunk/DBD-Oracle-1.20-RC8.tar.gz

So far we think we have most of the problems ironed out but we still 
need a larger test pool as this version of DBD::Oracle add a number of 
new features


Namely;

Support for array binds and support for embedded objects.


Re: Oracle connection issue with perl DBI

2007-12-19 Thread John D Groenveld
In message <[EMAIL PROTECTED]>, "Kumar
 Ranjan" writes:
>I am facing a funny but troubling issue with Perl DBI & Oracle.
>When my shell environment does not have ORACLE_HOME path set, my script
>works fine. I am connecting
>to Oracle DB like this:
>
>#!/usr/bin/perl -w
>use strict;
>use DBI;
>my $dbh = DBI->connect("dbi:Oracle:host=xx.gold.com;port=1522;sid=sid",
>$eusr, $epas,{RaiseError => 1, AutoCommit => 1})
>  die "Can not connect : $DBI->errstr ";
>
>Now,
>set the ORACLE_PATH to /opt/bin/oracle/9.2.0.8
>and I do try to connect but it complains that it can not connect.

Is /opt/bin/oracle/9.2.0.8 the same ORACLE_HOME you used to build
DBD::Oracle?

It must be.


Do these commands work from the shell?
$ env ORACLE_HOME=/opt/bin/oracle/9.2.0.8 /opt/bin/oracle/9.2.0.8/bin/tnsping 
'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xx.gold.com)(PORT=1522))(CONNECT_DATA=(SID=sid)))'
$ env ORACLE_HOME=/opt/bin/oracle/9.2.0.8 /opt/bin/oracle/9.2.0.8/bin/sqlplus 
euser/epas@'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xx.gold.com)(PORT=1522))(CONNECT_DATA=(SID=sid)))'

If not, contact your DBA.

John
[EMAIL PROTECTED]



RE: Environment variable problem?

2007-12-19 Thread John Scoles

Just a repost so other can learn from it
 
Cheers


Date: Wed, 19 Dec 2007 10:05:58 -0500From: [EMAIL PROTECTED]: [EMAIL 
PROTECTED]: Re: Environment variable problem?It wasn't permissions, I fixed it 
by adding my PATH to the crontab and now it works. Thanks for the help and 
enjoy the Holiday season.Sam
On 12/18/07, John Scoles <[EMAIL PROTECTED]> wrote: 

Looks like a simple permissions error. 1) check to ensure you have 
libclntsh.so.10.1 on you computer (This is an oracle client) if not then you 
will most likely have to recomple your DBD::Oracle against whatever Oracle 
client you wnat to use. See the readme for this  2) is you have 
libclntsh.so.10.1 make sure it is in the path and you have execute permissions 
hope this helps cheersJohn Scoles> Date: Tue, 18 Dec 2007 10:59:44 -0500> From: 
[EMAIL PROTECTED]> To: dbi-users@perl.org> Subject: Environment variable 
problem? 
> > I'm running Red Hat AS 4 on a Sunfire X4200 with 4 GB RAM,> > 
> > 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:58:04 EST 2007 i686 athlon i386 
> > GNU/Linux> Perl 5.8.5 installed with DBI 1.601 and DBD::Oracle 1.19, and 
> > the Oracle> 10.2.0.1 client at /usr/lib/oracle/10.2.0.1/client> 
> > ORACLE_HOME=/usr/lib/oracle/10.2.0.1/client> 
> > LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.1/client/lib> > I have a lot of Perl 
> > scripts that connect to an Oracle DB that work fine > from the command line 
> > when run as root, and fail from crontab or with sudo> when not run as root 
> > directly.> > I've tried including the ORACLE_HOME and LD_LIBRARY_PATH 
> > environment> variables in my crontab file, but they still fail. This fixed 
> > a problem that > I had seen previously with Java, that was fixed when I 
> > included JAVA_HOME in> my crontab, so I was surprised when it failed with 
> > Oracle DBD.> > The error message that I get is> > install_driver(Oracle) 
> > failed: Can't load > 
> > '/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so'>
> >  for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object 
> > file:> No such file or directory at > 
> > /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230. at> 
> > (eval 3) line 3> Compilation failed in require at (eval 3) line 3.> Perhaps 
> > a required shared library or dll isn't installed where expected at > 
> > /usr/local/include/BbStatistics.pm line 73> > This is false, the shared 
> > library does exist at the specified location, with> proper permissions.> 
> > -r-xr-xr-x 1 root root 183768 May 21 2007 > 
> > /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so>
> >  > All of my scripts worked in previous environment, Red Hat AS 3 on a 
> > Sunfire> X4200 with 8 GB of RAM,> > 2.6.9-55.ELsmp #1 SMP Fri Apr 20 
> > 17:03:35 EDT 2007 i686 athlon i386> GNU/Linux> perl 5.8.5, with DBD::Oracle 
> > 1.19 and DBI 1.601 and Oracle 8.1.7> 
> > LD_LIBRARY_PATH=/usr/oracle/product/8.1.7/lib > 
> > ORACLE_HOME=/usr/oracle/product/8.1.7> > I had to load the following RPMs 
> > with --nodeps option to get DBD::Oracle> installed on my new machines, but 
> > presumed that all was well when scripts> worked from command line. Perhaps 
> > this is part of the problem?> > libsqlora8-2.3.3-2.el4.i386.rpm> 
> > php-squale-0.1.9-1.el4.i386.rpm> libsqlora8-debuginfo-2.3.3-2.el4.i386.rpm> 
> > php-squale-debuginfo-0.1.9-1.el4.i386.rpm > 
> > libsqlora8-devel-2.3.3-2.el4.i386.rpm> 
> > python-squale-0.1.10-0.2.el4.i386.rpm> perl-DBD-Oracle-1.19-1.el4.i386.rpm> 
> > squale-0.1.10-0.2.el4.i386.rpm> 
> > perl-DBD-Oracle-debuginfo-1.19-1.el4.i386.rpm > 
> > squale-debuginfo-0.1.10-0.2.el4.i386.rpm> 
> > php-modules-debuginfo-4.3.9-3.el4.i386.rpm> 
> > squale-devel-0.1.10-0.2.el4.i386.rpm> php-oci8-4.3.9-3.el4.i386.rpm> > I'm 
> > in a time crunch to get these new servers online before Christmas, so > all 
> > help is GREATLY appreciated. :)> -- > Sam Hoover> CSO, CCIT> Clemson 
> > University, Clemson, SC> [EMAIL PROTECTED]> Cell: 864.633.7499> Office: 
> > 864.656.3567

Your chance to win great prizes with Telus and Windows Live Messenger for 
Mobile. Click here for more information!-- Sam HooverCSO, CCITClemson 
University, Clemson, [EMAIL PROTECTED]: 864.633.7499Office: 864.656.3567 
_
Read what Santa`s been up to! For all the latest, visit 
asksantaclaus.spaces.live.com!
http://asksantaclaus.spaces.live.com/

RE: Connecting to Database

2007-12-08 Thread Moon, John
Sent: Friday, December 07, 2007 8:52 AM
To: dbi-users@perl.org
Subject: Connecting to Database

Hello

At the present time I am using Perl, cgi, Apache Web Page, SQL, and
SYBASE database on a unix server(SUN Fire V 880).  I have no problem
accessing the Sybase database, fetching records and display them on the
web page.

My Available Database Drivers are.
DBM
ExampleP
File
Proxy
Sponge
Sybase

Now, I would like to connect to another database on a Microsoft SQL
Server, using Perl from my unix server.

What do I need?

Where can I get information? (book or web page)

Thanks

Oscar


Here's one article...

http://www.sqlservercentral.com/articles/Miscellaneous/connectingtosqlse
rverusingperlwin32odbc/863/



RE: compatibility matrix

2007-12-05 Thread John Scoles

Well of the top of my head no. But here is my 2cents
 
DBI and DBD::Oracle 1.19 should be compatiable with any version of Oracle going 
right back to 7. It is more a matter of which Oracle Client you complile 
DBD::Oracle against. Basically any new client should be able to connect to an 
older database.
 
There are of course problems with different patch sets and bugs etc in Oracle 
as well you will have to take into consideration that you might have to use 
32bit binaries on a 64bit machine.
> Date: Wed, 5 Dec 2007 15:48:48 -0600> From: [EMAIL PROTECTED]> To: 
> dbi-users@perl.org> Subject: compatibility matrix> > Hello all,> Is there a 
> such a thing as a compatibility matrix for DBD,DBI, perl, OS > (solaris) and 
> Oracle? If so, where could I find the doc?> > When upgrading DBD and DBI, I'm 
> wondering if I should check the > compatibility with Oracle version and so 
> on.> > Thanks,> Kim
_
Exercise your brain! Try Flexicon!
http://puzzles.sympatico.msn.ca/chicktionary/index.html?icid=htmlsig

Re: Fun with UTF-8 and Oracle [PATCH]

2007-12-05 Thread John Scoles

Thanks for that I will include that in the release  and in the next RC

Peter J. Holzer wrote:

On 2007-09-04 14:20:20 +0100, Tim Bunce wrote:
  

On Mon, Sep 03, 2007 at 07:20:42PM +0200, Peter J. Holzer wrote:


On 2007-09-03 13:03:37 +0100, Tim Bunce wrote:
  

Oh the joys of Oracle character set support.

See the dbd_rebind_ph() code in dbdimp.c. Especially from the line
"csform = phs->csform;" onwards.

You can explicitly set the csform and csid using bind_param(..., { ...  })

Have fun!


I had :-). You gave me a push into the right direction, and I think I
found the problem:
  


[code deleted]

  

While it claimed to set csform=SQLCS_IMPLICIT, it was actually
setting it to SQLCS_NCHAR, and I guess that was what prevented the
use of the index on the varchar2 column. Sure enough, if I
explicitely set ora_csform to 1, it's fast. It is also fast, if I
set NLS_NCHAR to US7ASCII, so that it isn't used. 


Maybe the tests in line 1379 and 1381 should be reversed so that
SQLCS_IMPLICIT is preferred over SQLCS_NCHAR?
  

Sounds very plausible.


[...]
  

That's great, but why stop there? Now you seem to have identified the
problem, how about patching the code instead ;-)



Sorry for the long delay. I wanted to test the patch properly first and
then forgot to post it. Now I stumbled upon the same problem on a
different server which reminded me that I never posted the patch. So
here it is.

(I couldn't think of a proper test case: Building a table with 4 billion
rows and then checking whether the query takes a few seconds or an hour
doesn't seem a good idea :-). Anyway, I've used it in production for
almost 3 months.)

hp

  



--- dbdimp.c.orig   2006-11-03 15:05:46.0 +0100
+++ dbdimp.c2007-09-24 10:36:25.0 +0200
@@ -1376,15 +1376,15 @@
 
 if (!csform && SvUTF8(phs->sv)) {

/* try to default csform to avoid translation through non-unicode */
-   if (CSFORM_IMPLIES_UTF8(SQLCS_NCHAR))   /* prefer NCHAR */
-   csform = SQLCS_NCHAR;
-   else if (CSFORM_IMPLIES_UTF8(SQLCS_IMPLICIT))
+   if (CSFORM_IMPLIES_UTF8(SQLCS_IMPLICIT))/* prefer 
IMPLICIT */
csform = SQLCS_IMPLICIT;
+   else if (CSFORM_IMPLIES_UTF8(SQLCS_NCHAR))
+   csform = SQLCS_NCHAR;
/* else leave csform == 0 */
if (trace_level)
PerlIO_printf(DBILOGFP, "   rebinding %s with UTF8 value %s", 
phs->name,
-   (csform == SQLCS_NCHAR)? "so setting csform=SQLCS_IMPLICIT" 
:
-   (csform == SQLCS_IMPLICIT) ? "so setting csform=SQLCS_NCHAR" :
+   (csform == SQLCS_IMPLICIT) ? "so setting csform=SQLCS_IMPLICIT" 
:
+   (csform == SQLCS_NCHAR)? "so setting csform=SQLCS_NCHAR" :
"but neither CHAR nor NCHAR are unicode\n");
 }
 
  


RE: New edition of the Cheetah?

2007-12-01 Thread John Scoles

Maybe you can time it to come out at the same time as Perl 6??> From: [EMAIL 
PROTECTED]> To: [EMAIL PROTECTED]> CC: dbi-users@perl.org> Subject: RE: New 
edition of the Cheetah?> Date: Fri, 30 Nov 2007 14:03:49 -0700> > Jeff,> > 
Thank you for your reply. I have taken the liberty of fleshing out> your code a 
little further:> > use DBI;> use DBI::Cheetah::Authors qw( write_book 
book_written get_paid );> use DBD::Impatience qw( hold_breath 
throw_temper_tantrum );> sub you_are_here {> return !( write_book && 
book_written && get_paid );> }> $seconds = 300;> $dbh = DBI->connect(> 
"DBI:Impatience:host=localhost;database=DBIdocumentation",> "dbiuser",> 
"short!temper20080131",> { PrintError => 0, RaiseError => 1 }> );> $cheetah = 
$dbh->prepare(q{> SELECT chapters> FROM book> WHERE author = ?> AND coauthor = 
?> });> while ( &you_are_here() ) {> # <--- you are here> # <--- this interval 
is unknown no matter what the website> says> hold_breath( $seconds );> if ( 
++$count >= 18_144 ) {> throw_temper_tantrum( "ROYAL SNIT FIT" );> $count = 0;> 
}> }> $cheetah->execute("Tim","Jeff");> > Actually, despite my allusions to 
throwing a fit, I am only very> mildly hopeful about getting the new book. Take 
your time, write it> right. One question: has the writing even begun yet? Why 
was the> book announced so early? One reason for my curiosity is the fact that> 
I've thought about trying to break into writing technical books, so> I'm always 
interested in what happens behind-the-scenes.> > Best regards,> > -Brian> > > > 
-Original Message-> > From: Jeff Zucker [mailto:[EMAIL PROTECTED] > > 
Sent: Friday, November 30, 2007 10:10> > To: Brian H. Oak> > Cc: 
dbi-users@perl.org> > Subject: Re: New edition of the Cheetah?> > > > Hi 
Brian,> > > > Here's where we stand:> > > > $cheetah = $dbh->prepare(q{> > 
SELECT chapters> > FROM book> > WHERE author = ?> > AND coauthor = ?> > });> > 
... # <--- you are here> > ... # <-- this interval is unknown no matter what 
the website> says> > ... #> > $cheetah->execute("Tim","Jeff");> > > > Sorry, 
even the January 2008 date is at least as exaggerated as the > > reports of 
Mark Twain's death. I know you'd like to fetch() > > the book, but sorry, the 
wait will be a bit longer.> > > > -- > > Jeff> 
_
Read what Santa`s been up to! For all the latest, Visit  on the North Pole 
visit asksantaclaus.spaces.live.com!
http://asksantaclaus.spaces.live.com/

RE: Perl DBI::prepare Question. My head is sore from banging it against the wall. Can you help ease my pain?

2007-11-29 Thread Moon, John

-Original Message-
From: BAIER, ANTHONY (TONY), ATTSI [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 29, 2007 11:06 AM
To: STILWELL, DAVID B (DAVE), ATTLABS; dbi-users@perl.org
Subject: Perl DBI::prepare Question. My head is sore from banging it
against the wall. Can you help ease my pain?


Dave, DBI User Group,

[>>] ...

Issuing rollback() for database handle being DESTROY'd without explicit
disconn
ct(),  line 319.

[>>] 
Well right off hand I don't see it but can suggest (from past
experience!) that you use placeholders ... or at the least change the
quote style... qq{insert ...  some quoted '$string'}... 

The placeholders made my life much easier...

Example... 

$sql = 'insert ... values (?,?,?,?,?)'
...
$sth = $dbh->prepare($sql) or die DBI->errstr;
$rc = $sth->execute($reportId, $queryNumber,$readCount, $execCount,
$queryText);


Hope this gives you some ideas...

jwm



Re: Issue with perl, DBD::Oracle, Solaris 10

2007-10-29 Thread John D Groenveld
In message <[EMAIL PROTECTED]>, "Jona
than Leffler" writes:
>Did you build this Perl?  Do you have a Sun C compiler on the machine?
>
>Building shared objects with the C compiler is common practice many places
>and standard practice on Solaris.
>
>The most usual problems people have is that they do not have a Sun C
>compiler on the machine at all, or they only have /usr/ucb/cc (which is
>found but doesn't compile anything).  The fix is to get the Sun C compiler
>-- or rebuild Perl with GCC (and have GCC on the machine), or obtain a Perl
>build with GCC.

The Sun compilers can be downloaded here:
http://developers.sun.com/sunstudio/index.jsp>

I recommend that the OP build his own Perl from source for his
application regardless which compiler he uses.

John
[EMAIL PROTECTED]



Re: Ref:-- How to transfer DBI/DBD binary.

2007-10-26 Thread John D Groenveld
In message <[EMAIL PROTECTED]>,
 Richard T Malafa writes:
> Is this assuming the hardware is identical on both machines and the
> Oracle
> Database (not the clients alone) are identical?

Yes. The development and production systems must be the same
architecture and OS version.

The Oracle client libraries need to be the same version on both.

> What about the Perl??? Is that also have to be identicial in every
> respect???

I assumed the OP is planning on copying the entire Perl installation 
to the production machine.

> Has this actually been tried

Yes.

John
[EMAIL PROTECTED]



Re: Ref:-- How to transfer DBI/DBD binary.

2007-10-25 Thread John D Groenveld
In message <[EMAIL PROTECTED]>
, "MEHTA, HARESH, ATTSI" writes:
>I have installed DBI/DBD using gcc in our development
>solaris server. I want to install on production server but without using
>gcc or cc(compiler), Is there any way to transfer binary of DBI/DBD to
>production server??

You should be able to package up or tar your Perl build and
extract it on your production server.

Don't alter your Perl basedir and make certain your Oracle client
libraries are in the same ORACLE_HOME on both systems.

John
[EMAIL PROTECTED]



Re: DBI and DBD::Oracle throw error Had to create DBD::Oracle::dr::imp_data_size unexpectedly

2007-10-10 Thread John Scoles
Looks like the 64 bit perl vs 32 bit .pms issuesthat is croping up more and 
more.
So I would go back one more step at remove all the DBI and get the source 
and recompile and insall. the DBD::Oracle again.


What you might want to try is
 Not sure what the cure for this is??
""Peter McLarty"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
Hello,

Well I have had to wait for the sysadmins to do this, but we have done
as you recommended and removed all the dbd and then tried doing a make
on the system of the dbd to build a new one.
It has errors relating to the same problem, but we pressed on and
installed anyway
Here is a trace, from an attempt to connect

 perl -MDBI -e 'DBI->trace(4); DBI->connect("dbi:Oracle:CS89PROD",
"/","",{ora_session_mode => 2, RaiseError  => 1});'
DBI 1.40-ithread dispatch trace level set to 4 (in pid 18625)
Note: perl is running without the recommended perl -w option
-> DBI->connect(dbi:Oracle:CS89PROD, /, , HASH(0x505290))
-> DBI->install_driver(Oracle) for linux perl=5.008005 pid=18625
ruid=500 euid=500
   install_driver: DBD::Oracle version 1.19 loaded from
/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/DBD/Oracle.pm
New DBI::dr (for DBD::Oracle::dr, parent=, id=)
dbih_setup_handle(DBI::dr=HASH(0x698190)=>DBI::dr=HASH(0x7809e0),
DBD::Oracle::dr, 0, Null!)
Had to create DBD::Oracle::dr::imp_data_size unexpectedly at
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/DBI.pm line
1063.
dbih_make_com(Null!, 0, DBD::Oracle::dr, 196, 0) thr#504010
-> STORE in DBD::_::common for DBD::Oracle::dr
(DBI::dr=HASH(0x698190)~0x7809e0 'ShowErrorStatement' 1) thr#504010
STORE DBI::dr=HASH(0x7809e0) 'ShowErrorStatement' => 1
<- STORE= 1 at Oracle.pm line 61
<- install_driver= DBI::dr=HASH(0x698190)
-> connect for DBD::Oracle::dr (DBI::dr=HASH(0x698190)~0x7809e0
'CS89PROD' '/'  HASH(0x784020)) thr#504010
New DBI::db (for DBD::Oracle::db, parent=DBI::dr=HASH(0x7809e0),
id=)
dbih_setup_handle(DBI::db=HASH(0x7809a0)=>DBI::db=HASH(0x784000),
DBD::Oracle::db, 694c30, Null!)
Had to create DBD::Oracle::db::imp_data_size unexpectedly at
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/DBI.pm line
1063.
dbih_make_com(DBI::dr=HASH(0x7809e0), 775970, DBD::Oracle::db, 196,
0) thr#504010
Undefined subroutine &DBD::Oracle::db::_login called at
/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/DBD/Oracle.pm
line 222.
<> DESTROY ignored for outer handle DBI::db=HASH(0x7809a0) (inner
DBI::db=HASH(0x784000))
-> DESTROY for DBD::Oracle::db (DBI::db=HASH(0x784000)~INNER)
thr#504010
<- DESTROY= (not implemented)
dbih_clearcom 0x7809a0 (com 0x784f90, type 2) done.

-- DBI::END
-> disconnect_all for DBD::Oracle::dr
(DBI::dr=HASH(0x698190)~0x7809e0) thr#504010
<- disconnect_all= (not implemented) at DBI.pm line 659 via -e line
0
!   -> DESTROY for DBD::Oracle::dr (DBI::dr=HASH(0x7809e0)~INNER)
thr#504010
!   <- DESTROY= (not implemented) during global destruction
dbih_clearcom 0x698190 (com 0x775970, type 1) done.

!   <> DESTROY for DBI::dr=HASH(0x698190) ignored (inner handle gone)

This was run as oracle the user so it owns the oracle libraries.it needs
to use.

Interestingly the ORACLE_HOME that the database we are trying to connect
to appears to have 32 bit Perl installed and the same one liner runs
fine in it

If you can point me as to how we get down to finding the files,
permissions that cause the error it would be appreciated


Cheers


Peter


-Original Message-
From: Tim Bunce [mailto:[EMAIL PROTECTED]
Sent: Friday, 5 October 2007 06:46 PM
To: Martin Evans
Cc: dbi-users@perl.org
Subject: Re: DBI and DBD::Oracle throw error Had to create
DBD::Oracle::dr::imp_data_size unexpectedly

On Fri, Oct 05, 2007 at 09:07:48AM +0100, Martin Evans wrote:
> Peter McLarty wrote:
> >Hi
> >Running some redhat servers and created some scripts that use DBI and

> >DBD::Oracle to access our 10.2.0.3 databases.
> >The script was built and tested and has been used successfully on
> >dual core 64bit Xeon CPU servers and with as best as we can tell an
> >identical installation on some new quad core servers the script fails

> >with the above error.
> >
> >We have tried a later version of DBI we were using the 1.40 version
> >installed as a RPM and have installed 1.59 using perl and make.
> >
> >DBD::Oracle is 1.19
> >
> >I have some strace output from where it fails running a simple piece
> >of code that simply connects the the system as / and runs select *
> >from dual as well as then would do a couple of log switches
>
> It may be easier to diagnose with a DBI trace instead of an strace
> (see DBI_TRACE in DBI pod). In particular what are the full errors
here:
>
> write(2, "Had to create DBD::Oracle::dr::i"..., 140) = 140 write(2,
> "Use of uninitialized value in su"..., 129) = 129
> brk(0x925000)   = 0x925000
> write(2, "Had to create DBD

Repost from CPAN DBD::ORacle forum

2007-10-10 Thread John Scoles
Hi. Sorry if this turns out to be a newbie mistake, but I've run into an odd 
problem while using DBD::Oracle.
For some reason, my sql statement results in empty strings.

Instead of getting the value i want to see there is a "''," (please see 
below).

The amount of columns (6 in this case) are correct. I'm using perl v5.8.8, 
DBD::Oracle v1.19, Oracle instantclient-basic - instantclient-devel and 
sqlplus.

Does someone know what i'm doing wrong?

When i manually do a query with help of sqlplus of the Oracle instant client 
it is ok (see below).

This is the result with the empty strings when using DBD::Oracle : 
main::(db1.pl:47):

my $result = $sth-1 '', '', '', '', '', '' '', '', '', '', 
'', '' '', '', '', '', '', '' '', '', '', '', '', '' '', '', '', '', '', '' 
5 rows

This is the result when using sqlplus : node1# ./sqlplus 
login/login@//ip:port/db SQL*Plus: Release 11.1.0.6.0 - Production on Wed 
Oct 10 10:36:34 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. 
Connected to: Oracle Compatible Release 9.2.0.4.0 Oracle Rdb OCI Server 
Release 7.1.6.2.1 - Production, Level 1.7 Oracle Rdb SQL Release 7.1.4.0.0 - 
Production SQL>

select * from table; table1 ta table3 t table5 table 6
-- -- -- - -- - 
004400 10 075935 0 075935 1
004400 10 075938 0 075938 1
520020 71 127464 0 127464 1
004400 10 075939 0 075939 1
004400 10 075945 0 075945 1 5 rows selected.

SQL this is the code i'm using :
#!/usr/bin/perl use DBI;
use DBD::Oracle; $ENV{'LD_LIBRARY_PATH'} = 
'/home/httpd/perl/instantclient_11_1/';
#$ENV{'NLS_LANG'} = 'AMERICAN_AMERICA.UTF8';
#$ENV{'NLS_LANG'} = 'AMERICAN_AMERICA.AL32UTF8';
#$$ENV{'NLS_NCHAR'} = 'AL32UTF8';
#$ENV{'NLS_NCHAR'} = 'UTF8';
#$ENV{NLS_LANG}="AMERICAN_AMERICA.WE8MACROMAN8S";
#$ENV{'NLS_LANG'} = 'WE8ISO8859P1';
#$ENV{'NLS_LANG'} = 'WE8MSWIN1252';
#$ENV{'NLS_LANG'} = 'US7ASCII';
#$ENV{'NLS_LANG'} = 'UTF8';
#$ENV{'NLS_LANG'} = 'AL32UTF32';
$ENV{NLS_LANG} = 'american_america.we8iso8859p1';
my $host=
my $sid=
my $port=
my $user =
my $passwd =
my $dbh = DBI>connect("dbi:Oracle:host=$host;port=$port;sid=$sid", $user, 
$passwd) or die "Unable to connect: $DBI::errstr";
my $statement = 'SELECT * FROM table';
$sth = $dbh->prepare($statement);
$sth->execute;
my $result = $sth->dump_results;

Thank you in advance, Ricardo 




RE: Please do me a favour.

2007-10-05 Thread John Scoles

>From what you say it seems you did not run the Makefile.PL, make, make test or 
>make install.  One cannot just copy the DBI and expect it to work.  
 
Either mannually make and compile the DBI code or use CPAN shell to do this for 
you. You will also have o do the same for the Omega DBD as well
> Subject: Please do me a favour.> Date: Thu, 4 Oct 2007 15:59:26 +0530> From: 
> [EMAIL PROTECTED]> To: dbi-users@perl.org> > Hi,> > I have installed Perl 
> 5.6.1 on my windows XP .After that I have written> a small perl script and it 
> run successfully.> > When I execute another script(for connecting database 
> and retreiving> data).It is showing DBI error.So I downloaded dbi module 
> DBI-1.59.tar.gz> From the net and copied the DBI folder under the path 
> C:\Program> Files\PERL\lib> > Even though it is throwing the error like> "> 
> Can't locate loadable object for module DBI in @INC (@INC contains:> 
> C:/Program F> iles/PERL/lib C:/Program Files/PERL/site/lib .) at C:/Program> 
> Files/PERL/site/li> b/DBI.pm line 243> BEGIN failed--compilation aborted at 
> C:/Program> Files/PERL/site/lib/DBI.pm line> 243.> Compilation failed in 
> require at C:\Perl\dbtest.pl line 6.> BEGIN failed--compilation aborted at 
> C:\Perl\dbtest.pl line 6. "> > These is my code> > #!/opt/perl5.6.1/bin/perl> 
> > use strict;> use DBI;> > my $dbh = DBI->connect( 'dbi:Oracle:omega',> 
> 'omega',> 'rez5mip2',> );> > my $sql = qq{ SELECT indiv_firstname, 
> indiv_lastname FROM ind,usr WHERE> ind.ind_cd=usr.ind_cd and 
> usr_login='20224474'};> my $sth = $dbh->prepare( $sql );> $sth->execute();> > 
> while (@row = $sth->fetchrow_array) {> ($indfirst, $indlast) = @row;> > print 
> "$indfirst\n";> print "$indlast\n";> }> > $sth->finish;> $dbh->disconnect;> > 
> Please help me out to reslove this.> > Regards> Sivakumar.M
_
Express yourself with new emoticons. It’s easy! Try it!
http://www.freemessengeremoticons.ca/

Re: DBD::Oracle 1.19 fails to find Oracle version, problem and solution

2007-09-27 Thread John Scoles
Ok Martin we can pick this up on the morrow. I will add a few debug 
extra debug stuff about the Makefile and get you email me the results 
directly.


Talk to you tomorrow

Cheers John Scoles

Martin Evans wrote:

John Scoles wrote:
Yes it is a rather delicate subject as if we make it work for one it 
will break for everyone else.


Don't agree in this case since a) the code is already not working and 
b) the change only comes into play if sqlplus fails with SP2-0750.


The real root of the problem is that Oracle in its divine wisdom has 
compacted all the .so files into one so there is no way you c 
compiler can get them but of SQL on the Ubuntu Server it could be the 
case that the Makefile fort 1.19 is not recognizing it as a Linux 
server or alike. 


We could try to debug it but I would need access to your server for 
an hour or so or if you have the time we can debug it together as I 
can send you a Makefile.PL with a little more debugging into?  I have 
time tomorrow if you are interested Martin




I am happy to anything to help now, tomorrow or whenever. However, I 
don't understand your response since the problem I am seeing is that 
sqlplus will NOT run if ORACLE_HOME is defined and it does not seem 
related to combining libraries into one. The actual code failing 
(omitting comments) is:


sub get_client_version {
my ($force_version) = @_;
my $client_version_full = '';
my $sqlplus_exe = ($os eq 'Win32' || $os eq 'MSWin32' || $os eq 
'cygwin') ? "sqlplus.exe" : "sqlplus";

my $OH_path = $OH;
chomp($OH_path = `/usr/bin/cygpath -u $OH_path`) if $os eq 
'cygwin' && $OH;
local $ENV{PATH} = join $Config{path_sep}, "$OH_path/bin", 
$OH_path, $ENV{PATH} if $OH;

print "PATH=$ENV{PATH}\n" if $::opt_v;

if (find_bin($sqlplus_exe)) {

# code gets here since find_bin finds sqlplus on my path

local $ENV{SQLPATH} = "";
open FH, ">define.sql" or warn "Can't create define.sql: $!";
print FH "DEFINE _SQLPLUS_RELEASE\nQUIT\n";
my $sqlplus_release = `$sqlplus_exe -S /nolog [EMAIL PROTECTED] 2>&1`;
unlink "define.sql";
print $sqlplus_release; # the _SQLPLUS_RELEASE may not be on 
first line:
if ($sqlplus_release =~ /DEFINE _SQLPLUS_RELEASE = 
"(\d?\d)(\d\d)(\d\d)(\d\d)(\d\d)"/) {

# code does not get here since sqlplus returned an error

# instead of the version. It returns SP2-0750 because
# when it sees ORACLE_HOME is defined it expects to find
# message files which are not present with instant client
$client_version_full = sprintf("%d.%d.%d.%d", $1, $2, $3, 
$4);

}

My change (although ugly) should not break anyone else because all it 
does is re-run sqlplus with ORACLE_HOME temporarily deleted from 
environment IF sqlplus returns the error SP2-0750. i.e., I insert into 
above before "unlink":


if ($sqlplus_release =~ /SP2-0750/) {
my $x = $ENV{ORACLE_HOME};
delete $ENV{ORACLE_HOME};
$sqlplus_release = `$sqlplus_exe -S /nolog 
[EMAIL PROTECTED] 2>&1`;

$ENV{ORACLE_HOME} = $x;
}

After this minor addition it works fine.

If you still want me to run anything on my machine let me know. I 
cannot provide access to it from outside our network but I can run 
anything you like.


Martin


Re: DBD::Oracle 1.19 fails to find Oracle version, problem and solution

2007-09-27 Thread John Scoles
Yes it is a rather delicate subject as if we make it work for one it 
will break for everyone else.


The real root of the problem is that Oracle in its divine wisdom has 
compacted all the .so files into one so there is no way you c compiler 
can get them but of SQL on the Ubuntu Server it could be the case that 
the Makefile fort 1.19 is not recognizing it as a Linux server or alike. 
We could try to debug it but I would need access to your server for an 
hour or so or if you have the time we can debug it together as I can 
send you a Makefile.PL with a little more debugging into?  I have time 
tomorrow if you are interested Martin


Martin J. Evans wrote:

Hi,

Just attempted to install DBD::Oracle 1.19 on an Ubuntu Server 7.04 
Feisty machine running Perl v5.8.8 (and instant client 
10.2.0.3-20061115) and hit a problem with the Makefile.PL not being 
able to determine my Oracle version. The symptom is:


==
WARNING: Setting ORACLE_HOME env var to /home/XXX/instantclient_10_2/ 
for you.
WARNING: The tests will probably fail unless you set ORACLE_HOME 
yourself!

Using Oracle in /home/XXX/instantclient_10_2/
Error 6 initializing SQL*Plus
Message file sp1.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software 
directory




I'm having trouble finding your Oracle version number... trying harder

WARNING: I could not determine Oracle client version so I'll just
default to version 8.0.0.0. Some features of DBD::Oracle may not work.
Oracle version based logic in Makefile.PL may produce erroneous results.
You can use "perl Makefile.PL -V X.Y.Z" to specify a your client version.

Oracle version 8.0.0.0 (8.0)
Looks like an Instant Client installation, okay
==

The real problem is that if you set ORACLE_HOME (which Makefile.PL 
does) sqlplus does not work e.g.,


# echo $ORACLE_HOME
# ./instantclient_10_2/sqlplus -S /nolog \@/tmp/x.sql 2>&1
DEFINE _SQLPLUS_RELEASE = "1002000300" (CHAR)
# ORACLE_HOME=/home/XXX/instantclient_10_2/ 
./instantclient_10_2/sqlplus -S /nolog \@/tmp/x.sql 2>&1

Error 6 initializing SQL*Plus
Message file sp1.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software 
directory


Contrary to the SP2-0750 error and description, Oracle's advice (on 
their web page) for using InstantClient is NOT to set ORACLE_HOME but 
to set LD_LIBRARY_PATH (or configure the dynamic linker using ldconfig 
etc). I can't remember now exactly what the issue was but I've had 
other problems using instant client with ORACLE_HOME set before. I 
don't think DBD::Oracle's Makefile.PL should set ORACLE_HOME if it 
detects instant client however, it is so ingrained in the Makefile.PL 
it might compromise some other installation path to remove it. As a 
workaround (I know not pretty) I changed Makefile.PL in 
get_client_version() around line 1473 as follows:


open FH, ">define.sql" or warn "Can't create define.sql: $!";
print FH "DEFINE _SQLPLUS_RELEASE\nQUIT\n";
close FH;
my $sqlplus_release = `$sqlplus_exe -S /nolog [EMAIL PROTECTED] 2>&1`;
# +MJE
if ($sqlplus_release =~ /SP2-0750/) {
my $x = $ENV{ORACLE_HOME};
delete $ENV{ORACLE_HOME};
$sqlplus_release = `$sqlplus_exe -S /nolog [EMAIL PROTECTED] 2>&1`;
$ENV{ORACLE_HOME} = $x;
}
# -MJE
unlink "define.sql";

Originally, I just deleted ORACLE_HOME but it is used all over the 
place later and led to use of uninitialised variable warnings.


Once change made the outcome is:

==
WARNING: Setting ORACLE_HOME env var to /home/XXX/instantclient_10_2/ 
for you.
WARNING: The tests will probably fail unless you set ORACLE_HOME 
yourself!

Using Oracle in /home/XXX/instantclient_10_2/
DEFINE _SQLPLUS_RELEASE = "1002000300" (CHAR)
Oracle version 10.2.0.3 (10.2)
Looks like an Instant Client installation, okay
Your LD_LIBRARY_PATH env var is set to '/home/XXX/instantclient_10_2/'
==

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com




Re: DBD-Oracle Connection Problem

2007-09-13 Thread John Scoles
Hate to say this but  if you can connect in any manner it is not really a 
DBD::Oracle problem.


It is an Oracle problem of some sort.  Unfortunetly this sort of problem 
(can be a real bugger to pin down.  It could be anything from the way you 
have your listener setup to the way your TNSnames.ora file entry is made up?


 ORA-12154
is a common bugbeart of all Oracle DBAs.

did find this link for php
http://www.oracle.com/technology/tech/php/htdocs/php_troubleshooting_faq.html

which may help you.

cheers
- Original Message - 
From: "Darrell Oresky" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, September 12, 2007 8:46 PM
Subject: DBD-Oracle Connection Problem



I am having a problem using DBD-Oracle.

Basic problem - I can only get a connect to work when I fully
specify the connect string, i.e.

"dbi:oracle:host=xxx;port=yyy;sid='zzz' 

Environment:

Remote connection

Server side - Solaris 9, Oracle 9.2.0.4.0

Client side - Solaris 10 i86pc, Oracle Client 10.2.0.1.0
Perl 5.8.4 (as came installed with Solaris)
DBI 1.58
DBD-Oracle 1.19

SQLPlus works. With no TWO_TASK, and TNS_ADMIN set,

sqlplus x/[EMAIL PROTECTED]

works, demonstrating it is finding and using tnsnames.ora.

From a simple Perl program in the same shell, any format of the connect 
other than

a fully specified connect string results in a ORA-12154 message.

Since SQLPlus is resolving the database name, this seems to imply
the program can not find tnsnames.ora?

Checked the environment in the shell the Perl program runs from - properly 
set.

Printed environment variables inside the Perl script - properly set.
tnsnames.ora permissions, and all directories, set to 777.
sqlnet.ora specifies TNSNAMES as a connect method.

Turned on DBI trace to level 15. Only interesting message is:

OCIServerAttach (some#, some#, "dbname", 5, 0)
and then ORA-12154 follows.

Any ideas?

Darrell Oresky
[EMAIL PROTECTED]







Re: compiling DBD module on system with multiple versions of oracle

2007-09-13 Thread John Scoles


if you have a system with multiple versions of oracle and using Perl DBI 
and

DBD modules.

how to use/setup the DBD module to work on any version of oracle. In
otherwords which oracle environment am i going to use?


Most likly the first one it finds. When your run Makefile.PL It will tell 
you which client it is useing.



the make file will hard code the full path of the libraries into the
binaries.



Yest that is how it works. But remember it tis the client libraries. OIC.dll 
for win and the .SO files for others


what happens when  you need to create the dbi/dbd module for another 
system

that does not have the version of oracle on the system that has the IBM C
compiler?



Like I have said in the past you are compiling against a client not a 
database.  In this case I would install the Oracle instant client 
http://www.oracle.com/technology/tech/oci/instantclient/index.html as it is 
compatiable (as are most clients) with almost any Oracle database and then 
compile your DBD::Oracle against this one.


You do not need an Oracle DB on you server to run DBD:ORACLE actully there 
are a large number of reasons why you would not want your Oracle DB and 
DBD::Oracle on the same box but I wount go into them here.


cheers John Scoles




Re: DBI with different versions of Oracle

2007-09-11 Thread John Scoles
What would happen in this case it would use the client from 9.2.0.6 not the DB. 
 

You most likely do not have an TNS entry for your 10g database in your 9.2.0.6 
TNSNAMES.ORA file.  

So it is more of a connection problem than  a DBD::Oracle problem. Now if you 
happend to have your 9 and 10 DBs named the same you will get into problems 
again a Oracle issue not a DBD::Oracle. 

In actual terms there is little (if any) difference between the OCI (Oracle 
Call Interface is what DBD::Oracle uses under all that Perl code) found in a 
Oracle 9 client and a Oracle 10g client. So there sould be no real issues with 
DBD::Oralce an connecting to different versions of Oracle.

Cheers

- Original Message - 
  From: Richard Labutis 
  To: John Scoles 
  Sent: Tuesday, September 11, 2007 1:41 PM
  Subject: Re: DBI with different versions of Oracle


  I have found in the previous version, if ORACLE_HOME is 9.2.0.6 when you 
originally compiled the module and you decide to use oracle 10g, the module 
will try to use use the oracle version that has been set when the module was 
built. 

  this is what I am trying to resolve.

  I just don't know how all this handled.




  On 9/11/07, John Scoles < [EMAIL PROTECTED]> wrote:
Looking at this again. If you have mulitple ORACLE_HOMEs in you path it is 
anyones guess as to which client your DBD::Oracle with compile against.  In
Lunix I have see the last one on the list be the one. Your best bet would be
to change the ORACLE_HOME to the client you want to compile against for the 
compile and install. After that it should work no mater how many
ORACLE_HOMEs you have set as long as the one you compiled against is there
as well

cheers
- Original Message -
From: "Richard Labutis" < [EMAIL PROTECTED]>
To: 
Sent: Tuesday, September 11, 2007 11:43 AM
Subject: DBI with different versions of Oracle 


> when building the module, you have to specify the ORACLE_HOME
>
> what happens if you have multiple versions of Oracle? How is that handled?
>





Re: DBI with different versions of Oracle

2007-09-11 Thread John Scoles
Looking at this again. If you have mulitple ORACLE_HOMEs in you path it is 
anyones guess as to which client your DBD::Oracle with compile against.  In 
Lunix I have see the last one on the list be the one. Your best bet would be 
to change the ORACLE_HOME to the client you want to compile against for the 
compile and install. After that it should work no mater how many 
ORACLE_HOMEs you have set as long as the one you compiled against is there 
as well


cheers
- Original Message - 
From: "Richard Labutis" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, September 11, 2007 11:43 AM
Subject: DBI with different versions of Oracle



when building the module, you have to specify the ORACLE_HOME

what happens if you have multiple versions of Oracle? How is that handled?





Re: DBI with different versions of Oracle

2007-09-11 Thread John Scoles

The build is not against a Oracle instance per say.

It is a built against an Oracle Client.  So it works the same way SQLPlus or 
any other SQL GUI Client.


So you can connect to any number of different versions of an Oracle DB.  You 
may run into problems with Client X and DB Y but that would be more an 
Oracle bug than anything else.


Hope this helps

John Scoles

- Original Message - 
From: "Richard Labutis" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, September 11, 2007 11:43 AM
Subject: DBI with different versions of Oracle



when building the module, you have to specify the ORACLE_HOME

what happens if you have multiple versions of Oracle? How is that handled?





Re: TWO_TASK environment variable

2007-09-06 Thread John Scoles

isn't TWO_TASK  only used when you have SQL*NET installed??

I do not think Instant-client installs that??
I will get onto one of my Oracle DBA types later to day and ask that.  Might
have to change the POD a bit to reflect that
- Original Message - 
From: "Martin J. Evans" <[EMAIL PROTECTED]>

To: 
Cc: "tom r" <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2007 5:47 AM
Subject: Re: TWO_TASK environment variable



I was playing with TWO_TASK myself this morning and like Tom, I cannot make
the advice in DBD::Oracle work with Instant Client 10.2.0.3. I wonder if
the description of TWO_TASK is correct or perhaps out of date wrt to newer
Oracle versions. See below:

tom r wrote:

reading man DBD::Oracle gives an in depth explanation on how the TWO_TASK
environment variable can be used.  however, when i tried to use it in
place of .tnsnames.ora nothing worked.  i believe that sql*plus does not
use TWO_TASK.

-
[~] cat .tnsnames.ora
infra=(description=(address=(protocol=tcp)(host=infradb.fs.usda.gov)
(port=1521))(connect_data=(sid=iwebdb)))
[~] sqlplus 'fs_public/[EMAIL PROTECTED]'

SQL*Plus: Release 10.2.0.3.0 - Production on Wed Apr 11 10:36:04 2007

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options

SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release
10.1.0.5.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[~] printenv | grep TWO
TWO_TASK=T:infradb.fs.usda.gov:iwebdb


Try as I might, I cannot make T:*** work either. What does work for me is:

TWO_TASK=//xxx.easysoft.local:1521/ORACLE_SID

but none of:

TWO_TASK=T:xxx.easysoft.local:1521:ORACLE_SID
TWO_TASK=T:xxx.easysoft.local:ORACLE_SID
TWO_TASK=T:xxx.easysoft.local/ORACLE_SID

so for a totally empty DBI->connect call (and using instant client) I have
the following working:

DBI_DSN=dbi:Oracle:
DBI_USER=xxx
DBI_PASS=yyy
LD_LIBRARY_PATH=/home/martin/instantclient_10_2
TWO_TASK=//xxx.easysoft.local:1521/ORACLE_SID

perl -e 'use DBI; $h = DBI->connect();'


[~] sqlplus 'fs_public/fs_public'







in addition, it appears sql*plus doesn't even allow one to specify the
connection parameters on the command line.


That is also what I found which makes me think the syntax suggested by
DBD::Oracle POD for TWO_TASK may no longer be applicable for Oracle 10.


-
[~] sqlplus 'fs_public/[EMAIL PROTECTED]/sid=iwebdb'


For me what works using your values would be:

sqlplus 'fs_public/fs_public@//infradb.fs.usda.gov/iwebdb'




-

unless i'm missing something here, it seems sql*plus must use the
.tnsnames.ora file.


No, I don't have a tnsnames.ora file but I don't use the syntax mentioned
in DBD::Oracle.

From what I can find on the net, it may be that the syntax "T:", "P:" (in
fact a letter followed by a colon) at the start of the connect string
tells SQL*Net to use V1 and since Oracle 7.3, SQL*Net V1 is no longer
supported.

This is not the first time someone has failed to use TWO_TASK following
the directions in DBD::Oracle. Although I cannot be sure of the SQL*Net
V1/V2 changes in syntax I can say that the syntax I show above does work
with sqlplus and DBD::Oracle since Oracle 10. I suggest the DBD::Oracle
POD is changed and I am happy to provide a patch against svn tree.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com





Re: report (problems compiling DBD::Oracle on Solaris 10)

2007-09-05 Thread John Scoles
Looks like you are trying to compile the 32 bit oracle client with 64 bit 
system.  I think you have to use the 64 bit oracle client.
- Original Message - 
From: "toni garcia" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, September 05, 2007 10:56 AM
Subject: report (problems compiling DBD::Oracle on Solaris 10)



As stated in the README file i'm reporting issues compiling DBD::Oracle
on Solaris 10

i apologize if this is not the correct place to do it :)


Platform is Solaris 10 on Sun Fire T2000


Compiling DBD::Oracle, 'make' stage fails with output:

LD_RUN_PATH="/oracle/o102_client/lib32:/oracle/o102_client/rdbms/lib32"
cc  -G Oracle.o  dbdimp.o  oci8.o -xarch=v9 -L/oracle/o102_client/lib/
-L/oracle/o102_client/rdbms/lib/   -lclntsh
`cat /oracle/o102_client/lib/sysliblist` -R/oracle/o102_client/lib
-laio  -lposix4 -lkstat -lm  -lthread -lpthread -o
blib/arch/auto/DBD/Oracle/Oracle.so cc: Warning: -xarch=v9 is
deprecated, use -m64 to create 64-bit programs ld: fatal: file
Oracle.o: wrong ELF class: ELFCLASS32 ld: fatal: File processing
errors. No output written to blib/arch/auto/DBD/Oracle/Oracle.so ***
Error code 1 make: Fatal error: Command failed for target
`blib/arch/auto/DBD/Oracle/Oracle.so'


After following README file, i've achieved to compile with:

 make realclean
 perl Makefile.PL -nob
 make
 make test
 make install

(using 'perl Makeperl.PL -p' also fails)


# uname -a
SunOS hostname 5.10 Generic_118833-33 sun4v sparc SUNW,Sun-Fire-T200


# perl -V
Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
 Platform:
   osname=solaris, osvers=2.10, archname=sun4-solaris-64int
   uname='sunos localhost 5.10 sun4u sparc SUNW,Ultra-2'
   config_args=''
   hint=recommended, useposix=true, d_sigaction=define
   usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef useperlio=define d_sfio=undef
uselargefiles=define usesocks=undef use64bitint=define
use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef
 Compiler:
   cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-xarch=v8 -D_TS_ERRNO', optimize='-xO3 -xspace -xildoff',
   cppflags=''
   ccversion='Sun WorkShop', gccversion='', gccosandvers=''
   intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
   d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
   ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define
 Linker and Libraries:
   ld='cc', ldflags =''
   libpth=/lib /usr/lib /usr/ccs/lib
   libs=-lsocket -lnsl -ldl -lm -lc
   perllibs=-lsocket -lnsl -ldl -lm -lc
   libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
   gnulibc_version=''
 Dynamic Linking:
   dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
ccdlflags='-R /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE'
cccdlflags='-KPIC', lddlflags='-G'


Characteristics of this binary (from libperl):
 Compile-time options: USE_64_BIT_INT USE_LARGE_FILES
 Locally applied patches:
   22667 The optree builder was looping when constructing the
ops ... 22715 Upgrade to FileCache 1.04
   22733 Missing copyright in the README.
   22746 fix a coredump caused by rv2gv not fully converting a
PV ... 22755 Fix 29149 - another UTF8 cache bug hit by substr.
   22774 [perl #28938] split could leave an array without ...
   22775 [perl #29127] scalar delete of empty slice returned
garbage 22776 [perl #28986] perl -e "open m" crashes Perl
   22777 add test for change #22776 ("open m" crashes Perl)
   22778 add test for change #22746 ([perl #29102] Crash on
assign ... 22781 [perl #29340] Bizarre copy of ARRAY make sure a pad
op's ... 22796 [perl #29346] Double warning for int(undef) and
abs(undef) ... 22818 BOM-marked and (BOMless) UTF-16 scripts not working
   22823 [perl #29581] glob() misses a lot of matches
   22827 Smoke [5.9.2] 22818 FAIL(F) MSWin32 WinXP/.Net SP1 (x86/1
cpu) 22830 [perl #29637] Thread creation time is hypersensitive
   22831 improve hashing algorithm for ptr tables in
perl_clone: ... 22839 [perl #29790] Optimization busted: '@a = "b",
sort @a' ... 22850 [PATCH] 'perl -v' fails if local_patches contains
code snippets 22852 TEST needs to ignore SCM files
   22886 Pod::Find should ignore SCM files and dirs
   22888 Remove redundant %SIG assignments from FileCache
   23006 [perl #30509] use encoding and "eq" cause memory leak
   23074 Segfault using HTML::Entities
   23106 Numeric comparison operators mustn't compare addresses
of ... 23320 [perl #30066] Memory leak in nested shared data
structures ... 23321 [perl #31459] Bug in read()
   SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
 Built under solaris
 Compiled at Feb 13 2006 05:12:02
 @INC:
   /usr/perl5/5.8.4/lib/sun4-solaris-64int
   /usr/perl5/5.8.4/lib
   /usr/perl5/site_perl/5.8.4/sun4-solaris-64int
   /usr/perl5/site_perl/5.8.4
   /usr/perl5/site_perl
   /usr/perl5/vendor_perl/5.8.4/sun4

Re: Another set of DBI docs

2007-08-28 Thread John McNamara

Tim Bunce wrote:

On Wed, Aug 15, 2007 at 04:16:40PM -0700, Dean Arnold wrote:
  

(Those who abhor javadocs should discard this message immediately...)



Having greatly enjoyed playing with TiddlyWiki[1] for the new DBI FAQ,
I'd *love* for someone to add a TiddlyWiki subclass to Pod::Simple::Wiki
http://search.cpan.org/~jmcnamara/Pod-Simple-Wiki/


Hi,

Ron Savage has added a TiddlyWiki filter to Pod::Simple::Wiki and it is 
now available on CPAN:


   http://search.cpan.org/~jmcnamara/Pod-Simple-Wiki/

I ran the main BDI documentation through the filter and loaded it into 
TiddlyWiki. It looks quite good.


   pod2wiki --style tiddlywiki DBI.pm > DBI.txt

John.
--



RE: Please take a moment...

2007-08-06 Thread John Costello

>From the Perl Foundation's main page, :

'Kirrily's goal is to "take a snapshot of the Perl world as it currently 
stands." As an active member of the Perl community, she's often asked 
questions about Perl's users and is only left to "hypothesise, generalise, 
and hand-wave." Further, software communities can often be an echo chamber 
where people only hear from like-minded people. The Perl Survey is an 
attempt to break out of that echo chamber and hear from all Perl users 
around the world, regardless of skill level, not just the core users most 
active in vocal communities.'

On Mon, 6 Aug 2007, Michael Muratet US-Huntsville wrote:

> Having taken the survey I feel compelled and entitled to ask: what's the
> purpose?
> 
> Thanks
> 
> Mike
> 
> > -Original Message-
> > From: Tim Bunce [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, August 04, 2007 6:05 PM
> > To: [EMAIL PROTECTED]
> > Cc: dbi-users@perl.org
> > Subject: Please take a moment...
> > 
> > Give back a little of the time that perl has saved you:
> > 
> > http://perlsurvey.org/survey/
> > 
> > Tim.
> 




Re: error on a windows 2003 serv er

2007-08-03 Thread John Costello
On Fri, 3 Aug 2007, Samuel_Zheng wrote:

> Hi, How can I allow my perl scripts to read an ODBC pointing to a
> access97 file? Can someone give me something to try? thanks in advanced.
> Everytime my script tries to read the file, it failed. it displays some
> unreadable characters and the error is SQL4200. Same set of script runs

Searching for "SQL State 4200" will give a few results of what that error 
means.  I even found a Chinese page that Google translated as, essentialy, 
a failure to open the file.  Other pages give access denied.

> fine on a XP computer. I used excel to open the access97 file and it can
> be open.

Did you use Excel on the W2K3 server to open the Access97 file?  Are you 
able to write back to the access97 file via Excel?  Have you configured 
DSNs (Control Panels > Administrative Tools > Data Sources(ODBC) ) on the 
W2K3 server, and if so, what driver are you using?

I have *no* idea whether W2K3's native Access driver is backward 
compatible with Access97.

Are you using the same login on the W2K3 machine as on the XP machine?  If 
not, there could be a permissions issue there.

Where does the Access97 database reside?  On the XP system, on the W2K3 
server, or elsewhere?  What are the permissions on the folder where the 
Access97 database resides?

This sounds less like a perl/dbi issues and more like a Windows 
configuration issue.

John




Re: Guidance on setting up multiple database handles to be used in one script

2007-08-01 Thread John Costello
On Tue, 31 Jul 2007, Russ wrote:

> Over time the need to connect to the same database in different
> scripts became apparent.  To do this I began by creating a package
> that contained all the $dbh handles (not advisable) as if one fails
> then your whole script is no good.   So I then split them into
> individual packages for each connect handler.  Again not good if you
> need to connect to multiple databases in your script, but aren't
> dependent on all of them having to work.
> 
> So is there a good way to manage database connections only.  So that
> multiple scripts can use the same connection  but it is defined in the
> one place.  Should I explore DBI::Ingres.  or is there another easier
> way, other than defining the connection in each script I create.


If I understand right, you want to create you database handle ($dbh) and 
then have multiple scripts use that same $dbh, right?  If so, read on; if 
not, the talks linked below may still be useful.

Tim talked about caching database handles (and other things) and their 
gotchas in his Advanced DBI talk, which he posted to the list earlier.

Two things come to mind off the top of my head, both really based on Tim's 
talks, which I recommend that you peruse:

<http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI_AdvancedTalk_200708.pdf>
<http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/Gofer-200707.pdf>

One approach would be to have a parent script that creates the database 
handle and then manages all of the other scripts.  This assumes several 
things about what you are doing, and may not be practical to you.  I 
suppose you could launch a separate script that maintains the $dbh and 
allows the other scripts to communicate to it.

Another approach is that the scripts are called from Apache, then it seems
that it is possible to share the $dbh between processes.

I'm still looking at DBI::Gofer, and can't say with confidence that it 
would work for this situation.

John



Re: Slides of my DBD::Gofer talk at OSCON

2007-07-29 Thread John Costello
On Sat, 28 Jul 2007, Tim Bunce wrote:
> Here are the slides for my conference session about Gofer,
> the new scalable stateless proxy for DBI:
> 
> http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/Gofer-200707.pdf

*tips hat in appreciation*

I attended your Advanced DBI tutorial, but missed the full Gofer talk
(though I caught your lightning talk).  I appreciate having the chance to
look over the slides.

John



RE: datatype error

2007-07-27 Thread Moon, John
-Original Message-
From: Craig Metzer [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 26, 2007 6:36 PM
To: dbi-users@perl.org
Subject: datatype error

I'm getting an error trying to run an insert action due to the DATE or
DATETIME datatype.  I couldn't find anything on it, and was wondering if
anyone could point me in the right direction -- Thanks
 
I'm trying to run an insert ... the date value is giving me errors.
Here's the code:
 
 
  my $sql = qq{ INSERT INTO perfdata VALUES ( ?, ?, ?, ?, ?, ? ) };
  my $sth = $dbh->prepare( $sql );
  for ( @record ) {
eval {
  $sth->bind_param( 1, @$_->[0], SQL_VARCHAR );
  $sth->bind_param( 2, @$_->[1], SQL_VARCHAR );
  $sth->bind_param( 3, @$_->[2], SQL_DATETIME );
  $sth->bind_param( 4, @$_->[3], SQL_INTEGER );
  $sth->bind_param( 5, @$_->[4], SQL_CHAR );
  $sth->bind_param( 6, @$_->[5], SQL_VARCHAR );
  $sth->execute();
  $dbh->commit();
};
if ( $@ ) {
  warn "Database error: $DBI::errstr\n";
  $dbh->rollback();  #just die if rollback is failing
}
  }
  $sth->finish();
 
where record is:
 
push @record, [$src_swt, $dst_swt, otime(), $latency, $reachability,
$path];
 
sub otime {
  my $m = (split /\s/, gmtime)[1];
  my ($seconds, $minutes, $hours, $day_of_month, $month,
   $year, $wday, $yday, $n) = gmtime;
  if ($hours > 12) {
$hours -= 12;
$n = 'PM';
  } else {
$n = 'AM';
  }
  return sprintf("%04d-%02d-%02d %02d:%02d:%02d",
  $year+1900, $month, $day_of_month, $hours, $minutes, $seconds) . "
$n";
}
 
results in:
SQL type 9 for ':p3' is not fully supported, bound as SQL_VARCHAR
instead at ./atmping.pl line 124.  
DBD::Oracle::st execute failed: ORA-01861: literal does not match format
string 
...
 
I also tried 24 hr time format resulting in the same error:
...


Not sure why you are doing "eval"... plus I've rarely had to bind with
the "type" for Oracle... 

But to the date issue... it has been my experience that you either set
the date format for the session or add a "to_date" function to the sql
then bind the "string" data (date) and let Oracle do the work... at
least that's easier for me... 

Example:

...
$sth->prepare(q{select to_date(?,'Mon-') as First_of_Month from
dual}) or die"...";
$sth->execute('Jul-2007') or die "...";
($bom) = $sth->fetch;
...
Or...

$sth->prepare(q{select add_months(to_date(?,'Mon-'),1) - 1 as
lastDay from dual}) or die"...";
$sth->execute() or die "...";
Foreach my $date ('Jan-2007', 'Feb-2007', ...) {
$sth->bind_param($date);
my ($eom) = $sth->fetch;
}

Not tested...

Hope this helps...

jwm


Re: [DBD::Oracle] Familiar error to someone?

2007-07-20 Thread John Scoles
Itanium could be a 32/64 bit problem 
did you compiled all your code useing 32 bit libs?



- Original Message - 
From: "Robert Hicks" <[EMAIL PROTECTED]>

To: 
Sent: Friday, July 20, 2007 8:03 AM
Subject: [DBD::Oracle] Familiar error to someone?


We have a mixed C/Perl/XS application that we are moving to the Itanium. 
After we compile everything and start it up after every SELECT statment 
we are getting:


***glibc detected *** free(): invalid next size(fast): given> ***

Aborted

We are using:

HP rx2620 with Itanium processors
Perl 5.6.2
DBD::Oracle 1.17
DBI 1.56

Should we move up to the latest DBD::Oracle to fix? This doesn't happen 
on the PA-RISC box running DBI 1.14 with the same version DBD::Oracle.


Robert



Re: float bug? perl 5.8, DBI and oracle 10.2.0

2007-07-19 Thread John Scoles
Here is the test again. Same DB and same version of  DBI, DBD::Oracle and 
the Oracle client but this time on a Lunix box


[EMAIL PROTECTED] wwwtest]$ perl x.pl
bin: 0011100010101001011010010001101001110101110011010001
connecting
bin: 0011100010101001011010010001101001110101110011010001
[EMAIL PROTECTED] wwwtest]$
[EMAIL PROTECTED] wwwtest]$ perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
 Platform:
   osname=linux, osvers=2.6.9-34.0.2.el.jmm1, 
archname=i386-linux-thread-multi
   uname='linux roark.whiteboxlinux.org 2.6.9-34.0.2.el.jmm1 #1 fri nov 10 
16:42:55 cst 2006 i686 athlon i386 gnulinux '
   config_args='-des -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686 -Dmyhostname=localhost 
[EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, 
Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr 
-Dsiteprefix=/usr -Dotherlibdirs=/usr/lib/perl5/5.8.0 -Duseshrplib -Dusethreads 
-Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm 
-Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 
-Uversiononly -Dpager=/usr/bin/less -isr'

   hint=recommended, useposix=true, d_sigaction=define
   usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define

   useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
   use64bitint=undef use64bitall=undef uselongdouble=undef
   usemymalloc=n, bincompat5005=undef
 Compiler:
   cc='gcc', ccflags 
='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing 
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',

   optimize='-O2 -g -pipe -march=i386 -mcpu=i686',
   cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing 
-I/usr/local/include -I/usr/include/gdbm'
   ccversion='', gccversion='3.2.3 20030502 (Red Hat Linux 3.2.3-54)', 
gccosandvers=''

   intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
   d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
   ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8

   alignbytes=4, prototype=define
 Linker and Libraries:
   ld='gcc', ldflags =' -L/usr/local/lib'
   libpth=/usr/local/lib /lib /usr/lib
   libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
   perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
   libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so
   gnulibc_version='2.3.2'
 Dynamic Linking:
   dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, 
ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE'

   cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
 Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES 
PERL_IMPLICIT_CONTEXT

 Locally applied patches:
   MAINT18379
 Built under linux
 Compiled at Dec 21 2006 18:39:03
 @INC:
   /usr/lib/perl5/5.8.0/i386-linux-thread-multi
   /usr/lib/perl5/5.8.0
   /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
   /usr/lib/perl5/site_perl/5.8.0
   /usr/lib/perl5/site_perl
   /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
   /usr/lib/perl5/vendor_perl/5.8.0
   /usr/lib/perl5/vendor_perl
   /usr/lib/perl5/5.8.0/i386-linux-thread-multi
   /usr/lib/perl5/5.8.0
   .
[EMAIL PROTECTED] wwwtest]$



- Original Message - 
From: "John Scoles" <[EMAIL PROTECTED]>

To: <[EMAIL PROTECTED]>; "Martin Evans" <[EMAIL PROTECTED]>
Cc: 
Sent: Thursday, July 19, 2007 7:56 AM
Subject: Re: float bug? perl 5.8, DBI and oracle 10.2.0



Well maybe it is time if piped up.

I ran the code in x.pl as well and just to add some more fuel to the fier 
I

ran it in activestate perl on a windows XP box.

I will try it on some different boxes as well

Here are my results

C:\johns\testperl>perl x.pl
bin: 001110001010100101101001000110100111010111001101
connecting
bin: 001110001010100101101001000110100111010111001101

Now here is what I ran it on

select * from v$version

Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production

and the perl -V


Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
 Platform:
   osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
   uname=''
   config_args='undef'
   hint=recommended, useposix=true, d_sigaction=undef
   usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
   useperlio=define d_sfio=undef uselargefiles=define useso

Re: float bug? perl 5.8, DBI and oracle 10.2.0

2007-07-19 Thread John Scoles

Well maybe it is time if piped up.

I ran the code in x.pl as well and just to add some more fuel to the fier I
ran it in activestate perl on a windows XP box.

I will try it on some different boxes as well

Here are my results

C:\johns\testperl>perl x.pl
bin: 001110001010100101101001000110100111010111001101
connecting
bin: 001110001010100101101001000110100111010111001101

Now here is what I ran it on

select * from v$version

Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production

and the perl -V


Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
 Platform:
   osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
   uname=''
   config_args='undef'
   hint=recommended, useposix=true, d_sigaction=undef
   usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
   useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
   use64bitint=undef use64bitall=undef uselongdouble=undef
   usemymalloc=n, bincompat5005=undef
 Compiler:
   cc='cl', ccflags
='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DE
S_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT 
-DPERL_IMPLICIT_SYS
-DUSE_PERLIO
-DPERL_MSVCRT_READFIX',
   optimize='-MD -Zi -DNDEBUG -O1',
   cppflags='-DWIN32'
   ccversion='12.00.8804', gccversion='', gccosandvers=''
   intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
   d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
   ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64',
lseeksize=8
   alignbytes=8, prototype=define
 Linker and Libraries:
   ld='link', ldflags
'-nologo -nodefaultlib -debug -opt:ref,icf  -libpath:"C:\Perl\lib\CORE"  -ma
chine:x86'
   libpth=\lib
   libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib sh
ell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib mpr.lib
winmm.lib  version.lib od
bc32.lib odbccp32.lib msvcrt.lib
   perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.li
b shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib
mpr.lib winmm.lib  version.li
b odbc32.lib odbccp32.lib msvcrt.lib
   libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
   gnulibc_version=''
 Dynamic Linking:
   dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
   cccdlflags=' ',
lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf  -libpath:"C:\Perl\lib
\CORE"  -machine:x86'


Characteristics of this binary (from libperl):
 Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
   PERL_IMPLICIT_SYS PERL_MALLOC_WRAP
   PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES
   USE_PERLIO USE_SITECUSTOMIZE
 Locally applied patches:
   ActivePerl Build 820 [274739]
   Iin_load_module moved for compatibility with build 806
   PerlEx support in CGI::Carp
   Less verbose ExtUtils::Install and Pod::Find
   Patch for CAN-2005-0448 from Debian with modifications
   Rearrange @INC so that 'site' is searched before 'perl'
   Partly reverted 24733 to preserve binary compatibility
   29930 win32.c typo in #define MULTIPLICITY
   29868 win32_async_check() can still loop indefinitely
   29690,29732 ANSIfy the PATH environment variable on Windows
   29689 Add error handling to win32_ansipath
   29675 Use short pathnames in $^X and @INC
   29607,29676 allow blib.pm to be used for testing Win32 module
   29605 Implement killpg() for MSWin32
   29598 cwd() to return the short pathname
   29597 let readdir() return the alternate filename
   29590 Don't destroy the Unicode system environment on Perl startup
   29528 get ext/Win32/Win32.xs to compile on cygwin
   29509,29510,29511 Move Win32::* functions into Win32 module
   29483 Move Win32 from win32/ext/Win32 to ext/Win32
   29481 Makefile.PL changes to compile Win32.xs using cygwin
   28671 Define PERL_NO_DEV_RANDOM on Windows
   28376 Add error checks after execing PL_cshname or PL_sh_path
   28305 Pod::Html should not convert "foo" into ``foo''
   27833 Change anchor generation in Pod::Html for '=item item 2'
   27832,27847 fix Pod::Html::depod() for multi-line strings
   27719 Document the functions htmlify() and anchorify() in Pod::Html
   27619 Bug in Term::ReadKey being triggered by a bug in
Term::ReadLine
   27549 Move DynaLoader.o into libperl.so
   27528 win32_pclose() error exit doesn't unlock mutex
   27527 win32_async_check() can loop indefinitely
   27515 ignore directories when searching @INC
   27359 Fix -d:Foo=bar syntax
   27210 Fix quote typo in c2ph
   27203 Allow compiling swigged C++ cod

Re: Re: float bug? perl 5.8, DBI and oracle 10.2.0

2007-07-11 Thread John Scoles
The is an old old problem.  I ran into it once many many moons ago working 
with an Access report using ODBC on an Oracle 7 table.

The Access report was summing up about 200k records and one field was a FP 
number.  All of the records that had a field value of 0 Access just could 
not see it as 0 and on the sum we were allways getting a sum of  1 or 2 more 
that we were suppse to get.  Looking at is line by line we finally sumbled 
on it.
Access was seeing an Oracle FP 0 as .0001( or alike) and the sum would 
add these up and spoil out totals.

I had a quick look at the DBD::Oracle code and it would be a nightmare to 
try and do some sort of conversion to a signed doubble or single in C for 
retruned FP and then to PERL. Taking all the dada and cating them to a 
string is the only way to handle it so it will work pratically.
One would have to deal with DATES, TIMESTAMPS, NUMBER, NUMBER(38),TINY_INT 
and god knows what else.

Cheers
John Scoles




""Rutherdale, Will"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
I admire Peter's effort in tracking down the specifics at various
conversion points.

However, there are no documented guarantees of equality from the
library.  I hope you're not seriously considering jigging the libraries
to make your program work.  If you do that, you'll run up against the
same problem next release.

The more stable solution would be to change your program so it doesn't
depend on equality.  Rather you could create a function floatEqual() or
floatZero() that tests whether two float values are nearly equal in
relative terms, or close to zero, without requiring that they be exactly
equal or zero.  Then replace the == operator in your application code
with those function calls.

I bet it would be less work to use that solution than to jig the
libraries.

Besides, there are many floating point conversion points, including the
compiler itself, that can change with a new release.

-Will


> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Erwan Lemonnier
> Sent: Wednesday 11 July 2007 04:29
> To: dbi-users@perl.org; [EMAIL PROTECTED]
> Subject: Re: Re: float bug? perl 5.8, DBI and oracle 10.2.0
>
>
> Taking up on Peter's answer to
> http://www.nntp.perl.org/group/perl.dbi.users/2007/07/msg31663.html:
>
> > This is peculiar, though. DBD::Oracle gets the number from
> the database
> > as a string (this can be confirmed with Devel::Peek::Dump),
> so the above
> > code should be equvialent to:
> >
> >  my ($val) = ('1.73696');
> >
> >  my $sum = 1.73696 - $val;
> >  is($sum,0,"does sum $sum == 0?");
>
> That's indeed what I thought. I tried. But as you mention
> below, it isn't.
>
> > However, it isn't, for some reason, and I can't see the difference
> > (upgrading $val to utf8 doesn't make a difference).
> >
> > Why does perl convert the string '1.73696' to
> >
> > 001110001010100101101001000110100111010111001101
> >
> > if it comes from an Oracle database, but convert it to
> >
> > 0011100010101001011010010001101001110101110011010001
> >
> > if it is hard coded in the script or read from a file?
>
> Thanks! I think you just put your finger on the core of the problem!
> This is the very reason why I turned toward the DBI list in the first
> hand.
>
> Note that the trailing bit is most probably the one that gets
> interpreted as 2^-52 (2.22044604925031e-16) in the faulty $sum result.
>
> I would like to check what binary representation perl 5.6.2 returns
> for that same string when fetched from the database. How did you get
> the binary strings above?
> It itches me that the computation gives the correct result in perl
> 5.6.2 but not 5.8.8.
>
> The next question would be: what is in charge of converting the data
> representation fetched from oracle into perl's native float (leading
> to the binary representation you listed above). Would that be
> DBD::Oracle? or DBI? or perl itself?
>
> /Erwan Lemonnier
>



 - - - - - Appended by Scientific Atlanta, a Cisco company - - - - -
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: DBI-Help

2007-07-09 Thread John Scoles
Look like someone changed the access DB itself.  If memory serves me corect 
there are setting in Access that can prohibit remote usage.
I would try creating a new Access DB just to test to see if you can connect 
with it.


Also you may have to do some configuration with IIS to get it to server up 
perl pages.  I know you have to load a .dll of some sort an with the latest 
version if IIS thre are somve fancy controls thay you might have to set up 
first to get perl pages served up.



- Original Message - 
From: "Samuel Zheng - keunghing.com" <[EMAIL PROTECTED]>

To: 
Sent: Monday, July 09, 2007 5:46 AM
Subject: DBI-Help



Hi DBI Guru,

I am hoping someone will point me to right direction.

I am using WindowsXP and IIS is running. ActivePerl 5.8.8 build 817 is
installed, dbd-odbc 1.13 is also installed. The problem I have is it fails
to open an access97 database, I used odbcad32.exe to define a DSN, I put 
in

the user as admin and its password accordingly and it can be opened by my
crystal report writer.

The problem was not there before.  I can developed many different pages in
Perl before it stopped working. and I don't know why it stopped. I have 
exhausted

everything I can do (inclding reinstall perl) but no avail. Hope you can
give me a hint . Thank you in advance. The following is the line it 
failed:


$dbh = DBI->connect($dsn,$user,$pswrd,$driver,{RaiseError=>1}) or die
"Database connection not made: $DBI::errstr";

the error is:
DBI connect('btn','',...) failed: [Microsoft][ODBC Microsoft Access 
Driver]

Disk or network error. (SQL-HY000)(DBD: db_login/SQLConnect err=-1) at
C:\ButtonS\khoffice\pwschedule.pl line 43

The script  worked before but not now. I don't know why. Definitely 
something happened to my computer but I don't know what. please help. I 
disable the firewall, I shared the foler, I recreated the DSN and I 
reinstalled everything but no use. What else should I tried?


Samuel Zheng






Re: Error while installing odbc.pm

2007-07-08 Thread John Costello
On Sun, 8 Jul 2007, Ron Savage wrote:
> Rohini Krishnan wrote:
> 
> Hi Rohini
> 
> > E:\Perl\DBD-ODBC-1.13>perl makefile.pl
> 
> Ahh, Windows.

Ahh, yes.  
 
> > E:\Perl\DBD-ODBC-1.13>make
> 
> Err, you have to use nmake or dmake under Windows, right?

Probably.  There is GNU Make for Windows, 
, though it isn't apparent what 
version the OP is using.  There's also unixutils, from 
.  However, these seem to support 
forward and backward slashes.

ActiveState properly generates a Makefile, at least with regard to the
"PERL =" and "FULLPERL =" paramters, listing perl at C:\Perl\bin\perl.exe
(ActiveState 5.8.8 on Windows XP SP 2 in my case).








Re: DBD::Oracle using 64bit oracle libraries

2007-07-06 Thread John Scoles

common problem one I will fix as soon as I get a 64 bit box

here is some readme stuff the might pooint you in the right direction

In general compiling DBD:Oracle for 64 bit machines has been a hit or miss 
operation.
The main thing to remember is you will have to compile using 32 bit Perl and 
compile DBD::Oracle against a 32bit client

which sort of defeats the purpose of having a 64bit box.
So until 64bit Perl comes out we will be posing in this README any success 
stories we have come across



Source:Tom Reinertson
Platform:Amd64
OS:Gentoo-amd64

The following instructions work for dbd::oracle 1.19 on a gentoo-amd64 
installation.


1) install the oracle libraries

Strictly speaking you only need dev-db/oracle-instantclient-basic
for dbd::oracle, but i always like to have sql*plus lying around,
which requires the basic package, so i just install sql*plus.

emerge dev-db/oracle-instantclient-sqlplus which also pulls in
dev-db/oracle-instantclient-basic.  these packages are fetch
restricted so you will be required to follow the download instructions.
following these instructions, you should have retrieved these packages:

instantclient-basic-linux-x86-64-10.2.0.3-20070103.zip
instantclient-sdk-linux-x86-64-10.2.0.3-20070103.zip
instantclient-sqlplus-linux-x86-64-10.2.0.3-20070103.zip

now move them into the /usr/portage/distfiles directory.

you should now be able to emerge dev-db/oracle-instantclient-sqlplus.

2) install DBD::Oracle

issue the command:

 perl -MCPAN -e'install DBD::Oracle'

this fails with the following error:

 x86_64-pc-linux-gnu-gcc: unrecognized option '-wchar-stdc++'
 x86_64-pc-linux-gnu-gcc: unrecognized option '-cxxlib-gcc'
 cc1: error: /ee/dev/bastring.h: No such file or directory

find the offending files in your cpan directory:
 {~/.cpan/build/DBD-Oracle-1.19} grep -lr cxxlib *
 Makefile
 blib/arch/auto/DBD/Oracle/mk.pm
 mk.pm

edit these files and remove the two invalid options and the include of 
bastring.h.


now build the module:

 perl Makefile.PL -l
 make
 # make test generates lots of errors
 make test
 make install

you should now be ready to run.



- Original Message - 
From: "Dan King" <[EMAIL PROTECTED]>

To: 
Sent: Friday, July 06, 2007 2:29 PM
Subject: DBD::Oracle using 64bit oracle libraries


Hi,



I am trying to use DBD ::Oracle for a software package called OTRS. A 
problem I am running into is that perl seems to be trying to use the 64 bit 
library file called libclntsh.so.10.1 located on my computer in the 
directory /u01/app/oracle/product/10.1.0/db_3/lib/ and I need it to use the 
32 bit library file located in /u01/app/oracle/product/10.1.0/db_3/lib32




Does anyone know how I go about changing where it looks for the libclntsh.so 
file?




Thanks for any help provided.



Dan King
Software Developer
Canadian Resident Matching Service
613.237.0075  ext. 241
(Toll free) 877.CARMS.42
171 Nepean Street, Suite 300
Ottawa, ON, CANK2P 0B4
www.carms.ca 



This e-mail message, including any attachments, is for the sole use of the 
intended recipients and may contain confidential and or privileged 
information.  If you are not the intended recipient or this information has 
been forwarded in error, please contact the sender by reply e-mail and 
destroy copies of the original message.  Ce message (incluant toute pièce 
jointe) s'adresse uniquement au(x) destinataire(s) prévu(s) ou à une 
personne autorisée à le recevoir en son (leur) nom. Il pourrait contenir des 
renseignements confidentiels ou protégés.  Si vous l'avez reçu par erreur, 
nous vous prions d'en informer l'auteur dans les meilleurs délais, de ne pas 
divulguer son contenu et de le supprimer de votre système. Merci.







Re: problems inserting a utf8 timestamp with DBD::Oracle

2007-07-05 Thread John Scoles

I think the key is
"Oracle client 9.2.0.4.0" with "Oracle server 9.2.0.7.0, 10.2.0.3.0"

seems this only  pepps its head up when using this combination

can you recreate it using the "instant client" and "Oracle server 9.2.0.7.0, 
10.2.0.3.0"??


If it is a bug in Oracle (No!!! say it isn't so ... Not possiable??)  we 
will ever see a patch for it


- Original Message - 
From: "Garrett, Philip (MAN-Corporate)" <[EMAIL PROTECTED]>

To: "Martin Evans" <[EMAIL PROTECTED]>; 
Sent: Thursday, July 05, 2007 1:48 PM
Subject: RE: problems inserting a utf8 timestamp with DBD::Oracle


Martin Evans wrote:

Hoping someone can help me here as I'm really stuck with this. I
have a large amount of code which reads some XML and inserts data
from the XML into a database. One particular insert fails:


[snip]

After much head scratching I discovered the problem P4 has utf8 set
on it and downgrading it makes the code work i.e. when utf8::is_utf8
returns 1 on the timestamp scalar it fails and if I do a
utf8::downgrade(scalar) on it before calling execute it works.


I think you've triggered this bug:
http://www.mail-archive.com/dbi-users@perl.org/msg26927.html


I've read that but I don't see the resolution.


There wasn't an official one, afaik. :-/



If I remember correctly, the fix is to set ora_ph_csform:

  use DBD::Oracle qw(SQLCS_NCHAR);
  ...
  # default for all future placeholders
  $dbh->{'ora_ph_csform'} = SQLCS_NCHAR;


I've tried that - no luck :-(


Surprisingly, setting ora_ph_csform as above actually *caused* the
problem for me.  See below...



The bug only manifests when you bind a utf8-on value to a statement
parameter that was originally bound to a non-utf8 value.


The whole DBI interaction is:

$do = ['begin dbms_output.enable(:1); end;',undef,2];
do: 'alter session set nls_timestamp_format = '-mm-dd hh24:mi:ss''
do: 'alter session set nls_date_format = '-mm-dd''
prepare_cached: 'select * from document where id = ?'
execute: ""
finish

The following is generated with a brand new statement handle:

prepare_cached:
'insert into document
(book,category,country,expiry,id,last_update,mnem,name,ode
c,route,source,tdate,ttimestamp,ttype,version)
values(?,?,?,?,?,?,?,?,?,?,?,?,?,
?,?)'
$execute = ['SD','HR','UK','2017-07-08
14:10:00','XXX','1183290197812','ES','X','N',
'534453','XX','2007-07-01','1183269593843','XX','X'];

I've even tried disconnecting just before the prepare_cached call and
reconnecting or opening a brand new connection for the prepare_cached
call - still no luck. So either, it is not the same bug or the
resolution is not quite right.


I think you're right. It's a different bug, but I'd wager it's related.

The attached script reproduces the problem reliably on my system. There
are three lines in the script that will trigger the error when
uncommented: lines 11, 12, and 19.

The problem manifests on (at least):
 DBI 1.50
 DBD::Oracle 1.18, 1.19
 Oracle client 9.2.0.4.0
 Oracle server 9.2.0.7.0, 10.2.0.3.0

What's *really* strange is that if I remove the "dt" column from the
table, and run the script using only the "ts" timestamp column, there
is no error.

- Philip


#!/usr/bin/env perl
use strict;
use warnings;

use DBI;
use DBD::Oracle qw(SQLCS_NCHAR);
use Encode qw(decode);
use utf8;

# uncomment either one of these to trigger error
#$ENV{'NLS_LANG'}  = 'AMERICAN_AMERICA.AL32UTF8';
#$ENV{'NLS_NCHAR'} = 'AL32UTF8';

my $dbh = DBI->connect( undef, undef, undef, # $ENV{DBI_DSN}, etc.
   { AutoCommit => 1, RaiseError => 1, PrintError => 0 })
   || die $DBI::errstr;

# or, uncomment this to trigger error
#$dbh->{ora_ph_csform} = SQLCS_NCHAR;

eval { $dbh->do('drop table utf8test cascade constraints'); };
$dbh->do('create table utf8test (dt date, ts timestamp)');

my $fmt = '-MM-DD HH24:MI:SS';
$dbh->do("alter session set nls_date_format = '$fmt'");
$dbh->do("alter session set nls_timestamp_format = '$fmt'");

my $dml = 'insert into utf8test (dt,ts) values (?,?)';
my $sth = $dbh->prepare($dml);

my $utf8_date = decode('utf8','2007-07-05 12:00:00');
$sth->execute($utf8_date, $utf8_date);



<    1   2   3   4   5   6   7   8   9   10   >