Many rows in DBA_UNDO_EXTENTS

Hi,
in my DBA_UNDO_EXTENTS I have many and many rows with status = UNEXPIRED
I'm reading these link:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/undo.htm
and Oracle® Database 2 Day DBA but i don't know how i can delete these row.
If I want introduce the Retention period i can set the RETENTION GUARANTEE to the UNDO TBS, right?
Thanks a lot, as usual
Lain

Hello,
You can reduce the datafiles of the Undo Tablespaces as any kind of datafiles
but, you cannot go below the HWM.
Please, find enclosed a query to get the HWM position of every datafile (in Mo)
of the Undo Tablespace:
col file_name for A60
select B.file_name, (A.block_id + A.blocks)*{color:red}8{color}/1024 "Mo"
from dba_undo_extents A, dba_data_files B
where A.file_id = B.file_id
and A.block_id = (select max(C.block_id)
from dba_undo_extents C
where C.file_id = A.file_id
order by A.file_id
NB: In red the block size of your Database in Ko (here 8Ko).
You get a result like that:
FILE_NAME                                                            Mo
E:\ORACLE\ORADATA\PRD\LOG\UNDOTBS01.DBF                      30.0703125
E:\ORACLE\ORADATA\PRD\LOG\UNDOTBS02.DBF                      19.0703125
E:\ORACLE\ORADATA\PRD\LOG\UNDOTBS03.DBF                      40.0703125So, in this example, you cannot resize the first datafile below ~ 31 Mo.
Hope this help.
Best regards,
Jean-Valentin
Edited by: Lubiez Jean-Valentin on Jan 25, 2010 8:33 PM

Similar Messages

  • Result set does not fit; it contains too many rows

    Dear All,
    We are in BI7 and running reports on Excel 2007. Even though number of rows limitation in Excel 2007 is more than  1Million, when I try to execute a report with more than 65k records of output, system is generating output only for 65k rows with message "Result set does not fit; it contains too many rows".
    Our Patch levels:
    GUI - 7.10
    Patch level is 11
    Is there any way to generate more than 65000 rows in Bex?
    Thanks in advance...
    regards,
    Raju
    Dear Gurus,
    Could you please shed some light on this issue?
    thanks and regards,
    Raju
    Edited by: VaraPrasadraju Potturi on Apr 14, 2009 3:13 AM

    Vara Prasad,
    This has been discussed on the forums - for reasons of backward compatibility I do not think BEx supports more that 65000 rows .... I am still not sure about the same since I have not tried out a query with more that 65K rows on excel 2007 but I think this is not possible...

  • How to know how many rows including headers and footers does subreport has from Main Report

    Hi, we are sturuggling with subreports. Main report has 3 subreports, each subreport is inplmented in a group header(3 subreports and 3 group headers). We would like to print a group header under subreport as a column header every page, and need a page break when group number is changed. This report exports a MS Excel(97-2003) report file.
    In main report, [New After Page] is checked under Group Header #1d from [Section Expert]
    In each subreport, [Repeat Group Header On Each Page] is checked under the highest group from [Group Expert]
    Here are two issues;
    Since Crystal Reports has more rows than Excel in one page, colmun header in each subreport is being printed in the middle of the page. It should be printed at the top of the page
    When Subreport has many rows and has to be printed in more than 1 page, a page break is automatically inserted before column header. It should be printed right below column header which is Group Header #1
    We have been trying to pass row counts(count of group header because group header is used as the details) using a shared variable from Subreport 1 to Subreport 2 via main report since Subreport2 cannot predict how many rows Subreport 1 has.
    Here is what we are trying but we are getting an error which is "A constant expression is required here" under main report
    - In Sunreport 1
    whileprintingrecords;
    shared numbervar SubGroupCount := DistinctCount({Table.Field});
    - In Mainreport
    shared numbervar SubGroupCount;
    if(pagenumber) = 1
    then (SubGroupCount)
    else 50
    Is there any solutionss or better ways other than above?
    Thank you,
    Main Report: Group Header #1a --> as Page Header
    Run Date: mm/dd/yyyy                                                                 Report Name
    Main Report Group Header #1b --> Subreport 1
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6
    Main Report Goup Header #1c --> Subreport 2
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6
    Main Report Froup Header #1d --> Subreport 3
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6

    Thank you for your reply and sorry for my complicated explanations. The report has confidential information, so I replaced to some fake data but I believe you can still see what I am trying to do..
    Main Report
    Subreport 2
    Output1
    Output2: the following page
         --> more rows are printed..
    We have two problems;
    1. The column header in Output2 is supposed to be pronted right below the last row in Output2, however, a page break is automatically inserted. But even in the same output document, it works for some group when it has a few rows..
    2. Since Crystal Reports prints more rows in one page than MS Excel does, Column header is not be printed at the top of the page.
    I tried the way you advised me but it did not work..

  • Is there an easy way to see how many rows in a table? (selected or unselected)

    Hi all,
    Forgive me if this is a REALLY dumb question but I would love to know if there there is an easy way to to see how many rows there are in a table in InDesign?
    (And I bet I am really going to kick myself when I hear the answer and how simple it probably is..lol !)
    I am working on a huge catalog and am dealing with LOTS of tables...very long tables too at times. I am also doing a lot of copying and pasting back and forth between InDesign and Excel and it would REALLY help if I knew how many rows there are in a table without having to manually count them (TIRESOME!!).
    Also, is there a way to see how many rows I have selected at any one time? It would be SO WONDERFUL if the info box could also provide this information.
    Thank you SO MUCH in advance for your help:))
    Christine
    **UPDATE**
    Oh boy I AM going to kick myself! Why only NOW that I wrote this question did I suddenly notice that the Table palette shows the number of rows and columns? lol.
    Okay, then is there a way to see how many rows I have selected at any given time?

    @Christine – try the following ExtendScript (JavaScript):
    if(app.selection.length === 0
        || !app.selection[0].constructor.name === "Cell"
        || !app.selection[0].constructor.name === "Table"){
        exit(0);
    var sel = app.selection[0];
    if(sel.constructor.name === "Cell"){
        var tableRowLength = sel.parent.rows.everyItem().getElements().length;
    if(sel.constructor.name === "Table"){
        alert("All "+sel.rows.everyItem().getElements().length+" rows selected in current table." );
        exit(0);
    var numberOfRowsSelected = sel.rows.length;
    var indexOfSelectedRows = sel.rows.everyItem().index;
    var startRowSel = indexOfSelectedRows[0]+1;
    var endRowSel = indexOfSelectedRows.length+indexOfSelectedRows[0];
    alert(numberOfRowsSelected +" row(s) selected.\r"+startRowSel+" to "+endRowSel+" out of "+tableRowLength+" of current table.");
    You need not select whole rows, just one or a couple of cells.
    Then run the script.
    An alert message is telling you how many rows belong to the cell range you have selected and:
    which rows of the table are selected…
    A typical message would be:
    6 row(s) selected.
    3 to 8 out of 20 of current table.
    The script does some basic checks of the selection.
    If no cell or table is selected, it will just do nothing…
    Uwe
    Message was edited by: Laubender | Some language cosmetics in the alert message

  • Copying many rows from one table to another

    Could anyone tell me the best way to copy many rows (~1,000,000) from one table to another?
    I have supplied a snipit of code that is currently being used in our application. I know that this is probably the slowest method to copy the data, but I am not sure what the best way is to proceed. I was thinking that using BULK COLLECT would be better, but I do not know what would happen to the ROLLBACK segment if I did this. Also, should I look at disabling the indexes while the copy is taking place, and then re-enable them after it is complete?
    Sample of code currently being used:
    PROCEDURE Save_Data
    IS
    CURSOR SCursor IS
    SELECT     ROWID Row_ID
    FROM     TMP_SALES_SUMR tmp
    WHERE NOT EXISTS
    (SELECT 1
         FROM SALES_SUMR
         WHERE sales_ord_no = tmp.sales_ord_no
         AND cat_no = tmp.cat_no
         AND cost_method_cd = tmp.cost_method_cd);
    BEGIN
    FOR SaveRec IN SCursor LOOP
    INSERT INTO SALES_ORD_COST_SUMR
    SELECT *
    FROM TMP_SALES_ORD_COST_SUMR
    WHERE ROWID = SaveRec.Row_ID;
    RowCountCommit(); -- Performs a Commit for every xxxx rows
    END LOOP;
    COMMIT;
    EXCEPTION
    END Save_Data;
    This type of logic is used to copy data for about 8 different tables, each containing approximately 1,000,000 rows of data.

    Your best bet is
    Insert into SALES_ORD_COST_SUMR
    select * from TMP_SALES_ORD_COST_SUMR;
    commit;
    Read this
    http://asktom.oracle.com/pls/ask/f?p=4950:8:15324326393226650969::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:5918938803188
    VG

  • List of Value: Best practice when there are too many rows.

    Hi,
    I am working in JDev12c. Imagine the following scenario. We have an employee table and the organization_id as one of its attributes. I want to set up a LOV for this attribute. For what I understand, if the Organization table contains too many rows, this will create an extreme overhead (like 3000 rows), also, would be impossible to scroll down in a simple LOV. So, I have decided the obvious option; to use the LOV as a Combo Box with List of Values. Great so far.
    That LOV will be use for each user, but it doesn't really depend of the user and the list of organization will rarely change. I have a sharedApplicationModule that I am using to retrieve lookup values from DB. Do you think would be OK to put my ORGANIZATION VO in there and create the View Accessor for my LOV in the Employees View?
    What considerations should I take in term of TUNING the Organization VO?
    Regards

    Hi Raghava,
    as I said, "Preparation Failed" may be (if I recall correctly) as early as the HTTP request to even get the document for indexing. If this is not possible for TREX, then of course the indexing fails.
    What I suggested was a manual reproduction. So log on to the TREX host (preferrably with the user that TREX uses to access the documents) and then simply try to open one of the docs with the "failed" status by pasting its address in the browser. If this does not work, you have a pretty good idea what's happening.
    Unfortunately, if that were the case, this would the be some issue in network communications or ticketing and authorizatuions, which I can not tell you from here how to solve.
    In any case, I would advise to open a support message to SAP - probably rather under the portal component than under TREX, as I do not assume that this stage of a queue error has anything to do with the actual engine.
    Best,
    Karsten

  • ADF: Best way to find out how many rows are fetched?

    Hello,
    I have overridden method executeQueryForCollection of ViewObject in which I execute supper.executeQueryForCollection and after that want to find out how many rows are fetched during the execution.
    If I try to use getFetchedRowCount I always get "0", if using getEstimatedRowCount, query are being re-executed.
    What method is better to use for that?
    Thank you,
    Veniamin Goldin
    Forbis, Ltd.

    I have a 'home-made' view called RBS, whose definition is this:
    create view RBS as
    select /*+ RULE  */ substr(s.username,1,10) oracle,
           substr(case when s.osuser like 'oramt%'
                       then nvl(upper(s.client_info),'client_info not set')
                       else substr(s.machine,instr(s.machine, '\')+1,length(s.machine))||':'||s.osuser
                  end
                  ,1,20) CLIENT
    ,      substr(''''||s.sid||','||s.serial#||''''||decode(s.status,'KILLED','*',''),1,12) kill_id
    ,      lpad(to_char(t.xidusn),4) rbs#
    ,      lpad(to_char(t.used_ublk),4) ublk
    ,      lpad(to_char(t.used_urec),8) urecords
    ,      i.block_gets
    ,      lpad(to_number(round((sysdate - to_date(t.start_time,'MM/DD/YY HH24:MI:SS')) * 60 * 60 * 24)),9) time
    ,      upper(substr(s.program,1,20)) PROGRAM
    ,      to_char(s.LOGON_TIME,'HH24:MI:SS DD-MON') LOGIN_TIME
    from   sys.v_$transaction t
    ,      sys.v_$session s
    ,      sys.v_$sess_io i
    ,      sys.v_$process p
    where  s.saddr = t.ses_addr
    and    i.sid = s.sid
    and    p.addr = s.paddr
    /By monitoring the URECORDS column value of the row that corresponds to my session doing a transaction, I can see how it progresses.
    Toon

  • How to find out How many rows and coloumn exists in the Excel sheet

    hai gurus,
                 present iam uploading data from presentation server to application server.  when i use gui_upload the data is coming non-readable format.
    so i used alsm_excel_to_int fm for that . but the problem is user can give any type of excel so... i need to know how many rows and coloumn s existed in that Excel
    so is there any possiblity to get those values(Total rows and total coloumns).
    plz help me..
    if any one answered , appreciate with reward points,
    thanks&regards,
    Venu.T

    see you have to come into an agreement with other system before starting development..
    Please dont do unnecessary coding for impractical things ..you may solve this but this is not good way of working in eRP packages..
    Al least u can get final list of all Columns and which can be blank or non blank like this
    then u can  do coding for this scenerio
    regards...
    Message was edited by:
            Madan Gopal Sharma

  • To find out how many rows are processed/updated?

    Hi Gurus,
    I have given an update statement with parallelism. The data to be processed is huge around 50 million records.
    I know that from OEM, we can find out how many rows it has processed or completed. I would like to know the dictionary view/ query to find out the same in SQL Plus.
    Thanks
    Cherrish Vaidiyan

    I have a 'home-made' view called RBS, whose definition is this:
    create view RBS as
    select /*+ RULE  */ substr(s.username,1,10) oracle,
           substr(case when s.osuser like 'oramt%'
                       then nvl(upper(s.client_info),'client_info not set')
                       else substr(s.machine,instr(s.machine, '\')+1,length(s.machine))||':'||s.osuser
                  end
                  ,1,20) CLIENT
    ,      substr(''''||s.sid||','||s.serial#||''''||decode(s.status,'KILLED','*',''),1,12) kill_id
    ,      lpad(to_char(t.xidusn),4) rbs#
    ,      lpad(to_char(t.used_ublk),4) ublk
    ,      lpad(to_char(t.used_urec),8) urecords
    ,      i.block_gets
    ,      lpad(to_number(round((sysdate - to_date(t.start_time,'MM/DD/YY HH24:MI:SS')) * 60 * 60 * 24)),9) time
    ,      upper(substr(s.program,1,20)) PROGRAM
    ,      to_char(s.LOGON_TIME,'HH24:MI:SS DD-MON') LOGIN_TIME
    from   sys.v_$transaction t
    ,      sys.v_$session s
    ,      sys.v_$sess_io i
    ,      sys.v_$process p
    where  s.saddr = t.ses_addr
    and    i.sid = s.sid
    and    p.addr = s.paddr
    /By monitoring the URECORDS column value of the row that corresponds to my session doing a transaction, I can see how it progresses.
    Toon

  • Exception too many rows...

    Hi
    I am getting two different outputs with following code depending upon i declare the variable in first or second way...
    when i declare the variable v_empno as number(10) and too many rows exception is raised....and after that i dbms this variable..it is null...
    but when i declare the same variable as table.column%type....and the similar scenario happens and i dbms the value of variable...it is not null...rather the first value from output of the query...
    declare
    --v_empno number(10);
    v_empno emp.empno%type;
    begin
    dbms_output.put_line('before '||v_empno );
    select empno into v_empno from emp;
    dbms_output.put_line('first '||v_empno);
    exception when too_many_rows then
    dbms_output.put_line('second '||v_empno);
    dbms_output.put_line('exception'||sqlerrm);
    end;
    is there any specific reason for this....
    ur comments plz
    Thanks
    Sidhu

    In 9i:
    SQL> declare
      2  --v_empno number(10);
      3  v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11  end;
    12  /
    before
    second 7369
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.
    SQL> declare
      2  v_empno number;
      3  --v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11  end;
    12  /
    before
    second
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.
    SQL> edit
    Wrote file afiedt.buf
      1  declare
      2  v_empno number(10);
      3  --v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11* end;
    SQL> /
    before
    second 7369
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.In 10G:
    SQL> declare
      2  v_empno number(10);
      3  --v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11  end;
    12  /
    before
    second 7369
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.
    SQL> edit
    Wrote file afiedt.buf
      1  declare
      2  v_empno number;
      3  --v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11* end;
    SQL> /
    before
    second 7369
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.
    SQL> edit
    Wrote file afiedt.buf
      1  declare
      2  --v_empno number;
      3  v_empno emp.empno%type;
      4  begin
      5  dbms_output.put_line('before '||v_empno );
      6  select empno into v_empno from emp;
      7  dbms_output.put_line('first '||v_empno);
      8  exception when too_many_rows then
      9  dbms_output.put_line('second '||v_empno);
    10  dbms_output.put_line('exception'||sqlerrm);
    11* end;
    SQL> /
    before
    second 7369
    exceptionORA-01422: exact fetch returns more than requested number of rows
    PL/SQL procedure successfully completed.Anyhow you should not rely on the fact Oracle fetches the first value into variable
    and keeps it when the excaprion is raised.
    Tom Kyte discusses the SELECT INTO issue here:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:7849913143702726938::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1205168148688
    Rgds.

  • HAVE AS MANY ROWS AS I HAVE DAYS IN A MONTH

    Hi,
    im facing a big issue ...
    I must create a query that ask for a month and find how many days I have on that month and after, I must have as many rows as I have days ....
    example :  april = 30 days = 30 rows ( one for each day from 1 to 30 )
    Any way to achieve that ??
    Thanks

    Hi Raj,
    Thats the first thing I thought, but even if the day have no result, they such want the row ...
    example
    number of answered call for JOHN in APRIL by day ....
    row (day number) / column ( key , calls answered)
    1      0
    2      1
    3      0
    4      2
    5      3
    30    0
    thank's !

  • Display query's result (with many rows & field) into a list ?

    I'd like to display the result of a query wich returs many rows without using a list of values but another component which allowed the display of sereval columns at the same time.
    Note: I can't use a LOV because I don't want to return no value, and I need a TLIST presentation.
    null

    A kludgy solution would be to create a database view that combines the multiple columns into a single standardly formatted column, and use that for displaying in a jcombobox.
    Depends upon whether you like to code Java or like to play in the database. grin
    If you do that Java solution please post the code here!

  • AdvancedDataGrid: how to tell how many rows are currently visible?

    Does anyone know how to query an ADG (or its rows) to figure out how many rows are currently visible (i.e. not collapsed) when displaying different levels of a hierarchical collection?
    In other words I'd like a function that tells me that 7 lines are visible in this view
    and 1 line is currently visible in this one
    I  assume this is simple but can't seem to find the right keyword anywhere.
    thank you!
    f

    Never mind. Wrong post.

  • How many Rows?

    My old Appleworks Spreadsheet was limited to roughly 16,000 rows. Before I pop for new software, how many rows can I make a spreadsheet with using this new software? I've a project where a spreadsheet with the calicity to have 45,000 rows would be great. Otherwise, I'll have to do my project in Appleworks in batches.
    Thanks in Advance!

    I forget exactly. Somewhere upward of 60,000 I believe.  You might find the exact number by searching the forum. It will be an old post, probably by Yvan Koenig.
    Note that Numbers can get really slow with large tables. You might be pushing the limits of the current version.

  • Split row in many rows

    SELECT value FROM lsw_epv_var_value EVV
    JOIN lsw_epv E ON E.epv_id = EVV.epv_var_id
         AND E.name = 'AcessoTodasRegionais'
         AND EVV.EPV_VAR_VALUE_ID = (SELECT MAX(EPV_VAR_VALUE_ID) FROM LSW_EPV_VAR_VALUE EVV JOIN lsw_epv E ON E.epv_id = EVV.epv_var_id AND E.name = 'AcessoTodasRegionais' WHERE EFFECTIVE_ON <= SYSDATE)
    The result of the query above is
    tw_admins_internal,Diretoria de Negocios Nacional,Administradores Teamworks
    As you can see, the result is split by commas, I need to convert this result in many rows like below
    tw_admins_internal
    Diretoria de Negocios Nacional
    Administradores Teamworks
    How could I do that?
    Thanks

    Hi,
    /*     How to Split a Delimited String
    This shows how to take a single row with a delimited string, such as
         Animal     amoeba,bat,cedusa,dodo
    and transform it into multiple rows:
         Animal     1     amoeba
         Animal     2     bat
         Animal     3     cedusa
         Animal     4     dodo
    PROMPT     ==========  -1. sep_char parameter  ==========
    VARIABLE     sep_char     VARCHAR2 (10)
    EXECUTE     :sep_char := ',';
    SELECT     :sep_char     AS sep_char
    FROM     dual;
    PROMPT     ==========  0. string_test table  ==========
    DROP TABLE     string_test;
    CREATE TABLE     string_test
    (     grp_name     VARCHAR2 (10)
    ,     list_txt     VARCHAR2 (50)
    INSERT INTO string_test (grp_name, list_txt) VALUES ('Animal',     'amoeba,bat,cedusa,dodo');
    INSERT INTO string_test (grp_name, list_txt) VALUES ('Date',     '15-Oct-1582,16-Oct-2008');
    INSERT INTO string_test (grp_name, list_txt) VALUES ('Nothing',     NULL);
    INSERT INTO string_test (grp_name, list_txt) VALUES ('Place',     'New York');
    INSERT INTO string_test (grp_name, list_txt) VALUES ('Skip',     'Hop,,Jump');
    SELECT     *
    FROM     string_test
    ORDER BY     grp_name;
    PROMPT     ==========  Q1.  Oracle 11 Query  ==========
    WITH     cntr     AS          -- Requires Oracle 9
    (     -- Begin sub-query cntr, to generate n (1, 2, 3, ...)
         SELECT     LEVEL     AS n     -- Requires Oracle 9
         FROM     dual
         CONNECT BY     LEVEL     <= 1 +     (
                             SELECT     MAX ( REGEXP_COUNT (list_txt, :sep_char) )     -- Requires Oracle 11
                             FROM     string_test
    )     -- End sub-query cntr, to generate n (1, 2, 3, ...)
    SELECT     grp_name
    ,     n
    ,     REGEXP_SUBSTR     ( list_txt     -- Requires Oracle 10
                   , '[^' || :sep_char || ']'     -- Anything except sep_char ...
                        || '+'               -- ... one or more times
                   , 1
                   , n
                   )     AS item_txt
    FROM     string_test
    JOIN     cntr                                   -- Requires Oracle 9
    ON     n     <= 1 + REGEXP_COUNT (list_txt, :sep_char)     -- Requires Oracle 11
    ORDER BY     grp_name
    ,          n;
    /*     Notes:
         REGEXP_SUBSTR (s, '[^,]+', 1, n)
    returns the n-th item in a comma-delimited list s.
    If there are fewer than n items, it returns NULL.
    One or more consecutive characters other than comma make an item, so
    'Hop,,Jump' has two items, the second one being 'Jump'.
    The sub-query cntr produces a list of integers 1, 2, 3, ..., w
    where w is the worst-case (the largest number of items in any list).
    This actually counts separators, not items, (e.g., it counts both
    commas in 'Hop,,Jump', even though), so the w it produces may be
    larger than is really necessary.  No real harm is done.
    PROMPT     ==========  Q2. Possible Problems Fixed  ==========
    WITH     cntr     AS
    (     -- Begin sub-query cntr, to generate n (1, 2, 3, ...)
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL     <= 1 +     (
                             SELECT     MAX ( REGEXP_COUNT (list_txt, :sep_char) )
                             FROM     string_test
    )     -- End sub-query cntr, to generate n (1, 2, 3, ...)
    SELECT     grp_name
    ,     n
    ,     REGEXP_SUBSTR     ( list_txt
                   , '[^' || :sep_char || ']'     -- Anything except sep_char ...
                        || '+'               -- ... one or more times
                   , 1
                   , n
                   )     AS item_txt
    FROM     string_test
    JOIN     cntr          ON n     <= 1 + NVL     ( REGEXP_COUNT (list_txt, :sep_char)     -- Problem (1)
                                  , 0
    WHERE     REGEXP_SUBSTR     ( list_txt     -- Problem (2)
                   , '[^' || :sep_char || ']'     -- Anything except sep_char ...
                        || '+'               -- ... one or more times
                   , 1
                   , n
                   )     IS NOT NULL
    OR     list_txt     IS NULL          -- Problems (1) and (2) together
    ORDER BY     grp_name
    ,          n;
         (Possible) Problems and Fixes
    (1) If list_txt IS NULL, then REGEXP_COUNT (list_txt, :sep_char)
         returns NULL, the join condition fails, and the output
         contains nothing corresponding to the row from string_test.
         If you want a NULL item to appear in the results, use
         NVL to make sure the expression returns 0 instead of NULL.
    (2) If list_txt contains multiple consecutive sep_chars (or if it
         begins or ends with sep_char, then the original query
         will return NULL items.  To suppress these, add a WHERE
         clause to test that the item_txt to be displayed IS NOT NULL.
    PROMPT     ==========  Q3. Oracle 8.1 Query  ===========
    SELECT     grp_name
    ,     n
    ,     SUBSTR     ( list_txt
              , begin_pos
              , end_pos - begin_pos
              )     AS item_txt
    FROM     (     -- Begin sub-query to compute begin_pos and end_pos
         SELECT     grp_name
         ,     n
         ,     list_txt
         ,     INSTR     ( :sep_char || list_txt
                   , :sep_char
                   , 1
                   , n
                   )     AS begin_pos
         ,     INSTR     ( list_txt || :sep_char
                   , :sep_char
                   , 1
                   , n
                   )     AS end_pos
         FROM     string_test
         ,     (     -- Begin sub-query cntr, to generate n (1, 2, 3, ...)
              SELECT     ROWNUM     AS n
              FROM     all_objects
              WHERE     ROWNUM     <= 1 +     (
                             SELECT     MAX     ( LENGTH (list_txt)
                                       - LENGTH (REPLACE (list_txt, :sep_char))
                             FROM     string_test
              )     -- End sub-query cntr, to generate n (1, 2, 3, ...)
              cntr
         WHERE     n     <= 1 +     ( LENGTH (list_txt)
                        - LENGTH (REPLACE (list_txt, :sep_char))
         )     -- End sub-query to compute begin_pos and end_pos
    ORDER BY     grp_name
    ,          n;
    /*     Version-Dependent Features and Work-Arounds
    The code above, Q3, runs in Oracle 8.1.
    The following changes were made to Q1:
    (11) REGEXP_COUNT was introduced in Oracle 11.
         In earlier versions, to find the number of sep_chars in list_txt,
         see how much the LENGTH changes when sep_chars are removed.
    (10) REGEXP_SUBSTR was introduced in Oracle 10.
         In earlier versions, use INSTR to find where the sep_chars are,
         and use SUBSTR to get the sub-strings between them.
         (Using this technique, 'Hop,,Jump' still contains three items,
         but now item 2 IS NULL and item 3 is 'Jump'.)
    (9.a) The WITH-clause was introduced in Oracle 9
         In earlier versions, use in-line views.
    (9.b) "CONNECT BY LEVEL < constant" doesn't work in Oracle 8.
         Use ROWNUM from any sufficiently large table or view instead.
    (9.c) ANSII join notation (JOIN table_name ON ...) was introduced in Oracle 9
         In earlier versions, join condition go in a WHERE-clause.
    */

Maybe you are looking for

  • Interface Problems in Yosemite

    Problem shows up when using software other than the native OS X apps. If I attempt to close a window behind the app that has focus by clicking the red x part of the semaphore buttons (top left on every window) it will not work unless I change focus t

  • Java.security.InvalidKeyException: Unsupported key type: SunPKCS11-MyPKCS11

    I am having a very strange issue with my CAC card. I wrote a small Java program to login into ProjectForge.mil webservice ICollabNetSoap m_sfSoap = (ICollabNetSoap) ClientSoapStubFactory.getSoapStub(ICollabNetSoap.class, "https://project.forge.mil/")

  • How to create a labview program and use it as a compiled prgram

    I am a mechanical engineer, and I have some formulas and equations that I used to obtain maximum thickness of pipelines and also in the design of steel structures, what I need now is to use Labview to put these huge number of formulas in one program.

  • Changing a calendar of a webDAV event generates a 502 error

    To reproduce: 1. Select an event in iCal that is served from a WebDAV Server. 2. Using the optional click, change the calendar of the Event to another calendar on the same server. Result: iCal returns a "The server responded with"502" to operation Ca

  • I need help resizing in Photoshop Elements 3...Can anyone help me??

    So I have Photoshop Elements 3 for Mac. The image mode is RGB Color, and I have a certain layer that I want resized. So I go to Image - Transform - Free Transform. Once I am done resizing the image, and I have it how I want it, I hit enter, and the w