Home » SQL & PL/SQL » SQL & PL/SQL » vsize function
vsize function [message #331] Tue, 05 February 2002 18:34 Go to next message
hemant shah
Messages: 5
Registered: February 2002
Junior Member
vsize(384838) answer is 4. Plase explain.
Re: vsize function [message #336 is a reply to message #331] Wed, 06 February 2002 04:11 Go to previous messageGo to next message
Mike
Messages: 417
Registered: September 1998
Senior Member
It is the number of bytes used to store your number. It is stored under the format 3.84838 * 10^5. One byte is used for the exponent and 3 for the number.

With larger numbers it can happen, like VSIZE(10000000)=2, that the result is smaller because it will only store the exponent which always uses 1 byte and the number, 1 in this case, which also uses only 1 byte.

HTH
Mike
Re: vsize function [message #348 is a reply to message #331] Wed, 06 February 2002 07:57 Go to previous messageGo to next message
hemant shah
Messages: 5
Registered: February 2002
Junior Member
Thanks Mike.
With larger numbers it can happen, like VSIZE(10000000)=2, that the result is smaller because it will only store the exponent which always uses 1 byte and the number, 1 in this case, which also uses only 1 byte

In other words, 10^7=10,000,000 exponent 1 byte
How did you get the second byte?
Re: vsize function [message #351 is a reply to message #331] Wed, 06 February 2002 09:55 Go to previous messageGo to next message
Mike
Messages: 417
Registered: September 1998
Senior Member
the second byte stores the 1 (theoreticaly not needed in this case) mulitplying 10^7.
Re: vsize function [message #359 is a reply to message #331] Wed, 06 February 2002 20:54 Go to previous message
Abul Fazal
Messages: 39
Registered: February 2002
Member
An Additional Comment - NUMBER Datatypes require less storage space than CHARACTER Datatypes.
Previous Topic: Create table in stored procedure
Next Topic: HOW TO GET CONTEXT OF AN EXISTS STORED PROCEDURE
Goto Forum:
  


Current Time: Fri Sep 24 13:31:50 CDT 2021