For my particular beef, the -8 flag works when compiling the DBD module as suggested below.
-------- Original Message -------- Subject: RE: Whitespace being truncated with Oracle Date: Fri, 1 Mar 2002 12:18:34 +0100 From: "Jan Matejka" <[EMAIL PROTECTED]> To: "'Jeff Hunter'" <[EMAIL PROTECTED]> This is Oracle::DBD feature. If you look into the Changes file, you learn that .... Changes in DBD::Oracle 1.05 13th July 2000 Added $dbh->{ora_ph_type} attribute to define default bind type: 1=> VARCHAR2, does strip trailing spaces, embedded \0 bytes okay 5=> STRING, doesn't strip trailing spaces, embedded \0 ends string 96=> CHAR, doesn't strip trailing spaces, embedded \0 okay 97=> CHARZ, doesn't strip trailing spaces, embedded \0 ends string? The two CHAR types force 'blank-padded comparison semantics'. .... and it depends on, whether you compiled DBD::Oracle with OCI8 or OCI7. ( perl Makefile.PL -8 uses oci7.c, perl Makefile.PL uses oci8.c ) This behaviour occurs only when compiled with with OCI8. bye MaT > -----Original Message----- > From: Jeff Hunter [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 28, 2002 7:16 PM > To: Fannin, David P. > Cc: [EMAIL PROTECTED] > Subject: Re: Whitespace being truncated with Oracle > > > But if the OCI version is the same on my 5.005_02 with DBI 1.14 / DBD > Oracle 1.06 and my Perl 5.6.1 with DBI version 1.21 and DBD > 1.12, why > would it be different? > > Fannin, David P. wrote: > > >I had this problem with Oracle as well, and someone passed > along the useful code snippet included below. > > > >This question comes up fairly frequently on this list. Is > there a FAQ somewhere that this could be added to if it isn't > already there? > > > >-dpf- > > > >------------------------------------------------ > >This tip courtesy of Tim Bunce: > > > > use DBI qw(:sql_types); > > $sth->bind_param(1, $value, SQL_CHAR); > > > >The problem is that OCI "smartly" strips trailing blanks off > a bind value of > >type VARCHAR2. Explicitly casting it to a CHAR datatype avoids this > >"intelligence". > >------------------------------------------------ > > > > > >----------------------- > >David P. Fannin > >Database Administrator [EMAIL PROTECTED] > >UM-Rolla Computing and Information Services FAX (573) 341-4216 > >URL http://www.umr.edu/~dpf PHONE (573) 341-4841 > >----------------------- > > > > > >-----Original Message----- > >From: Jeff Hunter [mailto:[EMAIL PROTECTED]] > >Sent: Thursday, February 28, 2002 10:41 AM > >To: [EMAIL PROTECTED] > >Subject: Whitespace being truncated with Oracle > > > > > > > >I am using perl 5.6.1 on Solaris 2.8. My DBI version is > DBI-1.21 and my > >DBD version is DBD-Oracle-1.12. My Oracle version is 8.1.7.2 and my > >Oracle OCI version is 8.1.7.0.0. > > > >I have setup a query that retrieves VARCHAR2(10) values from a table > >into a bound variable. The values in the table are right > padded with > >spaces. When I retrieve the values, I can print them out exactly as > >they are in the table. However, when I insert them into > another table, > >the spaces at the end of the variable are stripped off. I think the > >spaces are being truncated in the bind_param method. Is > this a bug with > >the DBD I am using? > > > > > > > > >