Question

  Asked: Mar 28 2006   3:34 AM GMT
  Asked by: oraworld


Difference between length and vsize functions


Oracle, Database, DB2, SQL, Oracle Database Versions, Oracle 10g, 7 and earlier, Oracle 8i, Oracle 9i, Oracle development

Hi
I have got same results for both the vsize and length functions. Why the two functions are giving the same result? Can any one clarify this?

Thanks in advance,

Regards,
P. Karthik

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



LENGTH gives the length of a string, in symbols. So, 'abc' has a length of 3, whether stored as CHAR or GRAPHIC. The size of a field, on the other hand, is the amount of storage required for the field. For fixed length character fields, you use 1 byte per character. For fixed length graphic fields, it's 2 bytes per symbol. For variable-length fields, add 2 bytes for the length indicator.

So, if you have a fixed-length char field, length and size match.
---
Sheldon Linker (sol@linker.com)
Linker Systems, Inc. (www.linkersystems.com)
800-315-1174 (+1-949-552-1904)
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Oracle, Database and Development.

Looking for relevant Oracle Whitepapers? Visit the SearchOracle.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register