Support for ParamValues in dbd::mysql and a note on DBD::ODBC

2006-03-31 Thread Martin J. Evans
It would appear dbd::mysql 3.0002_4 does not support ParamValues.
As far as I can see it is also not in _5. I am far from an XS expert but the
following addition to dbd_st_FETCH_attrib in dbdimp.c seems to work. If anyone
cares to comment on whether there is a better or proper way to do this I'd be
happy to learn from them. Unfortunately it is not easy for me to supply a patch
as my dbd::mysql is 3.0002_4 and is massively patched and hacked already (my
addition between + and - MJE.

  case 'P':
if (strEQ(key, PRECISION))
  retsv= ST_FETCH_AV(AV_ATTRIB_PRECISION);
/* +MJE */
if (strEQ(key, ParamValues)) {
HV *pvhv = newHV();
if (DBIc_NUM_PARAMS(imp_sth)) {
unsigned int n;
SV *sv;
char key[100];
I32 keylen;
for (n = 0; n  DBIc_NUM_PARAMS(imp_sth); n++) {
# Not sure this is the correct way to create the param keys
keylen = sprintf(key, %d, n);
hv_store(pvhv, key, keylen, newSVsv(imp_sth-params[n].value),
0);
}
}
retsv = newRV_noinc((SV*)pvhv);
}
/* -MJE */
break;

Incidentally, DBD::ODBC does support ParamValues BUT they cannot be retrieved
after execute fails. I believe this is because dbd_st_FETCH_attrib attempts to
do a dbd_describe (for most attribs) before returning ParamValues and that fails
if execute has failed. I am not sure if it needs to call dbd_describe for
ParamValues and I've asked Jeff to comment.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com



DB2.pm for Perl 5.8 needed

2006-03-31 Thread Bergners, Andrei
Hi,
 
 I am looking to install the Win32 DB2.pm library for perl 5.8.7 or 5.8.8.
 The previously recommended site of   http://ftp.esoftmatic.com/DBI/
http://ftp.esoftmatic.com/DBI/ no longer seems to contain the necessary
ppds.
 
 Can someone recommend another location?
 
thanks
andrei


Re: DB2.pm for Perl 5.8 needed

2006-03-31 Thread John Scoles
Since you are in windows you might want to just to use Activeperl and ppm to
get the latest version which I think is

' DBD-DB2  [0.76] DBD-DB2'

- Original Message - 
From: Bergners, Andrei [EMAIL PROTECTED]
To: dbi-users@perl.org
Sent: Friday, March 31, 2006 10:01 AM
Subject: DB2.pm for Perl 5.8 needed


 Hi,

  I am looking to install the Win32 DB2.pm library for perl 5.8.7 or 5.8.8.
  The previously recommended site of   http://ftp.esoftmatic.com/DBI/
 http://ftp.esoftmatic.com/DBI/ no longer seems to contain the necessary
 ppds.

  Can someone recommend another location?

 thanks
 andrei




Re: DB2.pm for Perl 5.8 needed

2006-03-31 Thread Dan Scott
This is a nice thought, but the latest release of DBD::DB2 is actually
0.78 (released a long time ago), but ActiveState wasn't interested in
updating their version of the package because DBD::DB2 prereqs the DB2
Runtime Client.

Apparently ActiveState has made it a policy to avoid offering packages
which are not entirely self-contained (because they don't want to be
inundated with support calls complaining about a problem due to a
missing third-party library). So until IBM can figure out how to avoid
the dependency on the DB2 Runtime Client, ActiveState is apparently
going to continue to offer a decrepit version of DBD::DB2.

The last time esoftmatic.com disappeared from the Web was due to some
DNS problems; more than likely this problem will clear up in a day or
two.

Dan

On 3/31/06, John Scoles [EMAIL PROTECTED] wrote:
 Since you are in windows you might want to just to use Activeperl and ppm to
 get the latest version which I think is

 ' DBD-DB2  [0.76] DBD-DB2'

 - Original Message -
 From: Bergners, Andrei [EMAIL PROTECTED]
 To: dbi-users@perl.org
 Sent: Friday, March 31, 2006 10:01 AM
 Subject: DB2.pm for Perl 5.8 needed


  Hi,
 
   I am looking to install the Win32 DB2.pm library for perl 5.8.7 or 5.8.8.
   The previously recommended site of   http://ftp.esoftmatic.com/DBI/
  http://ftp.esoftmatic.com/DBI/ no longer seems to contain the necessary
  ppds.
 
   Can someone recommend another location?
 
  thanks
  andrei
 




Re: DBI windows binaries

2006-03-31 Thread Ron Savage
On Thu, 30 Mar 2006 17:32:42 -0500, Boris Kunyavsky wrote:

Hi Boris

http://theoryx5.uwinnipeg.ca/ppms/

--
Cheers
Ron Savage, [EMAIL PROTECTED] on 1/04/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company




$sth-execute(@$bindVars) is outputting an error

2006-03-31 Thread Peter Loo
Hi,

I am trying to pass an array reference to $sth-execute and I am
getting the following error:

DBD::ODBC::st execute failed: called with 38 bind variables when 0 are
needed at /usr/local/apps/common/devl/bin/GlobalRoutines.pm line 42.

The code I am using is as follows:

  sub sub_executeBind($$$) {
local ($dbh, $sth, $bindVar) = @_;
$sth-execute(@$bindVar) || die $dbh::errstr;
return($sth);
}

Will someone please help me understand this error message?

Thanks in advance.

Peter

Peter Loo
Worldwide Consulting, Inc.
Phoenix, Arizona
U.S.A.


Re: ODBC w/ MS SQL

2006-03-31 Thread Thomas A. Lowery


You need an ODBC manager with the freetds driver.  I suggest unixODBC.

One issue you may run into is that when a query fails to prepare, you 
may only receive a prepare failed... message without additional 
information as to why it failed.  Also, I've had problems with place 
holders not working.


If you're bulk loading or extracting take a look at freebcp.  We've had 
great success extracting data (6-7 million record tables), but have had 
a problem with loading.  Stops loading between 5-6 million records.  We 
divide our load files into files of million rows each to keep things 
more manageable.


JupiterHost.Net wrote:



Have you tried FreeTDS ?

http://www.freetds.org/


Little snafu, installing freetds and then DBD::ODBC against freetds

wget 
ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz

cd freetds-0.63/
./configure --prefix=/opt/freetds
make
make install

wget http://search.cpan.org/CPAN/authors/id/J/JU/JURL/DBD-ODBC-1.13.tar.gz
tar xzf DBD-ODBC-1.13.tar.gz
cd DBD-ODBC-1.13

# just want to get it built before I fiddle with freetds's MSSQL DSNs
export SYBASE=/opt/freetds
export ODBCHOME=/opt/
export DBI_DSN=dbi:ODBC:JDBC
export DBI_USER=guest
export DBI_PASS=sybase


root [~/DBD-ODBC-1.13]# perl Makefile.PL
Useless use of private variable in void context at Makefile.PL line 431.

Configuring DBD::ODBC ...

  Remember to actually *READ* the README file!
And re-read it if you have any problems.

Using DBI 1.50 (for perl 5.008007 on i686-linux) installed in 
/usr/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/

Using ODBC in /opt/

Hmm...I cannot find an ODBC driver manager that I recognize.
...And I know about these drivers:
Microsoft ODBC, adabas, easysoft, empress, esodbc, informix,
intersolve, iodbc, sapdb, solid, udbc, unixodbc
root [~/DBD-ODBC-1.13]#

Do I need to use DBD::OBDC-0.28 as per Example 6-4 at
http://freetds.org/userguide/perl.htm#PERLMODULES

or ??

Thanks!