Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Table definition - Data Type - Units for VarChar2?

Blue BirdMar 2 2017 — edited Mar 3 2017

Hello,

I have a dilemma how to properly define/design table fields. When I define a new table in SQL Developer and select for Data Type VARCHAR2 I have below two properties "Size" and "Units". For Units is by default selected <Not Specified>. Other two options are BYTE and CHAR.

If I for example select Size 5 this would allow me to input up to 5 ASCII characters in all three cases (<Not Specified>, BYTE and CHAR). E.g "asdfg".

If I try to input "€asdf" these are already 6 chars in case 1 (<Not Specified>) and 2 (BYTE) and does not allow me to Commit changes (with F11). But it went through in case 3 (CHAR).

My questions are next:

1. In Oracle sample apps I noticed that is always used (as I checked) for Units option BYTE. Is this selected because English language doesn't need/use input of International chars and table fields spend 50% less space or is some other reason to use this option? For example if you regularly use chars (2 byte size) from non regular ASCII pool this could cause that you can in worst case input only half of specified size characters.

2. Is option<Not Specified> same as BYTE? It's look like to me.

3. Which option (as good practice) among these three you use if you design database tables for apps which use accented chars in alphabet (e.g. European codepages - €, č, š, ž, ...)?

All your answers and thinking are welcome.

BB

This post has been answered by thatJeffSmith-Oracle on Mar 2 2017
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 31 2017
Added on Mar 2 2017
8 comments
589 views