Home » SQL & PL/SQL » SQL & PL/SQL » SQL Function Convertion Bites to Bytes, KB, MB, GB, TB, PB, EB, ZB, YB
SQL Function Convertion Bites to Bytes, KB, MB, GB, TB, PB, EB, ZB, YB [message #361221] Tue, 25 November 2008 07:15 Go to next message
ygsunilkumar
Messages: 100
Registered: August 2008
Senior Member
Hi..Anybody pls give me the query or code for SQL/PLSQL Function which converts from Bites to Bytes, KB, MB, GB, TB, PB or EB and format the output to human readable format...thanx
Re: SQL Function Convertion Bites to Bytes, KB, MB, GB, TB, PB, EB, ZB, YB [message #361222 is a reply to message #361221] Tue, 25 November 2008 07:26 Go to previous messageGo to next message
Michel Cadot
Messages: 64133
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
K (Kilo) = 1,024 Bytes
M (Mega) = 1,024 KB = 1,048,576 B
G (Giga) = 1,024 MB = 1,048,576 KB = 1,073,741,824 B
T (Tera) = 1,024 GB = 1,048,576 MB = 1,073,741,824 KB = 1,099,511,627,776 B
P (Peta) = 1,024 TB = 1,048,576 GB = 1,073,741,824 MB = 1,099,511,627,776 KB = 1,125,899,906,842,624 B
E (Exa) = 1,024 PB = 1,048,576 TB = 1,073,741,824 GB = 1,099,511,627,776 MB = 1,125,899,906,842,624 KB = 1,152,921,504,606,846,976 B

Regards
Michel
Re: SQL Function Convertion Bites to Bytes, KB, MB, GB, TB, PB, EB, ZB, YB [message #361223 is a reply to message #361221] Tue, 25 November 2008 07:30 Go to previous messageGo to next message
ygsunilkumar
Messages: 100
Registered: August 2008
Senior Member
Thanks for that..but i need full sql/pl/sql code and also for ZB, YB convertion
Re: SQL Function Convertion Bites to Bytes, KB, MB, GB, TB, PB, EB, ZB, YB [message #361226 is a reply to message #361223] Tue, 25 November 2008 07:41 Go to previous messageGo to next message
Michel Cadot
Messages: 64133
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Continue the serie multiplying by 1024 each time.
For the code, post what you already tried and explain in details what you want: input and output. Maybe you should post examples.

Regards
Michel
Re: SQL Function Convertion Bites to Bytes, KB, MB, GB, TB, PB, EB, ZB, YB [message #361964 is a reply to message #361226] Fri, 28 November 2008 20:53 Go to previous messageGo to next message
ygsunilkumar
Messages: 100
Registered: August 2008
Senior Member
hi..pls provide full sql code..i am unable to get the output..it will be very helpful if u give the full query...my requirement is if i give the in parameter as KB and out parameter shud convert to MB,GB,TB,PB,EB,ZB,YB,BITES and BYTES...thanks..
Re: SQL Function Convertion Bites to Bytes, KB, MB, GB, TB, PB, EB, ZB, YB [message #361977 is a reply to message #361964] Sat, 29 November 2008 00:26 Go to previous messageGo to next message
Michel Cadot
Messages: 64133
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Maybe you should post examples.

Quote:
post what you already tried

Regards
Michel
Re: SQL Function Convertion Bites to Bytes, KB, MB, GB, TB, PB, EB, ZB, YB [message #362006 is a reply to message #361964] Sat, 29 November 2008 12:42 Go to previous message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
We are not here to do your work for you. We are here to try to help you, but we expect you to put some effort in, rather than simply demanding the full solution. As Michel said, post what you have already attempted, someone will then help you complete it.
Previous Topic: Calculation Field and JavaScript and PL/SQL (2 threads merged by bb)
Next Topic: What is different between Oracle regular function & oracle function(LIKE,SUBSTR,INSTR)?
Goto Forum:
  


Current Time: Thu Dec 08 04:08:54 CST 2016

Total time taken to generate the page: 0.09877 seconds