Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
[OCP 21 Professional Study Guide] [OCP 17 Complete Study Guide] [OCP 17 Practice Tests] [OCP 11 Complete Study Guide] [OCP 11 Programmer I] [OCP 11 Programmer II] [OCP 11 Practice Tests] [OCA 8] [OCP 8] [OCP 8 Practice Tests Book] [Blog]
Originally posted by D Rog:
I met a strange problem, although a field is defined as varchar2(4000), it can fit different number of character, because Unicode, UTF-8 or whatever. I guess Oracle field size is defined in bytes, not characters. So is any way to figure out upfront if certain string will fit varchar2 field without actual executing INSERT or UPDATE? Another problem is, if I know that a string can't fit and going to truncate it, then the process seems should be iterative. So an ideal solution for me can be just call some function which with minimum spending of computer resources can tell me how to truncate a string to fit a particular varchar2 field.Or perhaps you can suggest something clever?
Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
Originally posted by D Rog:
Thanks for responses. Yes, CLOB is what I am currently mostly use. My concern was that CLOB can perform not quite well.
Another concern, how effectively Oracle build index against CLOB column?
[ October 10, 2008: Message edited by: D Rog ]
[OCP 21 Professional Study Guide] [OCP 17 Complete Study Guide] [OCP 17 Practice Tests] [OCP 11 Complete Study Guide] [OCP 11 Programmer I] [OCP 11 Programmer II] [OCP 11 Practice Tests] [OCA 8] [OCP 8] [OCP 8 Practice Tests Book] [Blog]
Originally posted by Avi Abrami:
Rog,
Have you read the Oracle documentation?
VARCHAR2 columns can be defined as "bytes" (the default) or "characters".
The documentation also details the size calculations Oracle makes for storing VARCHAR2 column data.
Good Luck,
Avi.
Paul Campbell wrote:
You can set it to VARCHAR2(CHAR 4000) and Oracle will store the 4000 characters regardless of the number of bytes used to store the 4000 characters.
Your maximum size limit for VARCHAR2 is 4000 regardless of character or bytes.
Consider Paul's rocket mass heater. |