On 2006-08-11 18:25:39 -0700, Stephen Carville wrote: > [EMAIL PROTECTED] wrote: > >I would expect to have to pad the field in my where clause against a > >char field, regardless of how I submitted the query to Oracle. > > Until I switched to using bind variables, I'd never had a problem. > Trimmed fields compared fine to CHAR and VARCHAR2 alike.
I think Oracle pads the string with spaces if you don't use placeholders. You can get it to do that with placeholders, too, if you explicitely bind the variables (there are several char types, and one of them does the padding). There have been occasional discussions about this behaviour over the years, and so far nobody could come up with a method which "does the right thing" in all cases - the current behaviour is the one which is least surprising in most cases. hp -- _ | Peter J. Holzer | If I wanted to be "academically correct", |_|_) | Sysadmin WSR | I'd be programming in Java. | | | [EMAIL PROTECTED] | I don't, and I'm not. __/ | http://www.hjp.at/ | -- Jesse Erlbaum on dbi-users
pgpVXQBphCY4i.pgp
Description: PGP signature