Re: Is it possible to print the values for which a dynamic query failed.

2002-10-12 Thread Tim Bunce

The driver needs to support the (new) ParamValues attribute.

If it does then setting the ShowErrorStatement attribute will
include both the Statement text and the ParamValues in the error
message. Assuming you're using a recent DBI version.

Tim.

On Fri, Oct 11, 2002 at 02:35:18PM -0700, Naveen Prabhakar wrote:
 Hi,
 This is probably a begginers question.
 using db2:dbi
 when executing a dynamic query,is there a way to print
 the query and values  for which the execute failed.
 
 I am trying to bind a number of fields and am
 inserting a number of records and would like to know
 for which record the execute failed and the values for
 which it failed.Could anyone guide me regarding
 this.Thanks 
 
 __
 Do you Yahoo!?
 Faith Hill - Exclusive Performances, Videos  More
 http://faith.yahoo.com



5.8, NLS_LANG, and the utf8 flag

2002-10-12 Thread Kevin Scaldeferri

I didn't see anything which explicitly confirmed this in a couple
google searches on this group, so...

I observe that when I set NLS_LANG=AMERICAN_AMERICA.UTF8 that while I
retrieve the correct bytes from the database, the utf8 flag is not
set.  Is this correct or am I possibly not setting up my connection
correctly.

I'm using Oracle, if it matters at all, and versions of everything
from about 2 months ago, so maybe there are newer versions that fix
this?

Thanks,

Kevin

(P.S.  I posted this once through google, but they don't think this 
groups is moderated, and apparently that kept it from going out the 
first time.  I think. Apologies to anyone who sees this twice)




DB multiplexing (was Re: Which shared memory module to use?)

2002-10-12 Thread Henri Asseily


On Friday, October 11, 2002, at 02:39 PM, Tim Bunce wrote:

 There hasn't been up to now (or at least I haven't found any) a widely
 available Perl/DBI-based system for system architects who handle
 high-availability groups of servers, either in read-only load-balanced
 mode or read-write hot-backup mode.

 Have you looked at DBD::Multiplex?

 I'd be interested in your thoughts on DBD::Multiplex, both specifically
 and the underlying concept of using a 'virtual driver' to encapsulate
 the functionality.


Wow, DBD::Multiplex is a nice piece of code. The concept of a virtual 
driver is great.
I think that one could put the functionality that I implemented within 
DBD::Multiplex, but I'll need to sleep on it.

Basically I think Multiplex would need the following:
1- better implementation of timeouts, both at the connect and at the 
execute level
2- better support for high-performance environments and mod_perl, 
mostly by having a memory state

Regarding (1), Multiplex still relies upon the base driver's timeout 
system, which can hardly be relied upon. That's a pretty easy fix.

For (2), here are a number of use cases where Multiplex is less than 
optimal:

- I send a badly formed SQL statement. Multiplex will automatically go 
through all dsns and execute that statement, hoping against all hope 
that one server will manage to execute it. My proposal is to wipe the 
connection, reconnect (with success) to the original dsn and reexecute 
only once. If that fails, forget it and pass that back to the client.

- My master DB server dies, in a master-slave configuration that uses a 
replication engine. Multiplex will always try the master server first, 
with no memory of its state. That's bad in any configuration, including 
Apache::DBI. In Apache::DBI, the cached handle is dead and will never 
recover unless it's wiped. (in fact, in any case using Apache::DBI will 
be a problem due to the caching of bad dbh's even if the server 
recovered). In non-Apache::DBI, if you make the mistake of bringing the 
master back up for testing, Multiplex will start hitting it before the 
master has time to do a reverse-replication. Your replication system is 
then shot. Basically, when you fail over automatically, you want to 
remain failed over until the DBA flips the switch back manually.

Anyway, I'm going to dig deeper into all this and potentially make my 
configuration structures compatible with DBD::Multiplex, which would 
then allow for seamless use of it. By then the logic flows will 
necessitate a supercomputer to debug... :)
Or of course I could take DBD::Multiplex and extend it with the logic 
that I built. I'll let the list know my findings. I will probably 
release the HA module first (with or without the MM functionality) and 
then get some feedback going.

Henri




Perl/flash/mysql

2002-10-12 Thread Tee-Man

Hello!

I'm brand new to the list, and I'm wondering if anyone has used a flash
interface with mysql, specifically using perl.

I have been successful in using PHP to interact with a flash front-end, but
my small provider's server currently does not support PHP (they didn't even
have DBD until I asked for it!).

I hope this is not too far off-topic.  There is a lot of great info online
for PHP/flash/mysql, but I have found no resources online that address
specifically the use of perl/flash/mysql.

Flash sends the request to the server using GET or POST, and it expects a
url-encoded return value assigned to a variable name that matches the one
assigned to the dynamic text object in the flash movie.

Is this perhaps a header issue inside my perl script?  I have asked this
question on several lists recently, to no avail.

Thanks for the great resource!





Re: Which shared memory module to use?

2002-10-12 Thread Tim Bunce

On Fri, Oct 11, 2002 at 12:50:15PM -0700, Henri Asseily wrote:
 This is somewhat OT, but I need an answer from within the DBI community:
 
 I want to release a new DBIx module, DBIx::HA (for High Availability).

What will it do, and how?

 In this module I need to do some work on shared memory segments. What 
 Perl module is most in use to do that? i.e. which module should I 
 support?
 I was thinking about IPC::ShareLite. Is that one the best in terms of 
 distribution, or are other ones more ubiquitous?
 What about IPC::Shareable?

There are many to consider, including IPC::MM and others.

There was a talk by Perrin Harkins at this years Perl Conference
http://conferences.oreillynet.com/cs/os2002/view/e_sess/2801
that compared and benchmarked many of the modules - it was a good,
well designed, review that considered many issues people would often
forget.

Sadly his presentation isn't online here
http://conferences.oreillynet.com/pub/w/15/presentations.html
so I've CC'd Perrin in the hope that he'll post a url for it.

Tim.



zeugma

2002-10-12 Thread Naveen Prabhakar

I get this kind of error when I try to execute after 
binding parameters.
DBD::DB2::st execute failed: [IBM][CLI Driver]
CLI0109E  String data right truncation. SQLSTATE=22001
at ./dbinit2.pl line 326, USERDATA chunk 1.

I am binding around 20 parameters,some of them are of
this type

$sth-bind_param(18,$user_head_desk,SQL_CHAR) || die
$sth-errstr;

could anyone help me regaring this
thank you.



__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos  More
http://faith.yahoo.com



DBI long read problem

2002-10-12 Thread Daniel Olson

I'm writing a CGI script in Perl to extract longs from an Oracle
database that contain jpeg images and package them for display in a
web page. I've got a script to put them into the database, which I
thought would be the hard part. But I'm struggling with this.

I'm using Perl 5.004_01, DBI version .90, DBD::Oracle version .47
and Oracle version 7.3.2.1. The image I'm extracting for this test
is about 232Kb. The weird part is that when I set different values
for LongReadLen I get odd data lengths back, none of which are
close to what I specify. As examples:

$dbh-{LongReadLen} = 500120;  gives me 41369 characters
$dbh-{LongReadLen} = 500 * 1024;  gives me 53249 characters
$dbh-{LongReadLen} = 800 * 1024;  gives me 32769 characters
$dbh-{LongReadLen} = 300 * 1024;  gives me 45057 characters

These results come from running the script by hand from the command
line. My suspicion is that this is caused by my use of an old version
of something, but that's just a guess from what I've been reading here
and elsewhere on the net. If anyone has other suggestions of other
possible causes, I would appreciate any assistance or suggestions.

Thanks.

Dan Olson
Senior Research Associate
Oregon Health  Science University


The code:

#! /usr/local/bin/perl

use DBI;
use CGI;

$query = new CGI;

if ($picID = $query-param('ID')) {
$dbh = DBI-connect('dbi:Oracle:meta','chinese','china') or die
Can't open database connection: $DBI::errstr\n;

$dbh-{LongReadLen} = 300 * 1024;
$dbh-{LongTruncOk} = 1;

$dbq = $dbh-prepare(select image from wcare_test where pid =
$picID);
$dbq-execute;

($image) = $dbq-fetchrow() or die Can't execute fetchrow:
$DBI::errstr\n;
print picID is $picID; pid is $pid; size of image:  .
length($image) .  characters\n;
$dbq-finish;
$dbh-disconnect;

}



Re: Is DBD:proxyServer available for Windows NT platform???

2002-10-12 Thread KAWAI,Takanori

Hi.
- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, October 12, 2002 6:02 AM
Subject: Is DBD:proxyServer available for Windows NT platform???


 Hi Expert
 
 Is DBD:proxyServer available for Windows NT platform???
You say DBI::ProxyServer? (not DBD::ProxyServer)
Anyway, you can use DBI::ProxyServer/DBD::Proxy from Windows.

 Where can I get theses modules?
If you use ActivePerl,  try to use these commands from DOS prompt: 
  ppm install DBI
  ppm install PlRPC

==
KAWAI, Takanori(Hippo2000)
   Mail: [EMAIL PROTECTED] [EMAIL PROTECTED]
   http://member.nifty.ne.jp/hippo2000/index_e.htm
   http://www.hippo2000.info/cgi-bin/KbWikiE/KbWiki.pl
 May we translate your pods into Japanese?
-- Japanized Perl Resource Project
  http://sourceforge.jp/projects/perldocjp/
==




Re: string data right truncation error sqlstate 22001 while working with dbi:db2

2002-10-12 Thread jmelesky

On 11 Oct, Naveen Prabhakar wrote:
 I get this kind of error when I try to execute after 
 binding parameters.
 DBD::DB2::st execute failed: [IBM][CLI Driver]
 CLI0109E  String data right truncation. SQLSTATE=22001
 at ./dbinit2.pl line 326, USERDATA chunk 1.

That error occurs when you have a char or varchar field of a given length,
and you try to put a longer string into it.

You have to truncate the string in Perl (substr can be used for this),
before trying to use it as a placeholder. DBD::DB2 doesn't have an automatic
truncation feature that i know of.

-johnnn





Re: DBD::Oracle

2002-10-12 Thread Stephen Clouse

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Fri, Oct 11, 2002 at 04:51:26PM -0700, Michael A Chase wrote:
 This is getting to be a very common problem.  Is there any reliable way to
 detect the integer size used by Perl and Oracle so Makefile.PL can do this?
[snip]

Funny, I emailed Tim about this very issue (along with a couple other things,
but this thread got me thinking about this).

We may just have to detect the existence of lib32 and then prompt for which one
to use, unless someone @perl5-porters knows a better way of divining it from the
Perl configuration.  At least the prompt would negate the need for a manual edit
(unless they choose wrong, but that's not our problem :)

As another option, could we compile and link a small test program, ala GNU
configure?

- -- 
Stephen Clouse [EMAIL PROTECTED]
Senior Programmer, IQ Coordinator Project Lead
The IQ Group, Inc. http://www.theiqgroup.com/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9p2aOA4aoazQ9p2cRArkyAKDLzHFK7Fk6huQUdVmvq+h4rTnhzACgoG12
FcmurUu6eehb2h+ECUZoiqw=
=43qn
-END PGP SIGNATURE-