Problem with collection in cursor

hi ,
oracle srvr : 10.2.0.1.0
when I'm executing the following
declare
type i_values is varray(20000) of employee_details%rowtype;
s_values i_values :=i_values();
cursor c1 is select * from employee_details where rownum < 11;
begin
loop
begin
fetch c1  into s_values  ;
s_values.extend;
exit when c1%NOTFOUND;
exception
when  invalid_cursor then
dbms_output.put_line('Cursor invalid');
when others then
dbms_output.put_line('Others');
end ;
end loop;
for i in 1 .. s_values.count loop
dbms_output.put_line(s_values(i).eid);
end loop;
end;
/ I get the error as
ERROR at line 8:
ORA-06550: line 8, column 16:
PLS-00597: expression 'S_VALUES' in the INTO list is of wrong type
ORA-06550: line 8, column 1:
PL/SQL: SQL Statement ignoredInstead when I run cursor as bulk collect its executing but going to a infinite loop
please help

As Justin showed, you want to use BULK collect if you need to fetch data into a collection.
e.g.
SQL> set serverout on
SQL> ed
Wrote file afiedt.buf
  1  declare
  2    type t_emps is table of emp%rowtype;
  3    v_emps t_emps;
  4    cursor c1 is
  5      select *
  6      from emp
  7      where rownum <= 10;
  8  begin
  9    open c1;
10    fetch c1 bulk collect into v_emps;
11    close c1;
12    for i in 1 .. v_emps.count
13    loop
14      dbms_output.put_line(v_emps(i).empno||' - '||v_emps(i).ename);
15    end loop;
16* end;
SQL> /
7369 - SMITH
7499 - ALLEN
7521 - WARD
7566 - JONES
7654 - MARTIN
7698 - BLAKE
7782 - CLARK
7788 - SCOTT
7839 - KING
7844 - TURNER
PL/SQL procedure successfully completed.
SQL>If your code has got stuck in an infinite loop, you've probably left the LOOP construct in your code. That isn't needed with a bulk collect, unless you limit the number of rows fetched and need to process in set sized chunks.
If you planning on extracting the data to a load of INSERT statements then consider that as being bad practice.
You would be better to export the data to a flat file (CSV) and then have the receiving database use an external table (or SQL*Loader) if you must, to load that data back in. Lots of insert statements WILL be slow.
If you want to export data to a flat file you can use something like:
As sys user:
CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
/As myuser:
CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                     ,p_dir IN VARCHAR2
                                     ,p_header_file IN VARCHAR2
                                     ,p_data_file IN VARCHAR2 := NULL) IS
  v_finaltxt  VARCHAR2(4000);
  v_v_val     VARCHAR2(4000);
  v_n_val     NUMBER;
  v_d_val     DATE;
  v_ret       NUMBER;
  c           NUMBER;
  d           NUMBER;
  col_cnt     INTEGER;
  f           BOOLEAN;
  rec_tab     DBMS_SQL.DESC_TAB;
  col_num     NUMBER;
  v_fh        UTL_FILE.FILE_TYPE;
  v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
BEGIN
  c := DBMS_SQL.OPEN_CURSOR;
  DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
  d := DBMS_SQL.EXECUTE(c);
  DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
  FOR j in 1..col_cnt
  LOOP
    CASE rec_tab(j).col_type
      WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
      WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
      WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
    ELSE
      DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
    END CASE;
  END LOOP;
  -- This part outputs the HEADER
  v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
  FOR j in 1..col_cnt
  LOOP
    v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
  END LOOP;
  --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
  UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
  IF NOT v_samefile THEN
    UTL_FILE.FCLOSE(v_fh);
  END IF;
  -- This part outputs the DATA
  IF NOT v_samefile THEN
    v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
  END IF;
  LOOP
    v_ret := DBMS_SQL.FETCH_ROWS(c);
    EXIT WHEN v_ret = 0;
    v_finaltxt := NULL;
    FOR j in 1..col_cnt
    LOOP
      CASE rec_tab(j).col_type
        WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                    v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
        WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                    v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
        WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                    v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
      ELSE
        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
      END CASE;
    END LOOP;
  --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
    UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
  END LOOP;
  UTL_FILE.FCLOSE(v_fh);
  DBMS_SQL.CLOSE_CURSOR(c);
END;This allows for the header row and the data to be written to seperate files if required.
e.g.
SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
PL/SQL procedure successfully completed.Output.txt file contains:
empno,ename,job,mgr,hiredate,sal,comm,deptno
7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
Adapt to output different datatypes and styles are required.

Similar Messages

  • Has anybody had a problem with the mouse cursor lagging when navigating the drop down menus? this only started happening after a re-install. it only occurs in Photoshop elements 13 in the  photo editing section,and no other application. My mouse drivers a

    Has anybody had a problem with the mouse cursor lagging when navigating the drop down menus? this only started happening after a re-install. it only occurs in Photoshop elements 13 in the  photo editing section,and no other application. My mouse drivers are up to date.Any help or advice would be most welcome.

    Good day!
    Please post Photoshop Elements related queries over at
    http://forums.adobe.com/community/photoshop_elements
    and please read this (in particular the section titled "Supply pertinent information for quicker answers"):
    http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html
    Regards,
    Pfaffenbichler

  • Problem with my hand cursor: it shows three little hands

    Hi there,
    I work for many years with CS4 and now suddenly, my hand cursor shows up as three little hands in a row. I don't know what went wrong or how to correct this. Please help
    Bert

    Hi there,
    That works! And my mouse is scrolling a lot smoother too! Thanks a lot! I am very grateful.
    Best Regards
    Bert
    Boteijken 323
    3454 PD De Meern
    Tel:   030-8201164
    Mob: 0655-720309
    Email:  <mailto:[email protected]> [email protected]
    Van: R_Kelly [email protected]
    Verzonden: zaterdag 31 augustus 2013 17:32
    Aan: Roozworks
    Onderwerp: Problem with my hand cursor: it shows three little hands
    Re: Problem with my hand cursor: it shows three little hands
    created by R_Kelly <http://forums.adobe.com/people/R_Kelly>  in Photoshop for Beginners - View the full discussion <http://forums.adobe.com/message/5642784#5642784

  • Apex 4 , problem with collection executions

    Hi ,
    I am having the following problem with the execution of one collection :
    Reference thread : Re: APEX 4 , executing a remote procedure and populating data using collection
    DBNAME ---> list item which I build from the DB links which I built ( as dynamic query in the shared components from a local table which holds entries of dblink names )
    USERLIST --> list item of users which should display dynamicaly the users of that db link I choose in DBNAME ( based on a collection )
    buttons CANCEL and SUBMIT
    4- Initial COLLECTION page process which is calculated before Header :
    DECLARE
    q varchar2(4000);
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS(P_COLLECTION_NAME => 'QRY1') THEN
    APEX_COLLECTION.DELETE_COLLECTION(P_COLLECTION_NAME => 'QRY1');
    END IF;
    q := 'SELECT username , username FROM sys.dba_users@'||:P23_DBNAME ;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
    P_COLLECTION_NAME => 'QRY1',
    P_QUERY => Q);
    END;
    For USERLIST list item I am using the following in LIST OF VALUES DEFINITION :
    SELECT C001, C002 FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='QRY1'
    5 - to submit the values from the screen to the remote database procedure I am using the following submit process ON SUBMIT AFTER CALCULATIONS:
    DECLARE
    v_statement varchar2(255);
    BEGIN
    v_statement := 'begin
    Lock_User@&P24_DBNAME.(''&P24_USERLIST.'');
    insert into log values (1,''user locked'') ;
    commit ;
    end;';
    EXECUTE IMMEDIATE v_statement;
    END;
    The problem :
    The form runs sucessfully , where I the USERLIST changes dynamicaly when I change the DBNAME values , but as soon as I logout and login with another user1 , the collection does not execute and i get "ORA-01729: database link name expected".
    I login with user1 in edit mode and recreate the collection , run again , the collection executes successfuly .
    If I create a new user2 ( using the sample application pages ) and login with the new user2 , i have the same problem , thus I ho login with user2 in edit mode and try to run the collection .
    How can I control the collection to execute regardless of the application user logged in ??
    thanks in advance
    yousef

    Hi ,
    I am having the following problem with the execution of one collection :
    Reference thread : Re: APEX 4 , executing a remote procedure and populating data using collection
    DBNAME ---> list item which I build from the DB links which I built ( as dynamic query in the shared components from a local table which holds entries of dblink names )
    USERLIST --> list item of users which should display dynamicaly the users of that db link I choose in DBNAME ( based on a collection )
    buttons CANCEL and SUBMIT
    4- Initial COLLECTION page process which is calculated before Header :
    DECLARE
    q varchar2(4000);
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS(P_COLLECTION_NAME => 'QRY1') THEN
    APEX_COLLECTION.DELETE_COLLECTION(P_COLLECTION_NAME => 'QRY1');
    END IF;
    q := 'SELECT username , username FROM sys.dba_users@'||:P23_DBNAME ;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
    P_COLLECTION_NAME => 'QRY1',
    P_QUERY => Q);
    END;
    For USERLIST list item I am using the following in LIST OF VALUES DEFINITION :
    SELECT C001, C002 FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='QRY1'
    5 - to submit the values from the screen to the remote database procedure I am using the following submit process ON SUBMIT AFTER CALCULATIONS:
    DECLARE
    v_statement varchar2(255);
    BEGIN
    v_statement := 'begin
    Lock_User@&P24_DBNAME.(''&P24_USERLIST.'');
    insert into log values (1,''user locked'') ;
    commit ;
    end;';
    EXECUTE IMMEDIATE v_statement;
    END;
    The problem :
    The form runs sucessfully , where I the USERLIST changes dynamicaly when I change the DBNAME values , but as soon as I logout and login with another user1 , the collection does not execute and i get "ORA-01729: database link name expected".
    I login with user1 in edit mode and recreate the collection , run again , the collection executes successfuly .
    If I create a new user2 ( using the sample application pages ) and login with the new user2 , i have the same problem , thus I ho login with user2 in edit mode and try to run the collection .
    How can I control the collection to execute regardless of the application user logged in ??
    thanks in advance
    yousef

  • Help me please : Serious problems with collection-mapping, list-mapping and map-mappi

    Hi everybody;
    I have serious problems with list-mapping, collection-mapping and map-mapping.
    Acording to specifications and requirements in a system I am working on it is needed to
    get a "list" of values or an indivudual value.I am working with ORACLE 9i Database,
    ORACLE 9i AS and ORACLE 9i JDEVELOPER.
    I tried to map a master-detail relationship in an entity-bean, using list-mapping.
    And this was very useful in order to get a "list" of details, ...but, when I wanted
    to get a single value I have some problems with persistence, something about "saving a state"
    despite I just want to get the value of a single detail.
    I decided to change it to map-mapping and the problem related with a single detail
    worked successfully, but I can get access to the whole bunch of details.
    May anyone of you help me with that?
    I am very confused I do not know what to do.
    Have any of you a solution for that problem?
    Thank you very much.

    Have you tried a restore in iTunes?

  • Problem with native SQL cursor in generic data source

    Hi, All!
    I am implementing generic data source based on FM.
    Because of complicated SQL I canu2019t use Open SQL and RSAX_BIW_GET_DATA_SIMPLE-example u201Cas isu201D.
    So, I have to use Native SQL. But Iu2019ve got a problem with a cursor. When I test my data source in RSA3, everything is Ok. But, if I start appropriate info-package, I get error u201CABAP/4 processor: DBIF_DSQL2_INVALID_CURSORu201D. It happens after selecting of 1st data package in line u201CFETCH NEXT S1 INTOu2026u201D. It seems to me that when system performs the second call of my FM the opened cursor has already been disappeared.
    Did anyone do things like this and what is incorrect?
    Is it real to make generic data source based on FM with using Native SQL open, fetch, closeu2026

    Hi Jason,
    I don't think this SQL is very valuable It is just an aggregation with some custom rules. This aggregation is performing on info-provider which consists of two info-cubes. Here we have about 2 billion records in info-provider and about 30 million records in custom db-table Z_TMP (certainly, it has indexes). I have to do this operation on 21 info-providers like this and I have to do this 20 times for each info-provider (with different values of host-variable p_GROUP)
    SELECT T.T1, SUM( T.T2 ), SUM( T.T3 ), SUM( T.T4 )
            FROM (
                    SELECT F."KEY_EVENT06088" AS T1,
                            F."/BIC/EV_COST" + F."/BIC/EV_A_COST" AS T2,
                            DECODE( D.SID_EVENTTYPE, 23147, 0,
                                                          23148, 0,
                                                          23151, 0,
                                                          23153, 0,
                                                          23157, 0,
                                                          23159, 0,
                                                          24896734, 0,
                                                          695032768, 0,
                                                          695029006, 0,
                                                          695029007, 0,
                                                          695036746, 0, F."/BIC/EV_COST") +
                              DECODE( D.SID_EVENTTYPE, 23147, 0,
                                                          23148, 0,
                                                          23151, 0,
                                                          23153, 0,
                                                          23157, 0,
                                                          23159, 0,
                                                          24896734, 0,
                                                          695032768, 0,
                                                          695029006, 0,
                                                          695029007, 0,
                                                          695036746, 0, F."/BIC/EV_A_COST") AS T3,
                            DECODE( D.SID_EVENTTYPE, 23147, F."/BIC/EV_DURAT",
                                                          23148, F."/BIC/EV_DURAT",
                                                          23151, F."/BIC/EV_DURAT",
                                                          23153, F."/BIC/EV_DURAT",
                                                          23157, F."/BIC/EV_DURAT",
                                                          23159, F."/BIC/EV_DURAT",
                                                          24896734, F."/BIC/EV_DURAT",
                                                          695032768, F."/BIC/EV_DURAT",
                                                          695029006, F."/BIC/EV_DURAT",
                                                          695029007, F."/BIC/EV_DURAT",
                                                          695036746, F."/BIC/EV_DURAT", 0) AS T4
                      FROM "/BIC/VEVENT0608F" F,
                           Z_TMP G,
                           "/BIC/DEVENT06085" D
                      WHERE F."KEY_EVENT06088" = G.ID
                            AND F."KEY_EVENT06085" = D.DIMID
                            AND G.GROUP_NO = :p_GROUP
                            AND ( F."/BIC/EV_COST" < 0 OR F."/BIC/EV_A_COST" < 0 )
                            AND D.SID_EVENTTYPE <> 695030676 AND D.SID_EVENTTYPE <> 695030678
                    UNION
                    SELECT F."KEY_EVNA06088" AS T1,
                            F."/BIC/EV_COST" + F."/BIC/EV_A_COST" AS T2,
                            DECODE( D.SID_EVENTTYPE, 23147, 0,
                                                          23148, 0,
                                                          23151, 0,
                                                          23153, 0,
                                                          23157, 0,
                                                          23159, 0,
                                                          24896734, 0,
                                                          695032768, 0,
                                                          695029006, 0,
                                                          695029007, 0,
                                                          695036746, 0, F."/BIC/EV_COST") +
                              DECODE( D.SID_EVENTTYPE, 23147, 0,
                                                          23148, 0,
                                                          23151, 0,
                                                          23153, 0,
                                                          23157, 0,
                                                          23159, 0,
                                                          24896734, 0,
                                                          695032768, 0,
                                                          695029006, 0,
                                                          695029007, 0,
                                                          695036746, 0, F."/BIC/EV_A_COST") AS T3,
                            DECODE( D.SID_EVENTTYPE, 23147, F."/BIC/EV_DURAT",
                                                          23148, F."/BIC/EV_DURAT",
                                                          23151, F."/BIC/EV_DURAT",
                                                          23153, F."/BIC/EV_DURAT",
                                                          23157, F."/BIC/EV_DURAT",
                                                          23159, F."/BIC/EV_DURAT",
                                                          24896734, F."/BIC/EV_DURAT",
                                                          695032768, F."/BIC/EV_DURAT",
                                                          695029006, F."/BIC/EV_DURAT",
                                                          695029007, F."/BIC/EV_DURAT",
                                                          695036746, F."/BIC/EV_DURAT", 0) AS T4
                    FROM "/BIC/VEVNA0608F" F,
                         Z_TMP G,
                         "/BIC/DEVNA06085" D
                    WHERE F."KEY_EVNA06088" = G.ID
                          AND F."KEY_EVNA06085" = D.DIMID
                          AND G.GROUP_NO = :p_GROUP
                          AND ( F."/BIC/EV_COST" < 0 OR F."/BIC/EV_A_COST" < 0 )
                          AND D.SID_EVENTTYPE <> 695030676 AND D.SID_EVENTTYPE <> 695030678
                 ) T
            GROUP BY T.T1

  • Refresh problem with collection

    Hello, apologize my English, I have got problem with refresh collections. Follow:
    1) I have got two classes which have got dependency together.
    2) First class has got collection of objects from second class.
    3) I call query "findXXX" which fill collection first class.
    4) I create new object second class and again call query "findXXX" to get actual collection. But collection contain old values a I have to close and open web browser to get actual data.
    I think It is problem with TopLink cache, but I do not know how solve this.
    Can you help me, please?

    The cached data is probably stale.
    There are many ways to solve this. (see the caching section of the docs)
    - there is a refresh option on the query
    - you can set a descriptor to be isolated (Cache.shared=false)
    - you can set a descriptor to always refresh
    - there is a cache invalidation option on descriptor
    - there is a cache synchronization option on session
    If the cache is stale, but the database was not accessed outside the application, it may be that your application is not maintaining relationships correctly. You must ensure you set both sides of a bi-directional relationship.
    -- James : http://www.eclipselink.org

  • Problem with Collective billing

    Hi,
    I have problem doing collective billing for one of my sales order that consist of 2 item, one is a TAN and the other is a TAS. Because of the different business process, i have to combine the billing of a delivery note (for the TAN item) and the sales order (for the TAS item) into one invoice. However when i do so, i end up with 2 invoices. Pls advise.
    Just wondering if the BlCat is different, can the invoice be combine?

    Hi,
    Invoice split will happen if you have any of the following values are different.
    1.Payer
    2. Inco Terms
    3. Payment Terms
    4. Shipping Condition
    5.Country
    6.Transportation Group
    7. Exchange Rate
    Click on the Split analysis.You will come to know why the splitting is happening.
    The procedure for this split analysis is:
    Goto the T.Code "VF02".
    Enter the number of the first billing document that you want to compare. Click on  Environment --> Split analysis.
    Enter the number of the second billing document which you want to compare to the first in the dialog box given.
    Click on "Continue".
    The system displays the Billing document split analysis log.
    Regards,
    Krishna.

  • Problem with OS X, Cursor, Zoom, Dictionary Issues

    Hi All,
    I'm wondering if someone can provide some guidance to problems I've recently been having with my Mac Book Pro laptop. Starting about a week ago, my cursor on the screen seemed to grow a mind of it's own and all of a sudden started acting strangely. When I'd go to scroll down a screen it wouldn't respond at first and then it would respond but not go anywhere in the direction I was moving it. Simultaneously, the screen would zoom in and out and become unresponsive and then whatever text was in the range of the cursor would randomly hightlight in yellow and a dictonary definition of the word would pop up.
    If anyone has any experience with problems such as these, can you please let me know. I'm having these issues frequently enough to make the computer really unusable. I'm not sure if this is a problem with my computer itself or some software glitch. I've never had problems with this MacBook Pro before, and it is very new, purchased just like 18 months ago.

    Portables and Magic Trackpad: Jumpy or erratic trackpad operation

  • Hi i have some problem with collect statement.

    hi when i am using collect statement and whn ever any field is modified it is getting doubled and showing doubled value. may i knoe what would be problem.

    Hai Kumar
    Go through the following Collect Syntax
    COLLECT
    Basic form
    COLLECT [wa INTO] itab.
    Addition
    ... SORTED BY f
    Effect
    COLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab .
    If you use only COLLECT to fill an internal table, COLLECT makes sure that the internal table does not contain two entries with the same default key fields.
    If, besides its default key fields, the internal table contains number fields (see also ABAP/4 number types ), the contents of these number fields are added together if the internal table already contains an entry with the same key fields.
    If the default key of an internal table processed with COLLECT is blank, all the values are added up in the first table line.
    If you specify wa INTO , the entry to be processed is taken from the explicitly specified work area wa . If not, it comes from the header line of the internal table itab .
    After COLLECT , the system field SY-TABIX contains the index of the - existing or new - table entry with default key fields which match those of the entry to be processed.
    Notes
    COLLECT can create unique or compressed datasets and should be used precisely for this purpose. If uniqueness or compression are unimportant, or two values with identical default key field values could not possibly occur in your particular task, you should use APPEND instead. However, for a unique or compressed dataset which is also efficient, COLLECT is the statement to use.
    If you process a table with COLLECT , you should also use COLLECT to fill it. Only by doing this can you guarantee that
    the internal table will actually be unique or compressed, as described above and
    COLLECT will run very efficiently.
    If you use COLLECT with an explicitly specified work area, it must be compatible with the line type of the internal table.
    Example
    Compressed sales figures for each company
    DATA: BEGIN OF COMPANIES OCCURS 10,
            NAME(20),
            SALES TYPE I,
          END   OF COMPANIES.
    COMPANIES-NAME = 'Duck'.  COMPANIES-SALES = 10.
    COLLECT COMPANIES.
    COMPANIES-NAME = 'Tiger'. COMPANIES-SALES = 20.
    COLLECT COMPANIES.
    COMPANIES-NAME = 'Duck'.  COMPANIES-SALES = 30.
    COLLECT COMPANIES.
    The table COMPANIES now has the following appearance:
    NAME SALES
    Duck 40
    Tiger 20
    Addition
    ... SORTED BY f
    Effect
    COLLECT ... SORTED BY f is obsolete and should no longer be used. Use APPEND ... SORTED BY f which has the same meaning.
    Note
    Performance
    The cost of a COLLECT in terms of performance increases with the width of the default key needed in the search for table entries and the number of numeric fields with values which have to be added up, if an entry is found in the internal table to match the default key fields.
    If no such entry is found, the cost is reduced to that required to append a new entry to the end of the table.
    A COLLECT statement used on a table which is 100 bytes wide and has a key which is 60 bytes wide and seven numeric fields is about approx. 50 msn (standardized microseconds).
    Note
    Runtime errors
    COLLECT_OVERFLOW : Overflow in integer field when calculating totals.
    COLLECT_OVERFLOW_TYPE_P : Overflow in type P field when calculating totals.
    Thanks & regards
    Sreenivasulu P

  • Problems with collective search help

    Hello SDNers,
    I was working with collective search help.
    Ex : zc_srch1 (Collective)
    In the 'Include search help' i have included 2 search elementary search
    help
    Ex : zsrc1 and zsrc2 (both elementary)
    I have also assigned the parameter assignment for each included search help.
    I have also mentioned the search help parameter under definition tab
    Ex field form zsrch1 and field1 from zsrch2
    and also checked the import and export checkboxes.
    Now i have used the search help in the abap program
    ex: tmp type field1 matchcode object zc_srch1.
    Now when i execute the program the collective search help is getting populated.  when i try to choose a value it is not getting selected to the parameter box.
    Regards,
    Ranjith N

    Hi,
    Once again check back your seach help creation by following the link below.
    http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21ee86446011d189700000e8322d00/content.htm
    Cheers!!
    VEnk@

  • Satellite P100-324: Problems with Vista installation - cursor blinking

    All greetings. Tried to put one of these days Windows Vista. But my attempts by failure have ended. After the first ???????????? there is a black screen and the blinking cursor. Thus any activity HDD and DVD it is not observed. BIOS recently updated up to v3.30. Help to put, already and I do not know what to think up.
    For English I apologize, I from Russia:)

    The disk "With" was formatted under NTFS then there was a pure installation from a loading disk through BIOS. At the start the computer starts to be loaded, and reaching a place where there should be a window of loading there is a black screen with the blinking cursor in the top left corner. Tried to wait for 10-15 mines, results has not brought.: (

  • Problem with collection names getting replaced when creating new collections in Photoshop Elements 5.0

    We have been using Photoshop Elements 5.0 a lot lately to organize many photos into collections.  A new problem just arose when creating a new collection.
    As we named the new collection and clicked on "OK" it replaced another existing collection with the new name.  The photos from the old collection were still there but now under the new collection name.  This happened at least three or four times, each time a different "old" collection was renamed.  Does anyone know why this would happen?
    This past week we have added at least 20 new collections with no problem prior to this.  Adobe actually had to shut down when this happened.  Each time we reopened Adobe it would happen again randomly renaming a different "old" collection when we tried to add the new one.  Any insights would be much appreciated.

    Thank you - that was the problem and now it is working correctly
    again!
    Tom Z.
    >>> saurabh288 <[email protected]> 05/24/09 4:23 AM >>>
    It may be that the catalog has been corupted.Try repairing the
    catalog of PSE.

  • Problems with Collections

    I downloaded the Demo of Lightroom yesterday and have been experimenting with it. I've created various collections, and had no problem dragging pictures into them. I was dragging some pictures into a collection this afternoon, and somehow, the entire library got selected. So I deselected everything, and now I can no longer drag pictures into the collections. I think I'm suppose to be able to drag pictures to rearrange them in the thumbnail window, but I can't do that either. I also can't rearrange pictures in the collections. If I select multiple pictures, the 1st one is highlighted brighter than all the other ones. I've restarted Lightroom multiple times, I've restarted the computer, I threw away the only preference file I could find for Lightroom (com.adobe.Lightroom.plist), and I've tried re-installing Lightroom. I'm totally stumped. Anybody have any ideas?
    thanks
    Mac 10.4.8, 2 gigs of ram, PowerPC iMac

    > Of course, now I have read what the answer is - selecting the picture and not the border - it is soooo obvious.
    Thats funny, because I had the same problem, but in the opposite way.
    Normally in windows, when you Shift-Click or Ctrl-Click to select
    multiple items, and then if you do a regular click on one of the items,
    the rest of the items will be deselected. Well, I've been suffering from
    the problem of it NOT behaving like that. It's kind of annoyed me, but I
    just do a Ctrl-D (deselect all) and then click. Now that I read your
    post, I realize that if I click on the border instead of the picture, it
    WILL behave the way I expect it.
    I don't know how Mac user interfaces should behave, but in windows, if
    you have multiple selections, then a normal click without a drag will
    deselect everything except the item you clicked, but if you press the
    mouse button and start dragging before you release the button, it's NOT
    treated as a deselect. It is treated as a drag and drop. If you drop it
    onto something that doesn't make sense (like dropping it onto the
    filmstrip) then it leaves everything just the way it was and pretends
    like you never clicked anything. That would be the proper way to do it
    to be consistant with Windows interface standards.
    Of course, being able to click within a selection without deselecting
    everything else has advantages too. For instance, if you select a bunch
    of images, you can then go through them and choose the one you intend to
    be your primary selection for purposes of syncing settings or metadata.

  • Problem with Collection API method LIMIT?

    Hi,
    I am trying to learn PL/SQL in my free time and I can't get collection_name.LIMIT to work correctly.
    declare
    type list is table of integer;
    set_a list := list(1,2,3,3);
    i pls_integer := 0;
    begin
    set_a.trim(2);
    i := set_a.limit;
    dbms_output.put_line('Trim(2) leaves ' || to_char(i) || ' spaces in list');
    end;
    The above code prints 'Trim(2) leaves spaces in list'. I first tried putting set_a.limit inside the to_char and got the same results. I tried using it in the expression for an IF statement as I have read in the book and online; something like if set_a.limit < 4 then... This returns true, while set_a.limit > 1 returns false.
    Am I doing something wrong?
    Oh, and I am using the win32_11gR2_database I got from the Oracle download page on Windows XP SP3.
    Thanks.
    Edited by: user13107973 on Aug 24, 2010 3:08 PM

    I figured it out, on closer inspection I see it is only used for varying arrays, and I was trying it on a nested table... Thanks for the advice.
    So, I am reading a horrible book full of typos called "Oracle Database 11g PL/SQL Programming" from the Oracle Press and McGraw Hill.
    BULK COLLECT INTO, page 123
    "The LIMIT statement lets you constrain the size of bulk selections, but you can only use it with explicit cursors." - NOT what I asked about.
    FORALL, page 127
    "The FORALL loop is designed to work with Oracle collections. It lets you insert, update, or delete bulk data." - NOT what I asked about.
    Collection API, page 253
    "The LIMIT method returns the highest possible subscript value in a collection. It can only return a PLS_INTEGER type and can only be used by a VARRAY datatype. It has the following prototype..."
    Edited by: user13107973 on Aug 25, 2010 12:09 PM
    Edited by: user13107973 on Aug 25, 2010 12:09 PM

Maybe you are looking for