Re: rpad and special characters

  • From: Rich J <rjoralist3@xxxxxxxxxxxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Mon, 19 Oct 2015 10:19:23 -0500



On 2015/10/19 09:10, Dustin Hayden wrote:

,RPAD(NVL(TO_CHAR( item_description ),' ') , 27 ) col010

Someone enters a 'special character' into the item_description column (like
café ) , and apparently, even though I'm forcing the column to 27 characters,
it's using some international multi character code for that character, which
pushes it beyond 27 characters.

I think it's going to depend on a few things, including the datatype of
the item_description column and the NLS parameters you're using for the
database.

Also, what's the purpose of the TO_CHAR for this column? If
item_description is NVARCHAR2, were you attempting to CAST it before
RPADding it?

A great function that may shed some light on what you're seeing is DUMP.
Try SELECTing DUMP(item_description) and also wrapping a DUMP around
your RPAD. It'll let you see exactly what you're SELECTing.

HTH!

Rich

Other related posts: