How to Find the Internal Physical Length of a Number Datatype? (文档 ID 143256.1)

本文介绍了Oracle数据库中数值类型(NUMBER)的内部存储方式及其长度计算公式。Oracle使用变长格式存储数值,采用科学计数法表示,包括用于存储指数的一个字节和最多20个字节来存储尾数部分。文章还提供了根据数值精度计算列字节大小的公式。

代码如下:Sub CopyDataByType(dataType As String) Dim ws1 As Worksheet, ws2 As Worksheet, wsDest As Worksheet Dim lastRow As Long, destRow As Long Dim rng As Range, cell As Range Dim i As Integer ' ??????? Set ws1 = ThisWorkbook.Sheets("CGHR") Set ws2 = ThisWorkbook.Sheets("CGMA & CGSP") Set ws3 = ThisWorkbook.Sheets("CHHT & CGBO & CGWE") Set ws4 = ThisWorkbook.Sheets("CGEL") Set ws5 = ThisWorkbook.Sheets("CPPL") Set wsDest = ThisWorkbook.Sheets("SORT") ' ???????(?????,????????) wsDest.Cells.ClearContents ' ????????,???????,?????????? ' ????????,??????,?????????????? If wsDest.Range("A1").Value <> "" Then lastRow = wsDest.Cells(wsDest.Rows.Count, "A").End(xlUp).Row If lastRow > 1 Then wsDest.Range("A2:Z" & lastRow).ClearContents End If End If ' ??Sheet1???????? lastRow = ws1.Cells(ws1.Rows.Count, "I").End(xlUp).Row ' ??????D? destRow = 2 ' ??????(????????) For i = 2 To lastRow ' ????????,???????? If ws1.Cells(i, "I").Value = dataType Then ' ???? ws1.Rows(i).Copy Destination:=wsDest.Rows(destRow) destRow = destRow + 1 End If Next i ' ??Sheet2???????? lastRow = ws2.Cells(ws2.Rows.Count, "I").End(xlUp).Row ' ??????D? For i = 2 To lastRow ' ????????,???????? If ws2.Cells(i, "I").Value = dataType Then ' ???? ws2.Rows(i).Copy Destination:=wsDest.Rows(destRow) destRow = destRow + 1 End If Next i lastRow = ws3.Cells(ws3.Rows.Count, "I").End(xlUp).Row ' ??????D? For i = 2 To lastRow ' ????????,???????? If ws3.Cells(i, "I").Value = dataType Then ' ???? ws3.Rows(i).Copy Destination:=wsDest.Rows(destRow) destRow = destRow + 1 End If Next i lastRow = ws4.Cells(ws4.Rows.Count, "I").End(xlUp).Row ' ??????D? For i = 2 To lastRow ' ????????,???????? If ws4.Cells(i, "I").Value = dataType Then ' ???? ws4.Rows(i).Copy Destination:=wsDest.Rows(destRow) destRow = destRow + 1 End If Next i lastRow = ws5.Cells(ws5.Rows.Count, "I").End(xlUp).Row ' ??????D? For i = 2 To lastRow ' ????????,???????? If ws5.Cells(i, "I").Value = dataType Then ' ???? ws5.Rows(i).Copy Destination:=wsDest.Rows(destRow) destRow = destRow + 1 End If Next i ' ????????????? End Sub
07-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值