You might have guessed from my prior post on NVARCHAR2, that I'm doing a little work with Oracle. As with many other aspects of technology, it's always a little dangerous to be completely familiar with a competing product, as you tend to bring along the assumptions from that product. But really, this little part of my Oracle interaction goes beyond this.
So I need to expand the size of an NVARCHAR2 field in an existing table. Specifically, I need the column definition to be NVARCHAR2(264) as this will give me 132 Unicode characters to work with. So naturally I execute the following DDL command.
ALTER TABLE LIST_USER MODIFY USER_ID NVARCHAR2(264)
This certainly seemed like the appropriate approach to take. However, once the command worked successfully, I look at the structure of the LIST_USER table and what do I see? USER_ID is defined as NVARCHAR2(528). Oracle took the size that I wanted and doubled it.
What the heck are the people who designed this particular piece of logic thinking? That when I asked for NVARCHAR2(264), I really didn't have a clue what I wanted? That I was completely oblivious to the environment in which I was working and the size of the field I was looking to create. While that might be true on occasion, it usually takes people a little while to realize it. And software never does. Unless it's Oracle, apparantly. But since an Oracle is capable of seeing future truths, I guess it all makes sense now.