How to calculate  the 99th percentile of a number stream ...

Environment:
Oracle 11.2.0.3 EE on Solaris 10.5
I have a stream of numbers (say 1000), I need to calculate the 99th percentile of the distribution of that stream such that when a new number 'n' is introduced I can tell if the new number is above the 99th percentile of the distribution of my stream.
I don't have a good feel for the nature of the distribution if that's important.
I am NOT, I repeat NOT a statistician! :-)
I have read the docs on the different functions available, ntile, percent_rank, percentile_cont, percentile_disc, etc. I have also read many articles referenced via Google.
The examples do not do exactly what I'm attempting and I was unable to get the result I need by trial and error (mostly!).
Any suggestions are most welcome!!!
If you need additional information I'll try to supply what I know.
-gary

Here are the CREATE TABLE and INSERT statements for some sample data:
create table sales(custno number, tran_dt date, amount number)Here are the INSERTs to load:
INSERT INTO SALES(custno, tran_dt, amount) VALUES (5, TO_DATE('23-MAR-12','DD-MON-RRRR'),3065);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (5, TO_DATE('29-FEB-12','DD-MON-RRRR'),8435);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (5, TO_DATE('29-FEB-12','DD-MON-RRRR'),9712);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (5, TO_DATE('20-MAR-12','DD-MON-RRRR'),1869);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (5, TO_DATE('03-AUG-12','DD-MON-RRRR'),647);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (5, TO_DATE('03-MAR-12','DD-MON-RRRR'),7434);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (5, TO_DATE('23-AUG-12','DD-MON-RRRR'),225);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (5, TO_DATE('01-SEP-12','DD-MON-RRRR'),28);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (5, TO_DATE('10-APR-12','DD-MON-RRRR'),9393);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('19-MAY-12','DD-MON-RRRR'),1010);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('29-FEB-12','DD-MON-RRRR'),2625);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('18-MAR-12','DD-MON-RRRR'),2511);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('15-AUG-12','DD-MON-RRRR'),1156);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('17-AUG-12','DD-MON-RRRR'),5106);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('19-AUG-12','DD-MON-RRRR'),714);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('07-APR-12','DD-MON-RRRR'),6105);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('25-MAY-12','DD-MON-RRRR'),1592);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('14-MAY-12','DD-MON-RRRR'),1880);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('29-JUL-12','DD-MON-RRRR'),8497);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('13-MAY-12','DD-MON-RRRR'),1658);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('06-APR-12','DD-MON-RRRR'),3071);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('04-SEP-12','DD-MON-RRRR'),8277);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('20-MAR-12','DD-MON-RRRR'),3929);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('04-MAR-12','DD-MON-RRRR'),9239);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('24-APR-12','DD-MON-RRRR'),4390);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('12-MAY-12','DD-MON-RRRR'),8362);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('06-APR-12','DD-MON-RRRR'),4157);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('01-SEP-12','DD-MON-RRRR'),9260);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('31-MAR-12','DD-MON-RRRR'),8017);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('20-MAY-12','DD-MON-RRRR'),2420);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('21-JUL-12','DD-MON-RRRR'),5272);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('23-AUG-12','DD-MON-RRRR'),313);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('24-MAY-12','DD-MON-RRRR'),4747);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('25-APR-12','DD-MON-RRRR'),272);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('02-MAY-12','DD-MON-RRRR'),4329);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('28-JUL-12','DD-MON-RRRR'),3149);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('18-MAR-12','DD-MON-RRRR'),1740);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('07-MAR-12','DD-MON-RRRR'),6868);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('02-JUN-12','DD-MON-RRRR'),5661);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('08-MAY-12','DD-MON-RRRR'),6136);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('23-AUG-12','DD-MON-RRRR'),512);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('16-AUG-12','DD-MON-RRRR'),8784);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('31-AUG-12','DD-MON-RRRR'),7300);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('12-MAY-12','DD-MON-RRRR'),9303);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('29-MAR-12','DD-MON-RRRR'),2626);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('14-JUL-12','DD-MON-RRRR'),6365);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('19-JUN-12','DD-MON-RRRR'),7880);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('20-JUN-12','DD-MON-RRRR'),6096);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('05-AUG-12','DD-MON-RRRR'),1980);
INSERT INTO SALES(custno, tran_dt, amount) VALUES (26, TO_DATE('27-MAY-12','DD-MON-RRRR'),3004);I can now calculate the average sales over the past 6 months (180 day) and 1 month (30 day) periods. I don't need the 6 month average but I do need the individual sales to get the distribution and hence the standard deviations and hopefully the 99th percentile number. I know it's around 3 standard deviations but the spec I'm working with requires using the 99th percentile. Not my choice! :-)
select custno,
         avg(case when tran_dt between sysdate -210 and sysdate -31 then amount else 0 end) sales6mo,
         avg(case when tran_dt >= sysdate -30 then amount else 0 end) sales1mo,
         stddev(amount) sd,
         stddev(amount)*3 sd3
from sales
group by custno;I want to see if there are any customers' (I know I only generated 2) 1 month sales that are more than the 99th percentile of the 6 month distribution.
If it's easier to use a lower percentile I can use the examples to plug in the 99.
Here is the result of the above query:
    CUSTNO   SALES6MO   SALES1MO         SD        SD3
         5 4506.11111 28.1111111 4142.61146 12427.8344
        26 3563.81579 1090.05263  2952.1488 8856.44641So, from this data I would expect my 99th percentile to be close to the SD3 column. Correct?
Thanks very much for the assistance!!
-gary
Edited by: garywicke on Sep 5, 2012 9:54 AM

Similar Messages

  • How to calculate the area of a large number of polygons in a single query

    Hi forum
    Is it possible to calculate the area of a large number of polygons in a single query using a combination of SDO_AGGR_UNION and SDO_AREA? So far, I have tried doing something similar to this:
    select sdo_geom.sdo_area((
    select sdo_aggr_union (   sdoaggrtype(mg.geoloc, 0.005))
    from mapv_gravsted_00182 mg 
    where mg.dblink = 521 or mg.dblink = 94 or mg.dblink = 38 <many many more....>),
    0.0005) calc_area from dualThe table MAPV_GRAVSTED_00182 contains 2 fields - geoloc (SDO_GEOMETRY) and dblink (Id field) needed for querying specific polygons.
    As far as I can see, I need to first somehow get a single SDO_GEOMETRY object and use this as input for the SDO_AREA function. But I'm not 100% sure, that I'm doing this the right way. This query is very inefficient, and sometimes fails with strange errors like "No more data to read from socket" when executed from SQL Developer. I even tried with the latest JDBC driver from Oracle without much difference.
    Would a better approach be to write some kind of stored procedure, that adds up all the single geometries by adding each call to SDO_AREA on each single geometry object - or what is the best approach?
    Any advice would be appreciated.
    Thanks in advance,
    Jacob

    Hi
    I am now trying to update all my spatial table with SRID's. To do this, I try to drop the spatial index first to recreate it after the update. But for a lot of tables I can't drop the spatial index. Whenever I try to DROP INDEX <spatial index name>, I get this error - anyone know what this means?
    Thanks,
    Jacob
    Error starting at line 2 in command:
    drop index BSSYS.STIER_00182_SX
    Error report:
    SQL Error: ORA-29856: error occurred in the execution of ODCIINDEXDROP routine
    ORA-13249: Error in Spatial index: cannot drop sequence BSSYS.MDRS_1424B$
    ORA-13249: Stmt-Execute Failure: DROP SEQUENCE BSSYS.MDRS_1424B$
    ORA-29400: data cartridge error
    ORA-02289: sequence does not exist
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 27
    29856. 00000 - "error occurred in the execution of ODCIINDEXDROP routine"
    *Cause:    Failed to successfully execute the ODCIIndexDrop routine.
    *Action:   Check to see if the routine has been coded correctly.
    Edit - just found the answer for this in MetaLink note 241003.1. Apparently there is some internal problem when dropping spatial indexes, some objects gets dropped that shouldn't be. Solution is to manually create the sequence it complains it can't drop, then it works... Weird error.

  • How to calculate the 99th% times

    I have a set of results for which I need to calculate response times other than the 90th% -- particularly the 99th%, but probably also the 95th% and 99.9th%.
    What options are available for this? The reporting tool seems to calculate only the 90th% -- but since that value is calculated on the fly based on the time filter, the raw data must be available, presumably in the database. Is that schema documented anywhere so that I can pull out the numbers and do the calculation myself? Or is there some other approach?

    Hello
    Yes, you need either to export data from the console to CSV or XLS or go to the database.
    Don't have a documented schema but see this kind of requests:
    -- Report Timers par Steps
    SELECT s.sessionname,
      ch.countername,
      ch.objname,
      ch.instname,
      round(min(cr.counterval),3) "Min",
      round(max(cr.counterval),3) "Max",
      round(avg(cr.counterval),3) "Avg",
      sum(cr.iteration) "Pass",
      sum(cr.errflag*1) "Fail",
      round(stddev(cr.counterval),3) "Std Dev" 
    FROM olt.sessionrun s,
      olt.counterhdr ch,
      olt.counterrun cr
    WHERE s.sessionrunid=ch.sessionrunid
    AND ch.counterhdrid =cr.counterhdrid
    AND ch.countername  = 'Avg Server Time (sec)'
    AND s.sessionname   = '&1'
    AND ch.instname LIKE '[%'
    group by s.sessionname, ch.countername, ch.objname, ch.instname
    ORDER BY s.sessionname, ch.countername, ch.objname, lpad(substr(instname, 2,instr(instname,']')-2), 3,'0')
    JB

  • To calculate the 90th percentile in OBIEE

    Hi All,
    Can anyone help me how to calculate the 90th percentile in OBIEE.
    Thanks in advance;
    Rajeev.

    Hi,
    Expand the Dimensional Hierarchy that you have created and at the level where you need to stop the drill down-->open that level-->in general-->uncheck the 'Supports rollup to higher level of aggregation' and this should solve your problem.
    Otherwise if you need only till 4th level, then create till 4th level for hierarchy.
    Hope this should solve your problem.
    Regards
    MuRam

  • How to calculate the unit for RATE?

    Hey All,
    I am not sure if there is something standard for this or not.
    I am calculating the 'Rate' by using 'Value/Amount' and 'Quantity' as follows -
    Rate == Value /  Quantity
    I need to calculate the unit for the rate as below -
    Rate unit == Value unit (Currency) /  Quantity unit (Base_uom) 
    (for example -
    if value is 1000 USD and quantity is 10 TO then Rate should come out as 100 USD / TO)
    Could anyone please suggest how to calculate the unit in this case?
    Many Thanks!
    Tanu

    Hi,
    Go through the below link it may give some idea
    http://help.sap.com/saphelp_nw04/Helpdata/EN/19/1d7abc80ca4817a72009998cdeebe0/content.htm
    Regards,
    Marasa.

  • How to calculate the Current APC (Acquisition and Production Cost)

    Hi,
    Please help me how to calculate the Current APC.
    The Current APC (Acquisition and Production Cost) is a calculated value based on Previous Year Acquisition balance plus any value changes up to the time of the report.
    The Asset History Report (RAGITT_ALV01) calculates the Current APC value &
    The Current APC can also be found in the Asset Explorer (transaction code AW01N) under Country Book 10/ Posted Values tab then the line “Acquisition Value” and column “Posted values”.
    I suppose that the calculation of Current APC (Acquisition and Production Cost) is getting done in the GET statements in the report RAGITT_ALV01, but unable to find the actual logic.
    Please help me.
    Thanks in advance,
    Satish

    Hi,
    you'll find the logic in fm FI_AA_VALUES_CALCULATE
    A.

  • How to calculate the Current APC

    Hi,
    Please help me how to calculate the Current APC.
    The Current APC (Acquisition and Production Cost) is a calculated value based on Previous Year Acquisition balance plus any value changes up to the time of the report.
    The Asset History Report (RAGITT_ALV01) calculates the Current APC value &
    The Current APC can also be found in the Asset Explorer (transaction code AW01N) under Country Book 10/ Posted Values tab then the line “Acquisition Value” and column “Posted values”. 
    Thanks in advance,
    Satish

    Hi,
    I suppose that the calculation of Current APC (Acquisition and Production Cost) is getting done in the GET statements in the report RAGITT_ALV01, but unable to find the actual logic where it is being done.
    Please help me.
    Thanks in advance,
    Satish

  • How to calculate the Daily Call Volume

    Hello,
    Can anyone please advise how to calculate the daily call volume in a contact center - the counts of the calls terminated in ICM ?
    Is there any webview report or a SQL query which provides the count ?
    Many thanks in advance for the help!
    Thanks & Regards,
    Naresh

    The ICM software generates a Termination_Call_Detail record for each call that arrives at the peripheral. From This report you can get the number of calls to ICM as well as the call details.
    To get the report run this sql query
    select * from dbo.t_Termination_Call_Detail where convert (varchar(10), DateTime, 101) = '12/03/2010'

  • How to calculate the variance in PO price history?

    hi
    i hav standard report ME1P, since i need to do some modifications in this program i copied to Y prgrm,,,'
    im getting all the values properly...
    but my prblm is im not getting how to calculate the variance? im not getting the logic behid it...
    can anybody expln me in breif plz....
    Regards
    Smitha

    Hi Venu,
    there is another way as well, however, you won't be able to see Variance and Variance% as a saperate keyfigure which is not under the period. Thats the reason I didn't mention it earlier.
    What you can do is, Drag the period to the columns, Now create a structure that has the two keyfigures std price, moving price. Here if you add Variance and Variance%, Then these CKF's would come under period as well, which you don't need. And the system won't allow you to add these CKF's outside this structure. The reason being because the interpretation of the data then wouldn't make any sense here. You can create a new structure as well with these CKF's but they would become a subpart of your previous structure.
    choose the required characteristics in the Rows section. Save it.
    Let us know, Sorry man, can't help u much at this problem.
    regards,
    Sree.

  • How to calculate the quota base quantity in quota arrangement?

    Hi all,
    As we all know, when a new supplier is added in the quota arrangment, we take the help of quota base qunatity so that the new supplier does not get any unfair advantage over the existing suppliers. Would you please help me on how to calculate the quota base quantity or on what basis the quota base quantity is calculated?*
    Regards,
    Ranjan

    Dear,
    Quota arrangement divides the total requirements generated over a period of time among the sources of supplied by assigning a quota.
    Quota u2013 quota is equal to a number and its represents the proportionate of requirements. Total quota of all the vendors is equal to 100% of requirements.
    This quota arrangement is also specific to material and plant level.
    Quota rating = quota allocate quantity + quota base quantity / quota.
    Quota based quantity used only when a new vendor introduced.
    In the as on date situation, the minimum quota ratings will considered as preferred vendor.
    The 2 vendors has 2 same quota rating, the vendor who is having the highest quota will considered first.
    In the running quota, a new source of supply is included. (In situation of short supply) including a new source not means to reduce the quota for existing.
    Regards,
    Syed Hussain.

  • How to calculate the individual sums of multiple columns in a single query

    Hello,
    Using Oracle 11gR2 on windows 7 client. I have a question on calculating sum() on multiple columns on different columns and store the results in a view. Unfortunately I could not post the problem here as it keeps on giving error "Sorry, this content is not allowed", without telling where or what it is! So I had to post it in the stack-overflow forum, here is the link: http://stackoverflow.com/questions/16529721/how-to-calculate-the-individual-sums-of-multiple-columns-in-a-single-query-ora
    Will appreciate any help or suggestion.
    Thanks

    user13667036 wrote:
    Hello,
    Using Oracle 11gR2 on windows 7 client. I have a question on calculating sum() on multiple columns on different columns and store the results in a view. Unfortunately I could not post the problem here as it keeps on giving error "Sorry, this content is not allowed", without telling where or what it is! So I had to post it in the stack-overflow forum, here is the link: http://stackoverflow.com/questions/16529721/how-to-calculate-the-individual-sums-of-multiple-columns-in-a-single-query-ora
    Will appreciate any help or suggestion.
    ThanksLooks like you want a simple group by.
    select
              yr
         ,      mnth
         ,      region
         ,     sum(handled_package)
         ,     sum(expected_missing_package)
         ,     sum(actual_missing_package)
    from test
    group by
         yr, mnth, region
    order by      
         yr, mnth, region;I wouldn't recommend storing your data for year / month in 2 columns like that unless you have a really good reason. I would store it as a date column and add a check constraint to ensure that the date is always the first of the month, then format it out as you wish to the client.
    CREATE TABLE test
         year_month                              date,
        Region                     VARCHAR2(50),
        CITY                       VARCHAR2(50),             
        Handled_Package            NUMBER,       
        Expected_Missing_Package   NUMBER,   
        Actual_Missing_Package     NUMBER
    alter table test add constraint firs_of_month check (year_month = trunc(year_month, 'mm'));
    ME_XE?Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
      2  Values (to_date('2012-nov-12', 'yyyy-mon-dd'), 'Western', 'San Fransisco', 200, 10, 5);
    Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
    ERROR at line 1:
    ORA-02290: check constraint (TUBBY.FIRS_OF_MONTH) violated
    Elapsed: 00:00:00.03
    ME_XE?Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
      2  Values (to_date('2012-nov-01', 'yyyy-mon-dd'), 'Western', 'San Fransisco', 200, 10, 5);
    1 row created.
    Elapsed: 00:00:00.01
    ME_XE?select
      2        to_char(year_month, 'fmYYYY')    as year
      3     ,  to_char(year_month, 'fmMonth')   as month
      4     ,  Region
      5     ,  CITY
      6     ,  Handled_Package
      7     ,  Expected_Missing_Package
      8     ,  Actual_Missing_Package
      9  from test;
    YEAR         MONTH                REGION                         CITY                    HANDLED_PACKAGE EXPECTED_MISSING_PACKAGE ACTUAL_MISSING_PACKAGE
    2012         November             Western                        San Fransisco                       200                       10                      5
    1 row selected.
    Elapsed: 00:00:00.01
    ME_XE?Then you have nice a nice and easy validation that ensures you data integrity.
    Cheers,

  • How to calculate the average inventory in ABAP

    Dear All,
    Please find the below formula and this formula how to calculate the Average inventory at value.Please let me know the abap base tables and the corresponding fields.
    Formula
    Inventory Turnover = Cost of Goods Sold (COGS) / Average Inventory at value.
    Thanks
    Regards,
    Sai

    Hi Arivazhagan,
    Thanks for your quick response .
    The field MBEWH from the table is fulfill the average inventory at value.
    For Eg :I want to calculate Inventory Turnover = Cost of Goods Sold (COGS)/
    Average Inventory at value.
    so shall i take Inventory Turnover = Cost of Goods Sold (COGS)/MBEWH
    The above formula will meet my requirement to find the average inventory Turnover.
    Thanks
    Regards,
    Sai

  • How to calculate the number of sent/received emails of a certain domain

    Thank you for what you have helped me with!
    How to calculate the number of sent/received emails of a certain domain in a certain period? It is Messaging Server 5.2, Directory Server 4.2. Is there a log option for this?
    Thank you.

    Not sure where you find, "LOG_MESSSAGE_ADD". I don't actually find this option in the documentation.
    The domains that mails are coming from and being sent to are certainly logged in the normal mail.log, so why mess with additional logging options? If you're talking about "LOG_CONNECTION", I actually see no additional data that is useful to you.
    If you decide to change the option.dat, you do indeed need to
    imsimta cnbuild (note, it's not cnrebuild)
    imsimta restart
    If I were facing the same issue, I'd be looking at the log parsing perl script, and simply modifying it to do what I wanted.

  • How to calculate the size of web forms in hyperion planning?

    Hi Experts,
    I am trying to calculate the size of planning forms in Hyperion smart view., but i am unable to find out the way to calculate.
    Can you pls explain how to calculate the size of web form in Smart view?
    --- Srini.

    Hi Srini,
    First, here is what Oracle says:
    Data Form Size Estimation:
    To get a rough estimate of data form size, open the data form and select File > Save As from the browser. The size of the .HTML file is the portion of the data form that changes based on grid size. The .JS files remain the same size and can be cached, depending on browser settings. Information such as data form definitions, pages, and .gif files are not compressed when data forms are opened and sent to the Web browser.
    I have not been able to find out using their method.
    In any case, you can find out the size of grid by using below
    1. Right click on the form grid and click "View source"
    2. Save the source file as "Example.html"
    3. Right click the saved file and click "Properties"
    4. The Form size whould be same as that of file..
    Let me know if it helps.
    Cheers
    RS

  • How to calculate the row size

    Hi,
    I am having a table of 4 column. First column is varchar2(10), Second column is Number(5), Third column is char(10) and Fourth column is Number(12,2).
    Now how to calculate the size of each row. I want to know how much space it will take for each row.
    Thanx & Regards,
    Swarup

    For a complete discussion of storage requirements for different datatypes see the Oracle 8i Concepts manual.
    All Oracle documentation is available on-line via the 'Documentation' link on the OTN home page.
    Your Col2 NUMBER(5) will take 4 bytes if it holds a 5 digit positive or negative number.
    Your Col4 NUMBER(12,2) will take 7 bytes if it holds a number with 12 digits that is positive and will take 8 bytes if it holds a number with 12 digits that is negative.
    The following is from the Concepts manual Chapter 12 (Copyright by Oracle)
    Built-In Datatypes 12-9
    Internal Numeric Format
    Oracle stores numeric data in variable-length format. Each value is stored in
    scientific notation, with one byte used to store the exponent and up to 20 bytes to
    store the mantissa. The resulting value is limited to 38 digits of precision. Oracle
    does not store leading and trailing zeros. For example, the number 412 is stored in a
    format similar to 4.12 x 10 2 , with one byte used to store the exponent (2) and two
    bytes used to store the three significant digits of the mantissa (4, 1, 2). Negative
    numbers include the sign in their length.
    Taking this into account, the column size in bytes for a particular numeric data
    value NUMBER ( p), where p is the precision of a given value, can be calculated
    using the following formula:
    ROUND((length( p)+ s)/2))+1
    where s equals zero if the number is positive and s equals 1 if the number is
    negative.
    Zero and positive and negative infinity (only generated on import from Version 5
    Oracle databases) are stored using unique representations. Zero and negative
    infinity each require one byte; positive infinity requires two bytes.
    null

Maybe you are looking for