Re: MS ACCESS text field truncated

2004-03-05 Thread Jason
Hi Tim,

The doc says LongTruncOK and LongReadLen have nothing to do with writing
data into DB. They are only for reading. In addition, I am dealing with
Text type data in MS ACCESS, not LONG type.

Thanks,
J.

Tim Johnson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

Look in the docs for the $dbh-LongTruncOk and $dbh-LongReadLen
properties.

-Original Message-
From: Jason Q. [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 12:50 PM
To: [EMAIL PROTECTED]
Subject: MS ACCESS text field truncated

Hi there,

I am using DBI to access Microsoft ACCESS database. I found the data of
text field logged by DBI has been truncated to 50 characters. I have
changed the field size from 50 to 255, but it still doesn't work. Anyone
can help?

Thanks,
J.




RE: [cpan #5556] make test cause core dump when perl(5.8.2) built with both use64bitint and usethreads options

2004-03-05 Thread Henry . Gao
1. logs for following are attached
   perl Makefile.PL -vmake.perl.log
   make   make.make.log
   make test  make.test.log
2. Oracle is v9.2.0.1.0-32bit
3. $ perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
  Platform:
osname=solaris, osvers=2.8, archname=sun4-solaris-thread-multi-64int
uname='sunos sy1p334cmp 5.8 generic_108528-12 sun4u sparc sunw,ultra-80 '
config_args='-Dprefix=/sbcimp/run/pd/perl/5.8.2 
-Dprivlib=/sbcimp/run/pd/perl/5.8.2/lib -Darchlib=/sbcimp/run/pd/perl/5.8.2/lib 
-Dsitelib=/sbcimp/run/pd/perl/5.8.2/lib -Dsitearch=/sbcimp/run/pd/perl/5.8.2/lib 
-Dlocincpth=/sbcimp/run/pd/gdbm/1.8.3/include 
-Dloclibpth=/sbcimp/run/pd/gdbm/1.8.3/lib -Dcc=gcc -Duse64bitint -Dusethreads 
-Uinstallusrbinperl [EMAIL PROTECTED] [EMAIL PROTECTED] -des'
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=define use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='gcc', ccflags ='-D_REENTRANT -fno-strict-aliasing 
-I/sbcimp/run/pd/gdbm/1.8.3/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O',
cppflags='-D_REENTRANT -fno-strict-aliasing -I/sbcimp/run/pd/gdbm/1.8.3/include'
ccversion='', gccversion='3.1', gccosandvers='solaris2.8'
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='gcc', ldflags =' -L/sbcimp/run/pd/gdbm/1.8.3/lib '
libpth=/sbcimp/run/pd/gdbm/1.8.3/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -lgdbm -ldl -lm -lpthread -lc
perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G -L/sbcimp/run/pd/gdbm/1.8.3/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_64_BIT_INT USE_LARGE_FILES 
PERL_IMPLICIT_CONTEXT
  Built under solaris
  Compiled at Jan 16 2004 13:24:51
  %ENV:
PERLLIB=/sbcimp/run/pd/cpan/5.8.2-2004.01/lib/
  @INC:
/sbcimp/run/pd/cpan/5.8.2-2004.01/lib/
/sbcimp/run/pd/perl/5.8.2/lib
/sbcimp/run/pd/perl/5.8.2/lib
/sbcimp/run/pd/perl/5.8.2/lib
/sbcimp/run/pd/perl/5.8.2/lib
.
4. $ gdb /sbcimp/run/pd/perl/5.8.2/bin/perl core
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for details.
This GDB was configured as sparc-sun-solaris2.8...
Core was generated by `/sbcimp/run/pd/perl/5.8.2/bin/perl -w t/select.t'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
Reading symbols from /usr/lib/libnsl.so.1...done.
Loaded symbols for /usr/lib/libnsl.so.1
Reading symbols from /usr/lib/libdl.so.1...done.
Loaded symbols for /usr/lib/libdl.so.1
Reading symbols from /usr/lib/libm.so.1...done.
Loaded symbols for /usr/lib/libm.so.1
Reading symbols from /usr/lib/libpthread.so.1...done.
Loaded symbols for /usr/lib/libpthread.so.1
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
Reading symbols from /usr/lib/libmp.so.2...done.
Loaded symbols for /usr/lib/libmp.so.2
Reading symbols from /usr/platform/SUNW,Ultra-2/lib/libc_psr.so.1...done.
Loaded symbols for /usr/platform/SUNW,Ultra-2/lib/libc_psr.so.1
Reading symbols from /usr/lib/libthread.so.1...done.
Loaded symbols for /usr/lib/libthread.so.1
Reading symbols from /sbcimp/run/pd/cpan/5.8.2-2004.01/lib//auto/DBI/DBI.so...done.
Loaded symbols for /sbcimp/run/pd/cpan/5.8.2-2004.01/lib//auto/DBI/DBI.so
Reading symbols from 
/home/sca/.cpan/build.sol8-perl-mt32/DBD-Oracle-1.15/blib/arch/auto/DBD/Oracle/Oracle.so...done.
Loaded symbols for 
/home/sca/.cpan/build.sol8-perl-mt32/DBD-Oracle-1.15/blib/arch/auto/DBD/Oracle/Oracle.so
Reading symbols from 
/sbcimp/run/tp/oracle/client/v9.2.0.1.0-32bit/lib//libclntsh.so.9.0...done.
Loaded symbols for /sbcimp/run/tp/oracle/client/v9.2.0.1.0-32bit/lib//libclntsh.so.9.0
Reading symbols from /usr/lib/libgen.so.1...done.
Loaded symbols for /usr/lib/libgen.so.1
Reading symbols from /usr/lib/libsched.so.1...done.
Loaded symbols for /usr/lib/libsched.so.1
Reading symbols from /usr/lib/libaio.so.1...done.
Loaded symbols for /usr/lib/libaio.so.1
Reading symbols from 

[Fwd: Réf. : Re: Problem with DBD::Oracle]

2004-03-05 Thread Michael A Chase
Keep this on the list, not private email.

 Original Message 
Subject: Réf. : Re: Problem with DBD::Oracle
Date: Fri, 5 Mar 2004 09:41:36 +0100
From: [EMAIL PROTECTED]
To: Michael A Chase [EMAIL PROTECTED]
Hi

this is the completed error message when I do the make test

Thank's

Sébastien

make test
gcc -c  -I. -I/home/oracle/product/precomp/public
-I/home/oracle/product/rdbms/public -I/home/oracle/product/rdbms/demo
-I/home/oracle/product/plsql/public -I/home/oracle/product/network/public
-I/home/oracle/product/rdbms/demo -I/home/oracle/product/rdbms/demo
-I/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/auto/DBI
-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/include/gdbm -O2 -fomit-frame-pointer -pipe -march=i586
-mcpu=pentiumpro   -DVERSION=\1.15\ -DXS_VERSION=\1.15\ -fPIC
-I/usr/lib/perl5/5.8.1/i386-linux-thread-multi/CORE  -DUTF8_SUPPORT
Oracle.c
In file included from Oracle.h:20,
 from Oracle.xs:1:
dbdimp.h:44:20: ocidfn.h: No such file or directory
dbdimp.h:57:21: ociapr.h: No such file or directory
In file included from Oracle.h:20,
 from Oracle.xs:1:
dbdimp.h:111: error: syntax error before Lda_Def
dbdimp.h:111: warning: no semicolon at end of struct or union
dbdimp.h:112: warning: data definition has no type or storage class
dbdimp.h:120: error: syntax error before '}' token
dbdimp.h:144: error: syntax error before Cda_Def
dbdimp.h:144: warning: no semicolon at end of struct or union
dbdimp.h:145: warning: data definition has no type or storage class
dbdimp.h:171: error: syntax error before '}' token
dbdimp.h:304: error: syntax error before Lda_Def
In file included from Oracle.c:53:
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/auto/DBI/Driver_xst.h:
 In function `dbdxst_bind_params':
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/auto/DBI/Driver_xst.h:48:
 error: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/auto/DBI/Driver_xst.h:49:
 error: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/auto/DBI/Driver_xst.h:53:
 error: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/auto/DBI/Driver_xst.h:54:
 error: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/auto/DBI/Driver_xst.h:55:
 error: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/auto/DBI/Driver_xst.h:
 In function `dbdxst_fetchall_arrayref':
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/auto/DBI/Driver_xst.h:80:
 error: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/auto/DBI/Driver_xst.h:81:
 error: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi/auto/DBI/Driver_xst.h:88:
 error: dereferencing pointer to incomplete type
Oracle.xsi: In function `XS_DBD__Oracle__db_selectall_arrayref':
Oracle.xsi:135: error: dereferencing pointer to incomplete type
Oracle.xsi: In function `XS_DBD__Oracle__db_selectrow_arrayref':
Oracle.xsi:170: error: dereferencing pointer to incomplete type
Oracle.xsi: In function `XS_DBD__Oracle__db_commit':
Oracle.xsi:249: error: dereferencing pointer to incomplete type
Oracle.xsi:249: error: dereferencing pointer to incomplete type
Oracle.xsi: In function `XS_DBD__Oracle__db_rollback':
Oracle.xsi:259: error: dereferencing pointer to incomplete type
Oracle.xsi:259: error: dereferencing pointer to incomplete type
Oracle.xsi: In function `XS_DBD__Oracle__db_disconnect':
Oracle.xsi:269: error: dereferencing pointer to incomplete type
Oracle.xsi:273: error: dereferencing pointer to incomplete type
Oracle.xsi:274: error: dereferencing pointer to incomplete type
Oracle.xsi:275: error: dereferencing pointer to incomplete type
Oracle.xsi:279: error: dereferencing pointer to incomplete type
Oracle.xsi:279: error: dereferencing pointer to incomplete type
Oracle.xsi:281: error: dereferencing pointer to incomplete type
Oracle.xsi:283: error: dereferencing pointer to incomplete type
Oracle.xsi:287: error: dereferencing pointer to incomplete type
Oracle.xsi:287: error: dereferencing pointer to incomplete type
Oracle.xsi:287: error: dereferencing pointer to incomplete type
Oracle.xsi: In function `XS_DBD__Oracle__db_STORE':
Oracle.xsi:301: error: dereferencing pointer to incomplete type
Oracle.xsi: In function `XS_DBD__Oracle__db_FETCH':
Oracle.xsi:313: error: dereferencing pointer to incomplete type
Oracle.xsi: In function `XS_DBD__Oracle__db_DESTROY':
Oracle.xsi:323: error: dereferencing pointer to incomplete type
Oracle.xsi:325: error: dereferencing pointer to incomplete type
Oracle.xsi:325: error: dereferencing pointer to incomplete type
Oracle.xsi:332: error: dereferencing pointer to incomplete type
Oracle.xsi:333: error: 

RE: Accessing oracle from windows 2000

2004-03-05 Thread Hardy Merrill
Just wanted to let people know what worked for me for connecting to an
Oracle database on a Windows XP platform, using both DBD::ODBC *AND*
DBD::Oracle.  Thanks to Jeff Urlwin for all the help - see Jeff's
suggestions below for reference.  NOTE that my version of ActiveState
Perl is 5.8.2.

  1. Using 'ppm uninstall DBD::ODBC' I uninstalled DBD::ODBC.
  2. Using 'ppm uninstall DBD::Oracle' I uninstalled DBD::Oracle.
  3. Using 'ppm uninstall DBI' I uninstalled DBI.
  4. Did 'ppm install
ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.2/DBI.ppd '
  to install the DBI binary for AS Perl 5.8.2 from Jeff's
repository
  5. Did 'ppm install
ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.2/DBD-ODBC.ppd '
  to install the DBD::ODBC binary for AS Perl 5.8.2 from
Jeff's
  repository.
  6. Did 'ppm install
ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.2/DBD-Oracle.ppd '
   to install the DBD::Oracle binary for AS Perl 5.8.2 from
Jeff's
   repository.

Then for the DBD::Oracle test, I created this small test script:

#!C:\Perl\bin
use strict;
use DBI;

my $dbh = DBI-connect('dbi:Oracle:host=MY_HOST;sid=MY_SID',
  'my_user',
  'my_password',
  { RaiseError = 1, PrintError = 1 }
) || die Can't connect: $dbi::errstr;

print Successful Connect: \$dbh=[$dbh]\n;



And it worked.

Hardy Merrill

 Jeff Urlwin [EMAIL PROTECTED] 03/04/04 03:46PM 
 
 Jeff, I still don't know what my problem is - maybe you can help me.

 How do I know if I have the Oracle client libraries installed 
 on this WinXP machine?  I have a C:\Oracle\Ora81 directory 
 which contains a bunch of folders, so I'm guessing I have at 
 least the client installed. 
 I do have a C:\Oracle\Ora81\network\ADMIN\tnsnames.ora file.
 
 Do you know why I keep getting this error:
 
Error: no suitable installation target found for package 
 DBD-Oracle8.

Yep.  That's a PPM error, not an oracle error.

 
 when I do 'ppm install DBD-Oracle8.ppd' ??  Is it because I'm 
 using an Activestate DBD-Oracle8.zip from the ActivePerl 6xx 
 folder when I actually have ActivePerl 5.8.2 (ActivePerl 8xx) 
 ??  Would your DBI and DBD::Oracle binaries solve my problem? 
  I'm guessing they would ;-)

Probably.  The best thing to do is let me know which version of Perl. 


If you have 5.8.2 perl (build 808?), then you should be able to do
(hmmm...forgot the URL...ah, there it is):

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



 
 Thanks for any input you can give.

Np

Jeff

 
 Hardy Merrill
 
  Jeff Urlwin [EMAIL PROTECTED] 03/04/04 12:32PM 
 Ok -- I thought I'd chime in here.  I *humbly* consider 
 myself knowledgeable about this topic ;).
 
 You can choose to use either DBD::ODBC or DBD::Oracle under 
 windows platforms (with caveats and issues that will be 
 outlined below.  Both will/should work under most 
 circumstances.  However, as the *developer* of DBD::ODBC, I 
 use DBD::Oracle when using an Oracle data source.  It's not 
 that I couldn't use DBD::ODBC, but...
   a) DBD::Oracle is the most reliable and *fastest* 
 method to talk to Oracle.
   b) The Microsoft Oracle ODBC drivers are terribly painful to
use
   c) The Oracle ODBC drivers are a *bit* buggy and 
 nowhere near as fast as DBD::Oracle
   d) YMMV with 3rd party ODBC drivers.  I used 3rd party 
 drivers in 1993 or so, when DBD::Oracle didn't work on the 
 Windows platform.  In fact, using Win32::ODBC and 3rd party 
 Oracle ODBC drivers was what prompted me to help port 
 DBD::Oracle to Windows Perl in the first place...many moons ago
 ;)
 
 As stated above, I *prefer* using DBD::Oracle when connecting 
 to Oracle. You need to have the Oracle client installed -- 
 and licensed -- on your machine.  ActiveState *stopped* 
 directly supporting DBD::Oracle binaries a while ago (after 
 the Perl 5.6.x timeframe and before 5.8.x timeframe). Using 
 anything but a DBD::Oracle built with the same version of 
 perl you are using is likely to be problematic.  Since AS 
 stopped putting up binary versions, I started to.  You can 
 get DBI, DBD::Oracle, DBD::ODBC and DBD::DB2 for current 
 versions of AS Perl (5.8.3) from my repository. 
 If you
 get DBD::XXX from my repos, also ensure you get DBI from my 
 repos.  If you don't, you are at your own risk with the 
 binary compatibility.  I've announced these repositories in 
 the past via [EMAIL PROTECTED] and [EMAIL PROTECTED], so 
 they should be in google too.  
 
 That said, there is a known issue with  9x client libraries 
 with the binaries of DBD::Oracle.  The next version of 
 DBD::Oracle can handle that better, but you may get an error 
 related to the lack of OCILobWriteAppend in earlier Oracle 
 OCI clients...if so, for now, I recommend you update your 
 client while 

Benchmarking Oracle connections on Windoze XP with DBD::ODBC and DBD::Oracle

2004-03-05 Thread Hardy Merrill
I got some interesting results with this benchmark that I'd like some
help interpreting.  This test is on a Windoze XP box comparing:

   ora_odbc_driver (Oracle supplied(?) ODBC driver)
   ms_odbc_driver  (Microsoft supplied ODBC driver)
   ora_dbd_driver   (DBD::Oracle)

Here is my test script:

-
#!C:\Perl\bin

use strict;
use DBI;
use Benchmark qw(timethese cmpthese timeit countit timestr);

sub connect_dbd_oracle {
   my $dbh = DBI-connect('dbi:Oracle:host=myhost;sid=mysid',
  'myuser',
  'mypassword',
  { RaiseError = 1, PrintError = 1 }
   ) || die Can't connect with DBD-Oracle: $dbi::errstr;
}
my $ora_dbd_subref = \connect_dbd_oracle;

sub connect_oracle_ouihome {
   my $dbh = DBI-connect('dbi:ODBC:system_oracle_mysid',
  'myuser',
  'mypassword',
  { RaiseError = 1, PrintError = 1 }
   ) || die Can't connect: $dbi::errstr;
}
my $ora_odbc_subref = \connect_oracle_ouihome;

sub connect_oracle_msodbc {
   my $dbh = DBI-connect('dbi:ODBC:system_msodbc_oracle_mysid',
  'myuser',
  'mypassword',
  { RaiseError = 1, PrintError = 1 }
   ) || die Can't connect: $dbi::errstr;
}
my $ms_odbc_subref = \connect_oracle_msodbc;

timethese 100, {
   'ora_dbd_driver'  = $ora_dbd_subref,
   'ora_odbc_driver' = $ora_odbc_subref,
   'ms_odbc_driver'  = $ms_odbc_subref,
};

cmpthese 100, {
   'ora_dbd_driver'  = $ora_dbd_subref,
   'ora_odbc_driver' = $ora_odbc_subref,
   'ms_odbc_driver'  = $ms_odbc_subref,
};



Here are the results:

Benchmark: timing 100 iterations of ms_odbc_driver, ora_dbd_driver,
ora_odbc_dri
ver...
ms_odbc_driver: 35 wallclock secs ( 2.15 usr +  4.05 sys =  6.21 CPU) @
16.11/s
(n=100)
ora_dbd_driver: 124 wallclock secs ( 1.44 usr +  2.89 sys =  4.34 CPU)
@ 23.06/s
 (n=100)
ora_odbc_driver: 262 wallclock secs ( 3.46 usr +  4.91 sys =  8.37 CPU)
@ 11.94/
s (n=100)
  Rate ora_odbc_driver  ms_odbc_driver  ora_dbd_driver
ora_odbc_driver 11.9/s  ---27%-48%
ms_odbc_driver  16.3/s 37%  ---29%
ora_dbd_driver  22.8/s 92% 40%  --

---

Ok I'm having a brain-fart - can someone clue me in as to how to read
this last section that compares the different methods using percentages?
 Is the 1st column saying that ms_odbc_driver is 37% faster than the
ora_odbc_driver, and the ora_dbd_driver(DBD::Oracle) is 92% faster than
the ora_odbc_driver??  The last 2 columns have me confused too.  Any
help is appreciated.

Thanks.

Hardy Merrill


Réf. : [Fwd: Réf. : Re: Problem with DBD::Oracle]

2004-03-05 Thread s . vachenc

Hi

Thanks for your help, we found the error source. When we installed Oracle
client we don't have the C++ Lib.

Now I have, one another problem with sql syntaxe. I try to translate my
perl script from Mysql to Oracle, but when I excute this script I have this
kind of error


[Fri Mar  5 17:11:19 2004] Telagene_oracle_test.pl: DBD::Oracle::db do
failed: ORA-00911: invalid character (DBD ERROR: error possibly near *
indicator at char 12 in 'INSERT INTO *`BIOEXP`.`genbank_telagene2`
(ac_number,proteine_name,locus_id) VALUES ('AB017100','143T_HUMAN','')')
[for Statement INSERT INTO `BIOEXP`.`genbank_telagene2`
(ac_number,proteine_name,locus_id) VALUES ('AB017100','143T_HUMAN','')] at
Telagene_oracle_test.pl line 370, FIC1 chunk 6.


I think that my insert syntaxe is not correct , could you help me please

Sébastien

Sébastien VACHENC
Bioinformaticien
ITAS Information Technologique Affaires Scientifiques
FOURNIER PHARMA
Laboratoires Fournier S.A.
50, rue de Dijon - 21121 Daix - FRANCE
03.80.44.75.00
[EMAIL PROTECTED]




RE: MS ACCESS text field truncated

2004-03-05 Thread Tim Johnson

 D'oh!  You're right.  I guess I should get more sleep before answering
questions...

-Original Message-
From: Jason [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 04, 2004 2:16 PM
To: [EMAIL PROTECTED]
Subject: Re: MS ACCESS text field truncated

Hi Tim,

The doc says LongTruncOK and LongReadLen have nothing to do with writing
data into DB. They are only for reading. In addition, I am dealing with
Text type data in MS ACCESS, not LONG type.

Thanks,
J.

Tim Johnson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

Look in the docs for the $dbh-LongTruncOk and $dbh-LongReadLen
properties.



RE: MS ACCESS text field truncated

2004-03-05 Thread Jeff Urlwin
 
 Hi Tim,
 
 The doc says LongTruncOK and LongReadLen have nothing to do 
 with writing data into DB. They are only for reading. In 
 addition, I am dealing with Text type data in MS ACCESS, 
 not LONG type.

Just to butt in here...you should have specified that better in your
original posting.  

Please send your insert/update statement and snippet of code as to how you
are logging the data, so that we can help better.  Most likely, it's a
problem with the binding.  I may ask you to send a trace.

Regards,

Jeff


 
 Thanks,
 J.
 
 Tim Johnson [EMAIL PROTECTED] wrote in message 
 news:78E0B682C9508740B37610A9342E9DCD034A90FE@ hqex1.sandisk.local...
 
 Look in the docs for the $dbh-LongTruncOk and 
 $dbh-LongReadLen properties.
 
 -Original Message-
 From: Jason Q. [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 04, 2004 12:50 PM
 To: [EMAIL PROTECTED]
 Subject: MS ACCESS text field truncated
 
 Hi there,
 
 I am using DBI to access Microsoft ACCESS database. I found 
 the data of text field logged by DBI has been truncated to 
 50 characters. I have changed the field size from 50 to 255, 
 but it still doesn't work. Anyone can help?
 
 Thanks,
 J.
 
 



Re: MS ACCESS text field truncated

2004-03-05 Thread Jason
Hello Jeff,

At first, I did put type longvarchar, then I read the doc and copy the type
LONGVARCHAR to my code. All the other parts very simple because I use the
default way to make connection and create prepared statement. The field
$address is mapped to Text field of size 255 in MS ACCESS DB, but got
truncated to 50, which is the default field size in MS ACCESS

 $iSth-bind_param(1, $name);
 $iSth-bind_param(2, $address, DBI::SQL_LONGVARCHAR);

Let me know if there is anything else you want. Thank you for your help.

J.



Jeff Urlwin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 
  Hi Tim,
 
  The doc says LongTruncOK and LongReadLen have nothing to do
  with writing data into DB. They are only for reading. In
  addition, I am dealing with Text type data in MS ACCESS,
  not LONG type.

 Just to butt in here...you should have specified that better in your
 original posting.

 Please send your insert/update statement and snippet of code as to how you
 are logging the data, so that we can help better.  Most likely, it's a
 problem with the binding.  I may ask you to send a trace.

 Regards,

 Jeff


 
  Thanks,
  J.
 
  Tim Johnson [EMAIL PROTECTED] wrote in message
  news:78E0B682C9508740B37610A9342E9DCD034A90FE@ hqex1.sandisk.local...
 
  Look in the docs for the $dbh-LongTruncOk and
  $dbh-LongReadLen properties.
 
  -Original Message-
  From: Jason Q. [mailto:[EMAIL PROTECTED]
  Sent: Thursday, March 04, 2004 12:50 PM
  To: [EMAIL PROTECTED]
  Subject: MS ACCESS text field truncated
 
  Hi there,
 
  I am using DBI to access Microsoft ACCESS database. I found
  the data of text field logged by DBI has been truncated to
  50 characters. I have changed the field size from 50 to 255,
  but it still doesn't work. Anyone can help?
 
  Thanks,
  J.
 
 





RE: Benchmarking Oracle connections on Windoze XP with DBD::ODBCand DBD::Oracle

2004-03-05 Thread Jeff Urlwin
 
 I got some interesting results with this benchmark that I'd 
 like some help interpreting.  This test is on a Windoze XP 
 box comparing:
 
ora_odbc_driver (Oracle supplied(?) ODBC driver)
ms_odbc_driver  (Microsoft supplied ODBC driver)
ora_dbd_driver   (DBD::Oracle)
 
 Here is my test script:

[script snipped]
 
 Here are the results:
 
 Benchmark: timing 100 iterations of ms_odbc_driver, 
 ora_dbd_driver, ora_odbc_dri ver...
 ms_odbc_driver: 35 wallclock secs ( 2.15 usr +  4.05 sys =  
 6.21 CPU) @ 16.11/s
 (n=100)
 ora_dbd_driver: 124 wallclock secs ( 1.44 usr +  2.89 sys =  
 4.34 CPU) @ 23.06/s
  (n=100)
 ora_odbc_driver: 262 wallclock secs ( 3.46 usr +  4.91 sys =  
 8.37 CPU) @ 11.94/ s (n=100)
   Rate ora_odbc_driver  ms_odbc_driver  ora_dbd_driver
 ora_odbc_driver 11.9/s  ---27%-48%
 ms_odbc_driver  16.3/s 37%  ---29%
 ora_dbd_driver  22.8/s 92% 40%  --
 
 ---
 
 Ok I'm having a brain-fart - can someone clue me in as to how 
 to read this last section that compares the different methods 
 using percentages?  Is the 1st column saying that 
 ms_odbc_driver is 37% faster than the ora_odbc_driver, and 
 the ora_dbd_driver(DBD::Oracle) is 92% faster than the 
 ora_odbc_driver??  The last 2 columns have me confused too.  
 Any help is appreciated.


Ok -- First, let me comment on the test.  I understand that connection
times are important, but only testing drivers speed based upon
connection/disconnection time is probably not a good test and results may
vary wildly...  I *do* have a hard time I believe that the Oracle ODBC
driver is *slower* that DBD::Oracle.

I updated your script, made it a bit more generic and added my ODBC drivers
in, I get strange results like yours above.  From my results, I don't
believe the cmpthese function is correct -- and is sadly broken.  Here's
what I show, using a local Oracle database, ACCESS, a remote SQLServer
(which always has a fast connection) and a sadly underperforming DB2 server
(remote also).  The SQLServer and DB2 server are both on 100MBit switched
connections to my machine.


Benchmark: timing 100 iterations of DBD_ODBC_ACCESS, DBD_ODBC_DB2,
DBD_ODBC_MSORACLE, DBD_ODBC_ORACLE, DBD_ODBC_SQLSERVER, DBD_ORACLE...

DBD_ODBC_ACCESS:  7 wallclock secs ( 0.82 usr +  1.11 sys =  1.93 CPU) @
51.76/s (n=100)
DBD_ODBC_DB2: 64 wallclock secs ( 0.75 usr +  0.63 sys =  1.38 CPU) @
72.36/s (n=100)
DBD_ODBC_MSORACLE:  7 wallclock secs ( 1.54 usr +  1.15 sys =  2.69 CPU) @
37.12/s (n=100)
DBD_ODBC_ORACLE:  5 wallclock secs ( 1.82 usr +  1.26 sys =  3.08 CPU) @
32.41/s (n=100)
DBD_ODBC_SQLSERVER:  6 wallclock secs ( 1.04 usr +  0.90 sys =  1.94 CPU) @
51.49/s (n=100)
DBD_ORACLE:  4 wallclock secs ( 1.07 usr +  0.67 sys =  1.74 CPU) @ 57.37/s
(n=100)

 Rate DBD_ODBC_ORACLE DBD_ODBC_MSORACLE DBD_ORACLE
DBD_ODBC_ACCESS DBD_ODBC_SQLSERVER DBD_ODBC_DB2
DBD_ODBC_ORACLE32.1/s  --  -27%   -40%  -51%
-53% -75%
DBD_ODBC_MSORACLE  43.8/s 37%--   -18%  -34%
-35% -65%
DBD_ORACLE 53.7/s 67%   22% --  -19%
-21% -57%
DBD_ODBC_ACCESS66.1/s106%   51%23%--
-3% -48%
DBD_ODBC_SQLSERVER 67.9/s112%   55%27%3%
-- -46%
DBD_ODBC_DB2126/s293%  188%   135%   91%
86%   --

From the results you have and I have, cmpthese seems broken -- or is
*definitely* not correct on Win32 because it's using usr and sys time, not
wallclock time.  (I guess that depends upon your perspective of broken --
maybe just broken on Win32 would be more correct, until proven otherwise).

Also note, timethese is sadly reporting that I can perform 72.36 connections
per second using DB2, even though 100 connections took more than a one
minute...

Also, for reference, my script (which will be in the subversion repository
by the time you read this) is:
---
#!perl -w

use strict;
use DBI;
use Benchmark qw(timethese cmpthese timeit countit timestr);

my %conns = (
 DBD_ORACLE = sub { doconnect(dbi:Oracle:URLWINLT); },
 DBD_ODBC_ORACLE = sub {
doconnect(dbi:ODBC:PERL_TEST_ORACLE); },
 DBD_ODBC_MSORACLE = sub {
doconnect(dbi:ODBC:PERL_TEST_MSORACLE); },
 DBD_ODBC_SQLSERVER = sub {
doconnect(dbi:ODBC:PERL_TEST_SQLSERVER); },
 DBD_ODBC_DB2 = sub { doconnect(dbi:ODBC:PERL_TEST_DB2); },
 DBD_ODBC_ACCESS = sub {
doconnect(dbi:ODBC:PERL_TEST_ACCESS); },
);

sub doconnect ($) {
   my $connstr = shift;
   my $dbh = DBI-connect($connstr,
  $ENV{DBI_USER},
  $ENV{DBI_PASS},
  { RaiseError = 1, PrintError = 1 }
   ) || die Can't connect with 

RE: Questions about connectivity

2004-03-05 Thread Burak Gursoy
ok. thanks for the reply :)

-Original Message-
From: Tim Bunce [mailto:[EMAIL PROTECTED]
Sent: Friday, March 05, 2004 1:30 AM
To: Burak Gursoy
Cc: [EMAIL PROTECTED]
Subject: Re: Questions about connectivity


On Thu, Mar 04, 2004 at 09:44:11PM +0200, Burak Gursoy wrote:
  The mysql client library is helpfully automatically reconnecting you.
  The latest version of DBD::mysql disables that (in most cases) because
 it's
  fundamentally unsafe, e.g., you've lost any table locks you think you
may
 have.

 uhm... so, this can cause a corrupted table?

Not physically corrupt, no. But a LOCK TABLE foo READ you did earlier
may be either a) no longer in effect, or b) still in effect but held by a
connection to the database that the mysql server doesn't yet realise is
dead.

Remember that the connection may have failed due to a temporary
network condition so the original server process may still be running.

 and this can happen with other languages I believe? (as you said mysql
 client library)

Yes.

Tim.


 -Original Message-
 From: Tim Bunce [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 04, 2004 9:34 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: Questions about connectivity


 On Thu, Mar 04, 2004 at 05:58:43PM +, [EMAIL PROTECTED]
wrote:
 
   The mysql client library is helpfully automatically reconnecting
you.
  
   The latest version of DBD::mysql disables that (in most cases) because
 it's
   fundamentally unsafe, e.g., you've lost any table locks you think you
 may have.
  
   Tim.
 
  Cheers Guys,
 
  I have a related question, if I've stored some private_ data in the $dbh
 object, and I wish to print this data to a logfile whenever an error
occurs,
 I wanted to use an ErrorHandler subroutine which reads the private_ data.
 But if the error occurs through an $sth I get a DBI::st rather than the
 DBI::db handle back - and thus no access to the private data (I'm only
able
 to control the creation code of the $dbh not any subsequent $sth's). So if
 you have an $sth, is it possible to get the corresponding $dbh back from
the
 $sth - if that makes any sense.

 Is the documentation not clear about $sth-{Database} ?

 Tim.




How to format a DATE field?

2004-03-05 Thread Laurie Vien
OK--here's probably the easiest question ever posted on this forum. I can
tell it's Friday night, cuz my brain must be completely shut down. 

I'm reading records from an Oracle database using the DataHash method.  One
of the fields in the records being retrieved is type DATE.  I want to
convert that date to the format MMDD and print it to an output file.
Here's what I tried:

   while($db-FetchRow())
   {
  %row = $db-DataHash();
  $formatted_contact_date   = sprintf (%04d%02d%02d,
$row{CONTACT_DATE});
print Formatted contact date is $formatted_contact_date.\n;
.
.
.
   }
Output I'm getting from the above is Formatted contact date is 2004.
The month and day are always zeroes.  How do I get the date into the format
I want? (I know, I know ... sigh.)

Thanks.

Laurie
Tired Programmer/Analyst
BJ's   


GOT IT--NEVER MIND! RE: How to format a DATE field?

2004-03-05 Thread Laurie Vien
Never mind--I got it--I just have to use substr instead of sprintf.  Thanks,
folks.
Laurie

-Original Message-
From: Laurie Vien [mailto:[EMAIL PROTECTED]
Sent: Friday, March 05, 2004 6:15 PM
To: [EMAIL PROTECTED]
Subject: How to format a DATE field?


OK--here's probably the easiest question ever posted on this forum. I can
tell it's Friday night, cuz my brain must be completely shut down. 

I'm reading records from an Oracle database using the DataHash method.  One
of the fields in the records being retrieved is type DATE.  I want to
convert that date to the format MMDD and print it to an output file.
Here's what I tried:

   while($db-FetchRow())
   {
  %row = $db-DataHash();
  $formatted_contact_date   = sprintf (%04d%02d%02d,
$row{CONTACT_DATE});
print Formatted contact date is $formatted_contact_date.\n;
.
.
.
   }
Output I'm getting from the above is Formatted contact date is 2004.
The month and day are always zeroes.  How do I get the date into the format
I want? (I know, I know ... sigh.)

Thanks.

Laurie
Tired Programmer/Analyst
BJ's   


Can I reset the pointer in a DataHash?

2004-03-05 Thread Laurie Vien
I would like to read all the records from a table in once, in a single
SELECT, and then use while($db-FetchRow()) and the %row =
$db-DataHash() method to process through them.

Is there a way to reset the pointer to the beginning of the recordset so
that I can process the records a second time without reading them all back
in from the database?  

I tried just repeating the while($db-FetchRow()) statement after I'd
finished the first round of processing, but it didn't work.
Thanks ... 

Laurie A. Vien
Sr. Programmer/Analyst
Ben  Jerry's Homemade, Inc.



Re: Réf. : [Fwd: Réf. : Re: Problem with DBD::Oracle]

2004-03-05 Thread Michael A Chase
[EMAIL PROTECTED] wrote:

Now I have, one another problem with sql syntaxe. I try to translate
my perl script from Mysql to Oracle, but when I excute this script I
have this kind of error
[Fri Mar  5 17:11:19 2004] Telagene_oracle_test.pl: DBD::Oracle::db
do failed: ORA-00911: invalid character (DBD ERROR: error possibly
near * indicator at char 12 in 'INSERT INTO
*`BIOEXP`.`genbank_telagene2` (ac_number,proteine_name,locus_id)
VALUES ('AB017100','143T_HUMAN','')') [for Statement INSERT INTO
`BIOEXP`.`genbank_telagene2` (ac_number,proteine_name,locus_id)
VALUES ('AB017100','143T_HUMAN','')] at Telagene_oracle_test.pl line
370, FIC1 chunk 6.
I think that my insert syntaxe is not correct , could you help me
please
You are correct, the syntax is not correct.  As pointed out by the error
message, (`) is not a valid character in Oracle SQL.  You should use ()
to quote column names if the names are case sensitive or contain
otherwise illegal characters for column names.  That's one of the
differences between MySQL and Oracle SQL.
--
Mac :})
** I usually forward private questions to the appropriate mail list. **
Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.