How to compute the sum of words(or bytes) in tables?

Sir
Now there are several million records in a database, I want compute the sum of words(or bytes) in the tables by query condition. I have used ADO to access database, and use this SQL sentence-- 'select length(clo1)+length(col2)+..+length(coln) from tablename where ..' --to get resultset, and then sum the result, the speed is slowly. How can i do it in great efficiency?
thanks

Increasing efficiency?
You revisit the requirement. Determine exactly what is needed and whether adding LENGHTs of columns provides a correct, never mind accurate, answer.
Oracle space utilisation, physical row size and so on, are vastly more complex than a simply adding lengths of columns together.

Similar Messages

  • How to get the sum of  a column in a table layout region

    i have page table layout region and i have many rows in that ...i have a column say xyz now i want the sum of all xyz in all rows ...is that possible ..if it is how..????
    please help me out in this issues...so that i can proceed further with my work..im stuck otu here....if the solution r there in the devguide please tell me where it is ..i mean under which section...bcoz it 1400page document...

    If you are mentioning about table/advanced table region you can enable totalling in those regions. Please check the Table / Advanced Table section as appropriate in Chapter 4 of the dev guide.
    If it is not a table / advancedTable then you will have to programmatically total the column value and display it in the appropriate cell.

  • How to find the number of columns in an internal table DYNAMICALLY ?

    Hi,
    How to find the number of columns in an internal table DYNAMICALLY ?
    Thanks and Regards,
    saleem.

    Hi,
    you can find the number of columns and their order using
    the <b>'REUSE_ALV_FIELDCATALOG_MERGE'</b>
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = sy-repid
       I_INTERNAL_TABNAME           = 'ITAB'
       I_INCLNAME                   = sy-repid
      changing
        ct_fieldcat                  = IT_FIELDCAT
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif
    now describe your fieldcat . and find no of columns.
    and their order also..
    regards
    vijay

  • How to get the data from multiple nodes to one table

    Hi All,
    How to get the data from multiple nodes to one table.examples nodes are like  A B C D E relation also maintained
    Regards,
    Indra

    HI Indra,
    From Node A, get the values of the attributes as
    lo_NodeA->GET_STATIC_ATTRIBUTES(  IMPORTING STATIC_ATTRIBUTES = ls_attributesA  ).
    Similarily get all the node values from B, C, D and E.
    Finally append all your ls records to the table.
    Hope you are clear.
    BR,
    RAM.

  • How to get the data from pcl2 cluster for TCRT table.

    Hi frndz,
    How to get the data from pcl2 cluster for tcrt table for us payroll.
    Thanks in advance.
    Harisumanth.Ch

    PL take a look at the sample Program EXAMPLE_PNP_GET_PAYROLL in your system. There are numerous other ways to read payroll results.. Pl use the search forum option & you sure will get a lot of hits..
    ~Suresh

  • How to load the data from .csv file to oracle table???

    Hi,
    I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
    Thanks in advance

    981145 wrote:
    Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
    the command is
    sqlldrType it and see if you have it installed.
    Have a look also at the FAQ link posted by Marwin.
    There are plenty of examples also on the web.
    Regards.
    Al

  • How to get the object class field value in CDHDR table for vendor

    hi
    how to get the object class field value in CDHDR table for vendor

    Try KRED/KRED_N as object class in CDHDR for Vendor.

  • How to find the selected item in alv grid or table control

    can any one tell me please
    how to find the selected item in alv grid or table control

    In table control, If you goto screen painter and goto table control properties ( f2 ), there is one check-box w/selColumn check that and give column name. Then add that column to your internal table.
    IN PAI
      LOOP AT it_tkhdr.
        FIELD it_tkhdr-sel_row
          MODULE tab_tkhdr_mark ON REQUEST.
      ENDLOOP.
    MODULE tab_tkhdr_mark INPUT.
      MODIFY it_tkhdr INDEX tc_tkhdr-current_line.
    ENDMODULE.                 " tab_tkhdr_mark  INPUT
    here it_TKHDR is internal table sel_row is field for selection
    After that, you can loop at it_tkhdr where sel_row is 'X' to get selected rows.
    regards,
    Gagan

  • How to check the progress of statistics gathering on a table?

    Hi,
    I have started the statistics gathering on a few big tables in my database.
    How to check the progress of statistics gathering on a table? Is there any data dictionary views or tables to monitor the progress of stats gathering.
    Regds,
    Kunwar

    Hi all
    you can check with this small script.
    it lists the sid details for long running session like
    when it started
    when last update
    how much time still left
    session status "ACTIVE/INACTIVE". etc.
    -- Author               : Syed Kaleemuddin_
    -- Script_name          : sid_long_ops.sql
    -- Description          : list the sid details for long running session like when it started when last update how much time still left.
    set lines 200
    col OPNAME for a25
    Select
    a.sid,
    a.serial#,
    b.status,
    a.opname,
    to_char(a.START_TIME,' dd-Mon-YYYY HH24:mi:ss') START_TIME,
    to_char(a.LAST_UPDATE_TIME,' dd-Mon-YYYY HH24:mi:ss') LAST_UPDATE_TIME,
    a.time_remaining as "Time Remaining Sec" ,
    a.time_remaining/60 as "Time Remaining Min",
    a.time_remaining/60/60 as "Time Remaining HR"
    From v$session_longops a, v$session b
    where a.sid = b.sid
    and a.sid =&sid
    And time_remaining > 0;
    Sample output:
    SQL> @sid_long_ops
    Enter value for sid: 474
    old 13: and a.sid =&sid
    new 13: and a.sid =474
    SID SERIAL# STATUS OPNAME START_TIME LAST_UPDATE_TIME Time Remaining Sec Time Remaining Min Time Remaining HR
    474 2033 ACTIVE Gather Schema Statistics 06-Jun-2012 20:10:49 07-Jun-2012 01:35:24 572 9.53333333 .158888889
    Thanks & Regards
    Syed Kaleemuddin.
    Oracle Apps DBA
    Mobile: +91 9966270072
    Email: [email protected]

  • How to find the sum based on two variables

    Hello!
    I have just started using Numbers, I have a spreadsheet which lists a number of transactions.
    On my chart I have Columns "Date", "Memo", "Type", and "Amount".
    The Type column is a drop down list. What I want to do and find the sum for transactions that fall between a date range (i.e. months 1-3) and that match a certain "Type". I can figure out how to use the sumif function to find the sum for a date range, however I cant figure out how then to only sum only those that match a type.
    Any help?

    Brendon,
    This question arises from time to time in different situations. The answer is to first create an auxiliary column which calculates whether or not your multiple conditions have been met. In this case you have three - more than or equal a start date, less than or equal an end date, and a "Type".
    I'm assuming that your dates and "type" are flexible, so an extra table to enter your search data is shown below, but these three cells could be incorporated in your main table. The formula for the auxiliary column is:
    =IF(AND(Date>=Search Range :: A$2,Date<=Search Range :: B$2,Type=Search Range :: C$2),"SUM","")
    All rows with the word "SUM" satisfy the three conditions. The footer row contains the sum of the values meeting the desired conditions using:
    =SUMIF(Aux, “SUM”, Amount)
    Obviously this has to be reworked to your situation, but the auxiliary column is the key.
    pw
    Message was edited by: pw1840

  • How to compute the italian codice fiscale

    Is there anyone who can give me a PL/SQL or a package computing the italian codice fiscale getting in input Name, Sirname, birthdate, ...?
    I suppose it exists and I don't want to reinvent the wheel.
    My oracle version is 8.1.7 i
    Thanks in advance!

    Maybe
    using http://www.paginainizio.com/service/strutturacodicefiscale.htm but NOT TESTED (just something to play with)
    declare
    /* input data */
      nome    varchar2(50) := 'SUONOME';                       /* first name */
      cognome varchar2(50) := 'COGNOME';                       /* last name */
      nascita date         := to_date('19331122','yyyymmdd');  /* date of birth */
      sesso   varchar2(1)  := 'M';                             /* gender */
      comune  varchar2(4)  := 'A123';                          /* birthplace code */
    /* obtaining first/last name vowels and consonants */
      nome_c  varchar2(50) := translate(upper(nome),'~AEIOU','~');          /* first name consonants - vowels deleted */
      nome_v  varchar2(50) := translate(upper(nome),'~'||nome_c,'~');       /* first name vowels - consonants deleted */
      cnome_c varchar2(50) := translate(upper(cognome),'~AEIOU','~');       /* last name consonants - vowels deleted */
      cnome_v varchar2(50) := translate(upper(cognome),'~'||cnome_c,'~');   /* last name vowels - consonants deleted */
    /* computing code components */
      campo_1 varchar2(3)  := substr(substr(nome_c,1,1)||substr(nome_c,3,1)||substr(nome_c,4,1)||nome_v,1,3);         /* 1st,3rd,4th first name consonant */
      campo_2 varchar2(3)  := substr(substr(cnome_c,1,1)||substr(cnome_c,2,1)||substr(cnome_c,3,1)||cnome_v,1,3);     /* 1st,2nd,3rd last name consonant */
    /* vowels should be concatenated when there are not enough consonants -> how about DARIO FO ? DAI FO? */
      campo_3 varchar2(2)  := to_char(nascita,'YY');                                                                  /* last two digits of year of birth */
      campo_4 varchar2(1)  := substr('ABCDEHLMPRST',to_number(to_char(nascita,'MM')),1);                              /* month of birth converted */
      campo_5 varchar2(2)  := lpad(to_char(to_number(to_char(nascita,'DD')) + decode(sesso,'M',0,'F',40,100)),2,'0'); /* day of birth + 40 for women */
      campo_6 varchar2(4)  := comune;
    /* concatenating code (without check character) */
      codice  varchar2(16) := campo_1 || campo_2 || campo_3 || campo_4 || campo_5 || campo_6;
    /* conversion tables for check character computation */
      caratt  varchar2(36) := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';                                      /* characters to be converted */
      p_pari  varchar2(72) := '000102030405060708090001020304050607080910111213141516171819202122232425';  /* corresponding conversion numbers for even positions */
      p_disp  varchar2(72) := '010005070913151719210100050709131517192102041820110306081214161022252423';  /* corresponding conversion numbers for odd positions */
    /* auxiliary fields */
      somma   pls_integer  := 0;
      posiz   pls_integer;
    begin
      for i in 1 .. 15
      loop
        posiz := instr(caratt,substr(codice,i,1)));  /* the position of the i-th code character in the conversion table */
        if mod(i,2) = 0 then
          somma := somma + to_number(substr(p_pari,2 * posiz - 1,2));  /* the corresponding number added to the sum for even code character positions */
        else
          somma := somma + to_number(substr(p_disp,2 * posiz - 1,2));  /* the corresponding number added to the sum for odd code character positions */
        end if;
      end loop;
      somma := mod(somma,26);  /* the remainder of division */
      codice := codice || substr(caratt,somma + 11,1);  /* concatenating the check character */
      dbms_output.put_line(codice);
    end;Regards
    Etbin
    Edited by: Etbin on 24.12.2011 7:38
    row changed to if mod(i,2) = 0 then

  • How to get the sum in BSEG table using select statement

    hai all
    i made the internal tale "itab1" .. i want to get the som  feild of  DMBTR in BSG table my code is here but its not working gave som error massage (Aggregate functions and the addition DISTINCT are not supported in field lists for pooled and cluster tables.)  plz tel me how should i do it..... i want to get the som of that feild....          
    loop at itab1
         SELECT sum( DMBTR  ) from bseg INTO itab1-DMBTR141_45
             where GJAHR = itab1-GJAHR
             and   BELNR = itab1-BELNR.
    endloop.
    regard
    nawa

    SELECT BELNR GJAHR SHKZG DMBTR
                 from bseg
                 INTO table it_bseg
                 for all entries in itab1
                 where GJAHR = itab1-GJAHR
                   and BELNR = itab1-BELNR.
    loop at it_bseg.
        IF it_bseg-shkzg = 'H'.
          it_bseg-dmbtr = it_bseg-dmbtr * ( -1 ).
        ELSE.
          it_bseg-dmbtr = it_bseg-dmbtr.
        ENDIF.
        MODIFY it_bseg.
    endloop.
    loop at it_bseg.
    READ TABLE itab1 with key belnr = it_bseg-belnr
                               gjahr = it_bseg-gjahr.
    if sy-subrc = 0.
    collect it_bseg into it_bseg_amount.
    endif.
    endloop.
    U can use the collect statement
    Regards
    Gopi

  • How to get the sum in appropriate column without a red triangle appearing?

    Hello,
    In 'Numbers" - How do get columns to add (calculate) the sum in each decending column on an Expense Report.
    When I highlight the decending column the total appears on the far left of the screen.  When I drag the sum amount from there to the appropriate column a red triangle with an ! appears instead of the amount.
    Thanks for your immediate help.

    The red triangle is an Error triangle. Clicking it will display the error message and tell you what error has occurred. From your description, my assumption is that you dragged the SUM() function from the quick calculations at the lower left and dropped it intto a cell in the column being summed.
    If that's the case, this is likely the error message you would see:
    When you highlighted the 'decending column,' you likely selected all of the cells in that column, including the one into which you dropped the function.
    Instead, do one of the following. These assume the column you want to sum is column B.
    If you want the sum at the top of the column:
    Make sure the row you want the sum to appear in is a Header row.
    Enter this formula into any Header Row cell in column B:   =SUM(B)
    If you want the sum at the bottom of the column:
    Add a Footer row to the table. (Go Table (menu) > Footer Rows > 1).
    Enter this formula into the Footer Row cell in column B:   =SUM(B)
    SUM (and other functions) that expect a range of cells will interpret a cell reference entered using only the column letter (B) as meaning 'all of the non-header, non-footer cells in column B', and will exclude those cells in header or footer rows.
    Regards,
    Barry

  • How to find the sum of a column

    I need to find the sum of a column and use it in a different column. The following is the example.
    Column names: Feedback(Good, Avg, Poor), Count(no of good, no of avg, no of poor) and %age(Feedback/sum(feedback))
    I want to find the sum in Java class and also calculate the last column in java class.
    Please tell me some way to do it.

    oh.. ok ..thanks for letting me know.. i will formulate the question in a proper way:
    This is what my UI should look like:
    Rating Count Percent
    Excellent 2 20
    Good 6 60
    Poor 1 10
    Bad 1 10
    Now i have the following columns in the data base:
    Meaning and feedback_rating.
    So the following SQL Query:
    SELECT hrl.meaning rating,
    sum(decode(bcpi.feedback_rating, null, 0, 1)) counted
    from cmp_cwb_person_info bcpi ,
    hr_lookups hrl
    group by hrl.meaning
    will give me the result as
    rating counted
    Excellent 2
    Good 6
    Poor 1
    Bad 1
    Now I want a third column as percentage : Earlier we were doing this calculation in the sql query itself, so the query was like
    SELECT hrl.meaning rating,
    sum(decode(bcpi.feedback_rating, null, 0, 1)) counted,
    sum(decode(bcpi.feedback_rating, null, 0, 1))/(max (select count (*) from cmp_cwb_person_info bcpi ,
    hr_lookups hrl )) percent
    from cmp_cwb_person_info bcpi ,
    hr_lookups hrl
    group by hrl.meaning
    Hence the third column (percent) was calculated in the sql query itself.
    But now i feel that the performance of the query could be improved if we get the first two columns from the database and the calculate the third column programatically in the java code.
    So this is what I want to know. How can i do that?

  • How to find the sum of an advanced table column?

    Hi All,
    Good Morning..
    I have requirement where i need to calculate the sum of a column in an advanced table.and i need to put that value into some other field.
    i am doing customization so i can't touch the Standard page properties.so i need to achieve it through Pro-grammatically..
    my column name is unit price in the advanced table region.so i need the code to calculate the sum of the unit price.
    Thanks in advance
    Bharat

    Hi Bharat,
    No need for Programatic way as Advanced Table already provides this facility.
    The following steps describe how to enable Totaling for a column in the footer of an advanced table.
    Step 1: In the Structure pane of OA Extension, select the column container for which you want to enable Totaling Any column except for the first column can be totaled. Set the Total Value property for this column container to True.
    Step 2: In the Structure pane, select your advancedTable region and choose New > footer from the context menu. OA Extension creates an advancedTables Components folder containing a footer named child, that contains a tablefooter container (labeled tableFooter1).
    Step 3: Select the tableFooter container and choose New > total from the context menu. OA Extension creates a tableFooter Components folder containing a total named child, that contains a new totalRow item as shown in the figure below.
    Please let me know if you are still unable to get the Total Column
    HTH,
    Regards,
    Syed.

Maybe you are looking for

  • How to find the number of links in a website

    hi every body can any one clear my doubt my doubt is that in a website how to find the number of links the hole website contains is there any navigation tool to find that plz help me yar i am waiting for the reply

  • Move xml to application server

    Hi gurus iam converting sap data into xml and now iam able to download the file onto presentation server properly. now i want to write the file onto application server. DATA:   l_ixml            TYPE REF TO if_ixml,         l_streamfactory   TYPE REF

  • Error in Java Client proxy

    Hi All,     My scenario is JavaClient Proxy - XI---- >RFC. Here i generated JavaProxies for my Message interface and i imported that zip file into NWDS for my EjbModule project. and also i added Jar files in libraries by saying add External Jars. Her

  • SQL query returning data inconsitantly

    I am running Oracle 8i and have create a stored procedure that has a cursor in it. The select statement for the cursor returns 15 records that I loop through and insert into another table. At the beginning of the loop, just before the insert statemen

  • DISM error under WinPE

    Hello there, I have a problem with when I want to use DISM.exe during a Task sequence under WinPE. I run the following scripts under WinPE: (Run Command Line Task Sequence with Package) Powershell.exe -Command Set-executionpolicy remotesigned start "