Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: OCIBind and whitespace trimming
Rene Nyffenegger wrote:
>>Rene Nyffenegger <rene.nyffenegger_at_gmx.ch> wrote in message news:<c0sic1$1b5jo4$1_at_ID-82536.news.uni-berlin.de>...
>>
>>>>Hi everyone. I've got a customer that is using some older code we
>>>>wrote to update some tables (code based on OCI from 8.1.7). One
>>>>particular table has a VARCHAR2 field and he wants to put the
>>>>following text into it: 'this is my test '. Note the space at the
>>>>end. Our little helper function uses OCIBindByPos when building the
>>>>Update clause and this, it turns out, causes the trailing spaces to
>>>>get stripped:
>>>>
[...]
> > What datatype did you state in the OCIBindByPos function call? > > Rene > >
There is something called 'blank-padded comparison semantics' (you can search for this at tahiti.oracle.com).
It seems to boil down to whether you are using CHAR or VARCHAR2 datatypes. I don't use OCI directly, but in DBD::Oracle module for Perl, which does use OCI, you have to set a specific parameter to control how this works (i.e. to not drop the trailing blanks).
--Mark Bole Received on Sat Feb 21 2004 - 08:29:38 CST
![]() |
![]() |