Re: DBI bind_param_inout question
[email protected] (Bruce Johnson)
| Newsgroups | perl.dbi.users |
|---|---|
| Message-ID | <[email protected]> |
On Mar 9, 2010, at 1:42 AM, Martin Evans wrote: > There is however one possible area of ambiguity with respect to > bytes or > characters (within a DBD). DBD::ODBC counts the $length as characters > not bytes as how it is eventually encoded in Perl should not matter. > So > if you specify $length=10 and the output parameter is a wide (MS's > term > in ODBC for a unicode character that occupies 2 bytes) character type > DBD::ODBC allocates twice as much plus 2 (for the terminating nul chr) > bytes then encodes it in UTF-8 for Perl - so you'd get at most 10 > chrs. > In this case if the output parameter was 11 chrs in length you'd get a > data right truncation error again. > > I'm not sure what DBD::Oracle does wrt to chrs or bytes. This clarifies it a lot for me. The data_length of the column in Oracle (it is a default number() size) is 22 bytes, so that's what I have to set it in my code. -- Bruce Johnson University of Arizona College of Pharmacy Information Technology Group Institutions do not have opinions, merely customs