Difference between length and vsize functions

pts.
Tags:
Database
IBM DB2
Oracle
Oracle 10g
Oracle 8i
Oracle 9i
Oracle Database
Oracle development
SQL
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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)

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Difference between length and vsize functions (Q/A) | Seek The Sun Slowly
    [...] Address: http://itknowledgeexchange.techtarget.com/itanswers/difference-between-length-and-vsize-functions/ (0) Comments Read [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: